[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
Thu Apr 11 13:40:47 PDT 2019


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


================
Comment at: llvm/include/llvm/Analysis/LoopInfo.h:620
+
+  /// Return the loop induction variable if found, else return nullptr.
+  /// An instruction is considered as induction variable if
----------------
jdoerfert wrote:
> "The" loop induction variable, or "any" loop induction variable. There could easily be two or more.
In this context, loop induction variable is defined as the the phi node in the loop header which is used in the condition of the conditional branch in the loop latch, so should only be one.


================
Comment at: llvm/include/llvm/Analysis/LoopInfo.h:635
+  bool isAuxiliaryInductionVariable(PHINode &AuxIndVar,
+                                    ScalarEvolution *SE = nullptr) const;
+
----------------
jdoerfert wrote:
> Why is it called auxiliary and what happens if you call it with the only induction variable?
Auxiliary induction variable doesn't require to be used in the loop latch condition.


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