Correctly estimate SROA savings for store operands in inline cost analysis.
authorWei Mi <wmi@google.com>
Fri, 20 Mar 2015 18:33:12 +0000 (18:33 +0000)
committerWei Mi <wmi@google.com>
Fri, 20 Mar 2015 18:33:12 +0000 (18:33 +0000)
commit8979e3f69b73e4dabe527dcfd0bb1471e68bf081
tree3bbb98512754a582d1bbc3a022fda0b12373c694
parente7cec1e8539e8b5166932ede537fa6c6940823d0
Correctly estimate SROA savings for store operands in inline cost analysis.

When estimating SROA savings, we want to see if an address is derived
off an alloca in the caller. For store instructions, operand 1 is the
address operand, but the current code uses operand 0.  Use
getPointerOperand for loads and stores to fix this.

Patch by Easwaran Raman.
http://reviews.llvm.org/D8425

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232827 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/IPA/InlineCost.cpp
test/Transforms/Inline/store-sroa.ll [new file with mode: 0644]