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

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 26 22:16:13 PDT 2019


jdoerfert added a comment.

I'll put a thorough review on my list for (early) next week.



================
Comment at: llvm/lib/Analysis/LoopInfo.cpp:186
+void Loop::LoopBounds::setInitialIVValue(PHINode &IndVar) {
+  InductionDescriptor IndDesc;
+  assert(InductionDescriptor::isInductionPHI(&IndVar, &L, &SE, IndDesc) &&
----------------
Whitney wrote:
> 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.
Ok. Now that makes more sense to me. Thanks.


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