Skip to content

Commit 79fe06a

Browse files
committed
Revert "[LoopUnroll] Make use of MaxTripCount for loops with "#pragma unroll" (llvm#74703)"
This reverts commit 1d6a678. Change-Id: Ie10f8f68b4e3ad47339c853b576e16dc868cd395
1 parent 1b2985c commit 79fe06a

File tree

2 files changed

+2
-942
lines changed

2 files changed

+2
-942
lines changed

llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ static unsigned getFullUnrollBoostingFactor(const EstimatedUnrollCost &Cost,
770770
static std::optional<unsigned>
771771
shouldPragmaUnroll(Loop *L, const PragmaInfo &PInfo,
772772
const unsigned TripMultiple, const unsigned TripCount,
773-
unsigned MaxTripCount, const UnrollCostEstimator UCE,
773+
const UnrollCostEstimator UCE,
774774
const TargetTransformInfo::UnrollingPreferences &UP) {
775775

776776
// Using unroll pragma
@@ -800,10 +800,6 @@ shouldPragmaUnroll(Loop *L, const PragmaInfo &PInfo,
800800
return TripCount;
801801
}
802802

803-
if (PInfo.PragmaEnableUnroll && !TripCount && MaxTripCount &&
804-
MaxTripCount <= UP.MaxUpperBound)
805-
return MaxTripCount;
806-
807803
// if didn't return until here, should continue to other priorties
808804
return std::nullopt;
809805
}
@@ -930,7 +926,7 @@ bool llvm::computeUnrollCount(
930926
// 1st priority is unroll count set by "unroll-count" option.
931927
// 2nd priority is unroll count set by pragma.
932928
if (auto UnrollFactor = shouldPragmaUnroll(L, PInfo, TripMultiple, TripCount,
933-
MaxTripCount, UCE, UP)) {
929+
UCE, UP)) {
934930
UP.Count = *UnrollFactor;
935931

936932
if (UserUnrollCount || (PragmaCount > 0)) {

0 commit comments

Comments
 (0)