[PATCH] D30552: Fix regressions cased by D29862

Evgeny Stupachenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 16:53:09 PDT 2017


evstupac added a comment.

Trying to fix the regressions I've inserted a check which uses Solution generated by NarrowSearchSpaceByDeletingCostlyFormulas() only if it's cost less than cost of regular Solution.
That way NarrowSearchSpaceByDeletingCostlyFormulas() can only decrease final Solution cost. But both matrix and hmmer regression were not resolved.
It turned out that NarrowSearchSpaceByDeletingCostlyFormulas() creates Solution with is better cost (using current cost model) for both cases.
Use of Insns in Cost model helps to resolve the issue.
Right now I see 3 ways to resolve this:

1. Accept current workaround.
2. Modify NarrowSearchSpaceByDeletingCostlyFormulas() to rely in Insns instead of Registers.
3. Change cost model to rely on Insns first and check which solution is better: regular or created by NarrowSearchSpaceByDeletingCostlyFormulas().



================
Comment at: lib/Transforms/Scalar/LoopStrengthReduce.cpp:4392
   DEBUG(dbgs() << "Narrowing the search space by deleting costly formulas\n");
 
   // Delete formulas where registers number expectation is high.
----------------
We can sort Uses indexes here instead of sorting Uses. That way we'll avoid change on line 4435.


Repository:
  rL LLVM

https://reviews.llvm.org/D30552





More information about the llvm-commits mailing list