[PATCH] D111896: [indvars] Canonicalize exit conditions to unsigned using range info

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 18 04:20:42 PDT 2021


mkazantsev added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1428
+  auto *BI = dyn_cast<BranchInst>(ExitingBB->getTerminator());
+  if (!BI || BI->isUnconditional())
+    return false;
----------------
Loop exiting branch cannot be unconditional.


================
Comment at: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1445
+  case Instruction::ZExt:
+    switch (ICmp->getPredicate()) {
+    default:
----------------
isRelational && isSigned ?


================
Comment at: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1857
+    // thus we need to notify top most loop.
+    SE->forgetTopmostLoop(L);
+  }
----------------
Do we really need this? We don't fold any blocks here, just replacing signed predicate with unsigned. How can this be a problem for caches?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111896



More information about the llvm-commits mailing list