diff options
author | Florian Hahn <flo@fhahn.com> | 2025-05-15 19:15:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-15 19:15:48 +0100 |
commit | bb10c3ba7f77d40a7fbfd4ac815015d3a4ae476a (patch) | |
tree | b77b8131e7315932f4986de6fa17358675232cf8 /llvm/lib/Transforms/Scalar/LoopFuse.cpp | |
parent | 1acac5cd38210131c543e4635fcbfd4d597e15f5 (diff) | |
download | llvm-bb10c3ba7f77d40a7fbfd4ac815015d3a4ae476a.zip llvm-bb10c3ba7f77d40a7fbfd4ac815015d3a4ae476a.tar.gz llvm-bb10c3ba7f77d40a7fbfd4ac815015d3a4ae476a.tar.bz2 |
[LoopPeel] Implement initial peeling off the last loop iteration. (#139551)
Generalize countToEliminateCompares to also consider peeling off the
last iteration if it eliminates a compare.
At the moment, codegen for peeling off the last iteration is quite
restrictive and callers have to make sure that the exit condition can be
adjusted when peeling and that the loop executes at least 2 iterations.
Both will be relaxed in follow-ups.
PR: https://github.com/llvm/llvm-project/pull/139551
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopFuse.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopFuse.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopFuse.cpp b/llvm/lib/Transforms/Scalar/LoopFuse.cpp index 5bba301..d6bd92d 100644 --- a/llvm/lib/Transforms/Scalar/LoopFuse.cpp +++ b/llvm/lib/Transforms/Scalar/LoopFuse.cpp @@ -790,7 +790,8 @@ private: << " iterations of the first loop. \n"); ValueToValueMapTy VMap; - FC0.Peeled = peelLoop(FC0.L, PeelCount, &LI, &SE, DT, &AC, true, VMap); + FC0.Peeled = + peelLoop(FC0.L, PeelCount, false, &LI, &SE, DT, &AC, true, VMap); if (FC0.Peeled) { LLVM_DEBUG(dbgs() << "Done Peeling\n"); |