Skip to content

Commit bd5abd7

Browse files
agrabezhigcbot
authored andcommitted
Increase UnrollThreshold for 1-BB loops
Set 4 x LoopUnrollThreshold for 1-BB outermost loops in small OCL kernels without Call instructions.
1 parent bb2424f commit bd5abd7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

IGC/Compiler/GenTTI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,14 +546,14 @@ void GenIntrinsicsTTIImpl::getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
546546
return false;
547547
};
548548

549-
// Double LoopUnrollThreshold for 1-BB outermost loops in small OCL kernels
549+
// 4 x LoopUnrollThreshold for 1-BB outermost loops in small OCL kernels
550550
// without Call instructions, since we expect better optimization
551551
// when these loops are fully unrolled.
552552
if (ctx->type == ShaderType::OPENCL_SHADER && !hasCall(L->getHeader()) && L->getHeader()->getParent()->size() < 5) {
553553
if (!L->getParentLoop() && TripCount != 0 && TripCount < 256) {
554554
UP.Count = TripCount;
555555
UP.MaxCount = UP.Count;
556-
UP.Threshold = LoopUnrollThreshold * 2;
556+
UP.Threshold = LoopUnrollThreshold * 4;
557557
UP.Runtime = false;
558558
UP.Partial = false;
559559
UP.Force = true;

0 commit comments

Comments
 (0)