[PATCH] D29862: LSR: an alternative way to resolve complex solution

Evgeny Stupachenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 1 09:27:43 PST 2017


evstupac added a comment.

Thanks for reporting the regressions. It looks like I have a simple fix for both.
Here is the case:
Use1 (Address):
 {a} + {0,+,1} // register num expectation 1 + 1/2
 {a,+,1}  // register num expectation 1
Use2 (Address):
 {b} + {0,+,1}
 {b,+,1}
Use3 (ICmpZero):
 -1024 + {0,+,1}

That way new method will select {a,+1} {b,+,1} and -1024 + {0,+,1} which is not optimal in terms of AddRecExprs (still optimal in terms of RegNum)

In Matrix test there are 32 Address uses like above. The expectation of {a} + {0,+,1} becomes very close 1, but still grater than 1.
The solution is simple - delete formulas in ICmpZero before Address. That way the optimal solution is selected (as {0,+,1} becomes unique).

And I'm testing new patch without float (with APInt numerator and denominator).


Repository:
  rL LLVM

https://reviews.llvm.org/D29862





More information about the llvm-commits mailing list