When inlining a function and adding its inner call sites to the
authorChandler Carruth <chandlerc@gmail.com>
Mon, 12 Mar 2012 11:19:33 +0000 (11:19 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 12 Mar 2012 11:19:33 +0000 (11:19 +0000)
commit6c0b3ac8ea51d35bbd2565f17f1a73c3bfcb5cdf
treec2b037cd4eee85dfebfa559534cd769940752560
parentfc72ae613afd7ca2526bb66156bafe8b0054cb3b
When inlining a function and adding its inner call sites to the
candidate set for subsequent inlining, try to simplify the arguments to
the inner call site now that inlining has been performed.

The goal here is to propagate and fold constants through deeply nested
call chains. Without doing this, we loose the inliner bonus that should
be applied because the arguments don't match the exact pattern the cost
estimator uses.

Reviewed on IRC by Benjamin Kramer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152556 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/Inliner.cpp
test/Transforms/Inline/inline_constprop.ll