Skip to content

Commit e5a0a26

Browse files
committed
Update for merge from pgo-estimated-trip-count
That's PR #128785, which is now a parent PR. First, remove a todo that's now documented more generally than LoopPeel in plenty of other places. Second, update LoopPeel's setLoopEstimatedTripCount call to avoid a now redundant argument that eventually won't be supported.
1 parent 3f6a91a commit e5a0a26

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

llvm/lib/Transforms/Utils/LoopPeel.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,15 +1221,6 @@ bool llvm::peelLoop(Loop *L, unsigned PeelCount, bool PeelLast, LoopInfo *LI,
12211221
// analysis later needs to determine the trip count of the remaining loop
12221222
// while examining it in isolation without considering the probability of
12231223
// actually reaching it, we store the new trip count as separate metadata.
1224-
//
1225-
// TODO: getLoopEstimatedTripCount and setLoopEstimatedTripCount skip loops
1226-
// that don't match the restrictions of getExpectedExitLoopLatchBranch in
1227-
// LoopUtils.cpp. For example,
1228-
// llvm/tests/Transforms/LoopUnroll/peel-branch-weights.ll (introduced by
1229-
// b43a4d0850d5) has multiple exits. Should we try to extend them to handle
1230-
// such cases? For now, we just don't try to record
1231-
// llvm.loop.estimated_trip_count for such cases, so the original branch
1232-
// weights will have to do.
12331224
if (auto EstimatedTripCount = getLoopEstimatedTripCount(L)) {
12341225
// FIXME: The previous updateBranchWeights implementation had this
12351226
// comment:
@@ -1250,8 +1241,7 @@ bool llvm::peelLoop(Loop *L, unsigned PeelCount, bool PeelLast, LoopInfo *LI,
12501241
EstimatedTripCountNew = 0; // FIXME: = 2?
12511242
else
12521243
EstimatedTripCountNew -= TotalPeeled;
1253-
setLoopEstimatedTripCount(L, EstimatedTripCountNew,
1254-
/*EstimatedLoopInvocationWeight=*/std::nullopt);
1244+
setLoopEstimatedTripCount(L, EstimatedTripCountNew);
12551245
}
12561246

12571247
if (Loop *ParentLoop = L->getParentLoop())

0 commit comments

Comments
 (0)