summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-01-26 23:21:56 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-01-26 23:21:56 +0000
commit02346282843c7682c24e661e5100cffa3def186b (patch)
tree9023fe34086584d2629f636802cdd49a1a0c31a3 /llvm/lib/Transforms/Utils/InlineFunction.cpp
parentc7b91156e48072cb8ebd72a4f1b5363676079d82 (diff)
downloadbcm5719-llvm-02346282843c7682c24e661e5100cffa3def186b.tar.gz
bcm5719-llvm-02346282843c7682c24e661e5100cffa3def186b.zip
Fix inline cost predictions with SCIENCE.
After running a batch of measurements, it is clear that the inliner metrics need some adjustments: Own argument bonus: 20 -> 5 Outgoing argument penalty: 0 -> 5 Alloca bonus: 10 -> 5 Constant instr bonus: 7 -> 5 Dead successor bonus: 40 -> 5*(avg instrs/block) The new cost metrics are generaly 25 points higher than before, so we may need to move thresholds. With this change, InlineConstants::CallPenalty becomes a political correction: if (!isa<IntrinsicInst>(II) && !callIsSmall(CS.getCalledFunction())) NumInsts += InlineConstants::CallPenalty + CS.arg_size(); The code size is accurately modelled by CS.arg_size(). CallPenalty is added because calls tend to take a long time, so it may not be worth it to inline a function with lots of calls. All of the political corrections are in the InlineConstants namespace: IndirectCallBonus, CallPenalty, LastCallToStaticBonus, ColdccPenalty, NoreturnPenalty. llvm-svn: 94615
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud