[llvm] [LoopPeel] Remove known trip count restriction when peeling last. (PR #140792)
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Tue May 20 13:54:44 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))
----------------
efriedma-quic wrote:
Should we be checking isHighCostExpansion() or something like that somewhere?
https://github.com/llvm/llvm-project/pull/140792
More information about the llvm-commits
mailing list