[PATCH] D103939: [SVE][LSR] Teach LSR to enable simple scaled-index addressing mode generation for SVE.

Huihui Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 10 16:38:25 PDT 2021


huihuiz added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:737
+      // Handle special case C1*X*Y /s C2*X*Y.
+      if (const SCEVMulExpr *MulRHS = dyn_cast<SCEVMulExpr>(RHS)) {
+        const SCEVConstant *LC = dyn_cast<SCEVConstant>(Mul->getOperand(0));
----------------
sdesmalen wrote:
> Does the MulRHS also need checks for `IgnoreSignificantBits || isMulSExtable(MulRHS, SE)` ?
I didn't include this because I was thinking, even with "IgnoreSignificantBits" equal to false and MulRHS a negative value, we can still extract the factor.
For instance, (16*X) /s (-8*X), -2 can be extracted.

But this seems to violate the intention of setting IgnoreSignificnatBits to false.

Therefore, I am restricting the checking to MulRHS as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103939



More information about the llvm-commits mailing list