Skip to content

Commit bdfac03

Browse files
author
David Salinas
committed
Revert "[LoopUnroll] Make use of MaxTripCount for loops with "#pragma unroll" (llvm#74703)"
This reverts commit 1d6a678. Change-Id: Ied8f01a15f9af8579e711ff01ab8c3c8a8e4976f
1 parent 9087c66 commit bdfac03

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
@@ -758,7 +758,7 @@ static unsigned getFullUnrollBoostingFactor(const EstimatedUnrollCost &Cost,
758758
static std::optional<unsigned>
759759
shouldPragmaUnroll(Loop *L, const PragmaInfo &PInfo,
760760
const unsigned TripMultiple, const unsigned TripCount,
761-
unsigned MaxTripCount, const UnrollCostEstimator UCE,
761+
const UnrollCostEstimator UCE,
762762
const TargetTransformInfo::UnrollingPreferences &UP) {
763763

764764
// Using unroll pragma
@@ -779,10 +779,6 @@ shouldPragmaUnroll(Loop *L, const PragmaInfo &PInfo,
779779
if (PInfo.PragmaFullUnroll && TripCount != 0)
780780
return TripCount;
781781

782-
if (PInfo.PragmaEnableUnroll && !TripCount && MaxTripCount &&
783-
MaxTripCount <= UP.MaxUpperBound)
784-
return MaxTripCount;
785-
786782
// if didn't return until here, should continue to other priorties
787783
return std::nullopt;
788784
}
@@ -909,7 +905,7 @@ bool llvm::computeUnrollCount(
909905
// 1st priority is unroll count set by "unroll-count" option.
910906
// 2nd priority is unroll count set by pragma.
911907
if (auto UnrollFactor = shouldPragmaUnroll(L, PInfo, TripMultiple, TripCount,
912-
MaxTripCount, UCE, UP)) {
908+
UCE, UP)) {
913909
UP.Count = *UnrollFactor;
914910

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

0 commit comments

Comments
 (0)