@@ -764,8 +764,8 @@ class UnrollCostEstimator {
764
764
bool llvm::computeUnrollCount (
765
765
Loop *L, const TargetTransformInfo &TTI, DominatorTree &DT, LoopInfo *LI,
766
766
ScalarEvolution &SE, const SmallPtrSetImpl<const Value *> &EphValues,
767
- OptimizationRemarkEmitter *ORE, unsigned & TripCount, unsigned MaxTripCount,
768
- bool MaxOrZero, unsigned & TripMultiple, unsigned LoopSize,
767
+ OptimizationRemarkEmitter *ORE, unsigned TripCount, unsigned MaxTripCount,
768
+ bool MaxOrZero, unsigned TripMultiple, unsigned LoopSize,
769
769
TargetTransformInfo::UnrollingPreferences &UP,
770
770
TargetTransformInfo::PeelingPreferences &PP, bool &UseUpperBound) {
771
771
@@ -829,8 +829,6 @@ bool llvm::computeUnrollCount(
829
829
// Full unroll makes sense only when TripCount or its upper bound could be
830
830
// statically calculated.
831
831
// Also we need to check if we exceed FullUnrollMaxCount.
832
- // If using the upper bound to unroll, TripMultiple should be set to 1 because
833
- // we do not know when loop may exit.
834
832
835
833
// We can unroll by the upper bound amount if it's generally allowed or if
836
834
// we know that the loop is executed either the upper bound or zero times.
@@ -859,8 +857,6 @@ bool llvm::computeUnrollCount(
859
857
// like the rest of the loop body.
860
858
if (UCE.getUnrolledLoopSize (UP) < UP.Threshold ) {
861
859
UseUpperBound = (FullUnrollMaxTripCount == FullUnrollTripCount);
862
- TripCount = FullUnrollTripCount;
863
- TripMultiple = UP.UpperBound ? 1 : TripMultiple;
864
860
return ExplicitUnroll;
865
861
} else {
866
862
// The loop isn't that small, but we still can fully unroll it if that
@@ -874,8 +870,6 @@ bool llvm::computeUnrollCount(
874
870
getFullUnrollBoostingFactor (*Cost, UP.MaxPercentThresholdBoost );
875
871
if (Cost->UnrolledCost < UP.Threshold * Boost / 100 ) {
876
872
UseUpperBound = (FullUnrollMaxTripCount == FullUnrollTripCount);
877
- TripCount = FullUnrollTripCount;
878
- TripMultiple = UP.UpperBound ? 1 : TripMultiple;
879
873
return ExplicitUnroll;
880
874
}
881
875
}
@@ -1177,9 +1171,6 @@ static LoopUnrollResult tryToUnrollLoop(
1177
1171
TripMultiple, LoopSize, UP, PP, UseUpperBound);
1178
1172
if (!UP.Count )
1179
1173
return LoopUnrollResult::Unmodified;
1180
- // Unroll factor (Count) must be less or equal to TripCount.
1181
- if (TripCount && UP.Count > TripCount)
1182
- UP.Count = TripCount;
1183
1174
1184
1175
if (PP.PeelCount ) {
1185
1176
assert (UP.Count == 1 && " Cannot perform peel and unroll in the same step" );
0 commit comments