Skip to content

Commit bf92b12

Browse files
committed
Revert "[LoopPeel] Implement initial peeling off the last loop iteration. (#139551)"
This reverts commit bb10c3b. Also reverts 4f663cc: Revert "[LoopPeel] Make sure PeelLast is always initialized." Revert for now to bring msan bots back to green https://lab.llvm.org/buildbot/#/builders/164/builds/9992 https://lab.llvm.org/buildbot/#/builders/94/builds/7158
1 parent 1c2c02c commit bf92b12

File tree

6 files changed

+156
-427
lines changed

6 files changed

+156
-427
lines changed

llvm/include/llvm/Analysis/TargetTransformInfo.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -680,9 +680,6 @@ class TargetTransformInfo {
680680
/// If the value is true the peeling cost model can decide to peel only
681681
/// some iterations and in this case it will set this to false.
682682
bool PeelProfiledIterations;
683-
684-
/// Peel off the last PeelCount loop iterations.
685-
bool PeelLast;
686683
};
687684

688685
/// Get target-customized preferences for the generic loop peeling

llvm/include/llvm/Transforms/Utils/LoopPeel.h

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,11 @@ namespace llvm {
2121

2222
bool canPeel(const Loop *L);
2323

24-
/// Returns true if the last iteration of \p L can be peeled off. It makes sure
25-
/// the loop exit condition can be adjusted when peeling and that the loop
26-
/// executes at least 2 iterations.
27-
bool canPeelLastIteration(const Loop &L, ScalarEvolution &SE);
28-
2924
/// VMap is the value-map that maps instructions from the original loop to
30-
/// instructions in the last peeled-off iteration. If \p PeelLast is true, peel
31-
/// off the last \p PeelCount iterations from \p L (canPeelLastIteration must be
32-
/// true for \p L), otherwise peel off the first \p PeelCount iterations.
33-
bool peelLoop(Loop *L, unsigned PeelCount, bool PeelLast, LoopInfo *LI,
34-
ScalarEvolution *SE, DominatorTree &DT, AssumptionCache *AC,
35-
bool PreserveLCSSA, ValueToValueMapTy &VMap);
25+
/// instructions in the last peeled-off iteration.
26+
bool peelLoop(Loop *L, unsigned PeelCount, LoopInfo *LI, ScalarEvolution *SE,
27+
DominatorTree &DT, AssumptionCache *AC, bool PreserveLCSSA,
28+
ValueToValueMapTy &VMap);
3629

3730
TargetTransformInfo::PeelingPreferences
3831
gatherPeelingPreferences(Loop *L, ScalarEvolution &SE,

llvm/lib/Transforms/Scalar/LoopFuse.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -790,8 +790,7 @@ struct LoopFuser {
790790
<< " iterations of the first loop. \n");
791791

792792
ValueToValueMapTy VMap;
793-
FC0.Peeled =
794-
peelLoop(FC0.L, PeelCount, false, &LI, &SE, DT, &AC, true, VMap);
793+
FC0.Peeled = peelLoop(FC0.L, PeelCount, &LI, &SE, DT, &AC, true, VMap);
795794
if (FC0.Peeled) {
796795
LLVM_DEBUG(dbgs() << "Done Peeling\n");
797796

llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,8 +1314,7 @@ tryToUnrollLoop(Loop *L, DominatorTree &DT, LoopInfo *LI, ScalarEvolution &SE,
13141314
});
13151315

13161316
ValueToValueMapTy VMap;
1317-
if (peelLoop(L, PP.PeelCount, PP.PeelLast, LI, &SE, DT, &AC, PreserveLCSSA,
1318-
VMap)) {
1317+
if (peelLoop(L, PP.PeelCount, LI, &SE, DT, &AC, PreserveLCSSA, VMap)) {
13191318
simplifyLoopAfterUnroll(L, true, LI, &SE, &DT, &AC, &TTI, nullptr);
13201319
// If the loop was peeled, we already "used up" the profile information
13211320
// we had, so we don't want to unroll or peel again.

0 commit comments

Comments
 (0)