Inlining and unrolling heuristics should be aware of free truncs.
authorAndrew Trick <atrick@apple.com>
Sat, 1 Oct 2011 01:39:05 +0000 (01:39 +0000)
committerAndrew Trick <atrick@apple.com>
Sat, 1 Oct 2011 01:39:05 +0000 (01:39 +0000)
commitb2ab2fa524f3f90376639037bd81924483cca0af
treee09aa034342e5ed6e61cd2b7bb363b5808c9fc1b
parent5c655413cf9466c29e38204ab3f19b33fffd7996
Inlining and unrolling heuristics should be aware of free truncs.

We want heuristics to be based on accurate data, but more importantly
we don't want llvm to behave randomly. A benign trunc inserted by an
upstream pass should not cause a wild swings in optimization
level. See PR11034. It's a general problem with threshold-based
heuristics, but we can make it less bad.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140919 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/CodeMetrics.h
include/llvm/Analysis/InlineCost.h
lib/Analysis/InlineCost.cpp
lib/Transforms/IPO/InlineAlways.cpp
lib/Transforms/IPO/InlineSimple.cpp
lib/Transforms/Scalar/LoopUnrollPass.cpp