[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 25 08:00:21 PDT 2019


Whitney added inline comments.


================
Comment at: llvm/lib/Analysis/LoopInfo.cpp:186
+void Loop::LoopBounds::setInitialIVValue(PHINode &IndVar) {
+  InductionDescriptor IndDesc;
+  assert(InductionDescriptor::isInductionPHI(&IndVar, &L, &SE, IndDesc) &&
----------------
jdoerfert wrote:
> Could you explain this to me please. I see `IndDesc` and `IndVar` but outside the `assert`, the former is not initialized, the latter not used. I'm confused.
IndDesc is initialized using isInductionPHI(), but would be incorrect if assert is off. I will move the call to isInductionPHI() outside of the assert.


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