@@ -520,7 +520,7 @@ void GenIntrinsicsTTIImpl::getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
520
520
(instCount + sendMessage * 4 > unrollLimitInstCount);
521
521
522
522
// if the loop doesn't have sample, skip the unrolling parameter change
523
- if (!sendMessage && !AllocaFound ) {
523
+ if (!sendMessage) {
524
524
// if the estimated unrolled instruction count is larger than the unrolling threshold, limit unrolling.
525
525
if (limitUnrolling) {
526
526
UP.Count = MIN (unrollLimitInstCount / (instCount + sendMessage * 4 ), 4 );
@@ -534,7 +534,7 @@ void GenIntrinsicsTTIImpl::getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
534
534
535
535
// if the TripCount is known, and the estimated unrolled count exceed LoopUnrollThreshold, set the unrolling count to
536
536
// 4
537
- if (limitUnrolling && !AllocaFound ) {
537
+ if (limitUnrolling) {
538
538
UP.Count = MIN (TripCount, 4 );
539
539
UP.MaxCount = UP.Count ;
540
540
}
@@ -550,13 +550,13 @@ void GenIntrinsicsTTIImpl::getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
550
550
}
551
551
}
552
552
553
- /* ** TESTING for removal
554
- UP.Runtime = true;
555
- UP.Count = 4;
556
- UP.MaxCount = UP.Count;
557
- // The following is only available and required from LLVM 3.7+.
558
- UP.AllowExpensiveTripCount = true;
559
- ** */
553
+ if (!limitUnrolling) {
554
+ UP.Runtime = true ;
555
+ UP.Count = 4 ;
556
+ UP.MaxCount = UP.Count ;
557
+ // The following is only available and required from LLVM 3.7+.
558
+ UP.AllowExpensiveTripCount = true ;
559
+ }
560
560
561
561
if (MDNode *LoopID = L->getLoopID ()) {
562
562
const llvm::StringRef maxIterMetadataNames = " spv.loop.iterations.max" ;
0 commit comments