Support pointer comparisons against constants, when looking at the inline-cost
authorNick Lewycky <nicholas@mxc.ca>
Wed, 25 Jan 2012 08:27:40 +0000 (08:27 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Wed, 25 Jan 2012 08:27:40 +0000 (08:27 +0000)
commit6977e79526a6342b9408c358bca21c3b0c7e61d5
treebbd83da702e4e35ee06a813dd4aabb23c9a09a22
parent8f7fe08fee403994a50bb3c07384453c0d046558
Support pointer comparisons against constants, when looking at the inline-cost
savings from a pointer argument becoming an alloca. Sometimes callees will even
compare a pointer to null and then branch to an otherwise unreachable block!
Detect these cases and compute the number of saved instructions, instead of
bailing out and reporting no savings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148941 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InlineCost.cpp
test/Transforms/Inline/alloca-bonus.ll