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

Gil Rapaport via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 12 00:13:17 PST 2018


gilr added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopStrengthReduce.cpp:3793
+
+  if (TTI.shouldFavorPostInc()) {
+    if (auto *GAddRec = dyn_cast<SCEVAddRecExpr>(G)) {
----------------
Is this relevant for non-Address kind formulae?


================
Comment at: lib/Transforms/Scalar/LoopStrengthReduce.cpp:3793
+
+  if (TTI.shouldFavorPostInc()) {
+    if (auto *GAddRec = dyn_cast<SCEVAddRecExpr>(G)) {
----------------
gilr wrote:
> Is this relevant for non-Address kind formulae?
Worth a comment here to describe the motivation and how adjusting the offset generates the post-inc opportunity.


================
Comment at: lib/Transforms/Scalar/LoopStrengthReduce.cpp:3795
+    if (auto *GAddRec = dyn_cast<SCEVAddRecExpr>(G)) {
+      if (auto *StepSCEV = GetConstantStart(GAddRec->getStepRecurrence(SE))) {
+        const APInt &StepInt = StepSCEV->getAPInt();
----------------
How does a non-constant step (e.g. 50 + %x) translate to post-inc? Could you add such a test case?


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

https://reviews.llvm.org/D55373





More information about the llvm-commits mailing list