[PATCH] D55373: [LSR] Generate formulae to enable more post-incs

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 19 01:27:56 PST 2018


samparker marked an inline comment as done.
samparker added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopStrengthReduce.cpp:1258
+        if (isa<SCEVConstant>(AR->getOperand(1))) {
+          if (auto *Start = GetConstantStart(AR)) {
+            const APInt &StartInt = Start->getAPInt();
----------------
gilr wrote:
> - The existing `{LI, +, C}` pattern seems to already match this case (i.e. `{(-C + %a + ...), +, C}`) and the more general case `{(Offset - C2) + %a + ...), +, C2}`, where Offset =/= 0. So IIUC matching this pattern here is only needed if the new TTI flag is set but the existing one is reset, right?
> - Won't this also match something like `{3, +, 5, +, %x}`?
> 
I'm going to need to replace this with something that compares the step with the base offset, aiming to have the post increment happen on the last, not the first, access. I need to make a few other changes to support this though as well.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55373/new/

https://reviews.llvm.org/D55373





More information about the llvm-commits mailing list