[PATCH] D60565: [LOOPINFO] Extend Loop object to add utilities to get the loop bounds, step, induction variable, and guard branch.

Whitney via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 16 07:25:06 PDT 2019


Whitney marked 3 inline comments as done.
Whitney added inline comments.


================
Comment at: llvm/lib/Analysis/LoopInfo.cpp:669
+
+  Instruction *StepInst =
+      dyn_cast<Instruction>(AuxIndVar.getIncomingValueForBlock(Latch));
----------------
fhahn wrote:
> Wouldn't it be enough to just check if it is an SCEVAddRecEpxr?
I tried to change to check if the StepInst is an SCEVAddRecExpr, but it failed one of the new unittest AuxiliaryIV, %loopvariantinc is incrementing by %i which is loop variant, so isAuxiliaryInductionVariable() should return false, but it is an SCEVAddRecExpr.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D60565





More information about the llvm-commits mailing list