[PATCH] D156610: [WIP][LSR] Transform div instruction to add in loop

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 30 23:01:31 PDT 2023


craig.topper added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:2254
+///   if (i == KW) {
+///     ++div;
+///     i = 0;
----------------
Does `div` here replace the original `i`?


================
Comment at: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:2288
+    // TODO, support negative and non-one positive step
+    const SCEV *One = SE.getConstant(BackedgeTakenCount->getType(), 1);
+    if (AR->getStepRecurrence(SE) != One)
----------------
Do we need to create new SCEV expression to compare? Can we ask if the StepRecurrence is a SCEVConstant and get it's value?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156610



More information about the llvm-commits mailing list