forked from OSchip/llvm-project
90707394e3
When the formulae search space is huge, LSR uses a series of heuristic to keep pruning the search space until the number of possible solutions are within certain limit. The big hammer of the series of heuristics is NarrowSearchSpaceByPickingWinnerRegs, which picks the register which is used by the most LSRUses and deletes the other formulae which don't use the register. This is a effective way to prune the search space, but quite often not a good way to keep the best solution. We saw cases before that the heuristic pruned the best formula candidate out of search space. To relieve the problem, we introduce a new heuristic called NarrowSearchSpaceByFilterFormulaWithSameScaledReg. The basic idea is in order to reduce the search space while keeping the best formula, we want to keep as many formulae with different Scale and ScaledReg as possible. That is because the central idea of LSR is to choose a group of loop induction variables and use those induction variables to represent LSRUses. An induction variable candidate is often represented by the Scale and ScaledReg in a formula. If we have more formulae with different ScaledReg and Scale to choose, we have better opportunity to find the best solution. That is why we believe pruning search space by only keeping the best formula with the same Scale and ScaledReg should be more effective than PickingWinnerReg. And we use two criteria to choose the best formula with the same Scale and ScaledReg. The first criteria is to select the formula using less non shared registers, and the second criteria is to select the formula with less cost got from RateFormula. The patch implements the heuristic before NarrowSearchSpaceByPickingWinnerRegs, which is the last resort. Testing shows we get 1.8% and 2% on two internal benchmarks on x86. llvm nightly testsuite performance is neutral. We also tried lsr-exp-narrow and it didn't help on the two improved internal cases we saw. Differential Revision: https://reviews.llvm.org/D34583 llvm-svn: 307269 |
||
---|---|---|
.. | ||
2008-08-14-ShadowIV.ll | ||
2009-11-10-LSRCrash.ll | ||
2011-07-20-DoubleIV.ll | ||
2011-11-29-postincphi.ll | ||
2011-12-04-loserreg.ll | ||
2012-01-13-phielim.ll | ||
bin_power.ll | ||
canonical-2.ll | ||
canonical.ll | ||
incorrect-offset-scaling.ll | ||
ivchain-X86.ll | ||
ivchain-stress-X86.ll | ||
lit.local.cfg | ||
lsr-expand-quadratic.ll | ||
lsr-filtering-scaledreg.ll | ||
lsr-insns-1.ll | ||
lsr-insns-2.ll | ||
nested-loop.ll | ||
no_superflous_induction_vars.ll | ||
pr17473.ll | ||
pr28719.ll | ||
sibling-loops.ll |