[llvm] [LoopPeel] Remove known trip count restriction when peeling last. (PR #140792)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed May 21 14:58:37 PDT 2025


================
@@ -332,11 +333,7 @@ bool llvm::canPeelLastIteration(const Loop &L, ScalarEvolution &SE) {
   CmpPredicate Pred;
   BasicBlock *Succ1;
   BasicBlock *Succ2;
-  // The loop must execute at least 2 iterations to guarantee that peeled
-  // iteration executes.
-  // TODO: Add checks during codegen.
-  if (isa<SCEVCouldNotCompute>(BTC) ||
-      !SE.isKnownPredicate(CmpInst::ICMP_UGT, BTC, SE.getZero(BTC->getType())))
+  if (isa<SCEVCouldNotCompute>(BTC))
----------------
fhahn wrote:

Yep, updated thanks!

https://github.com/llvm/llvm-project/pull/140792


More information about the llvm-commits mailing list