Skip to content

Commit bab52a9

Browse files
lioujheyuigcbot
authored andcommitted
Diable PromoteLoopUnrollWithAlloc for OCL
Diable PromoteLoopUnrollWithAlloc for OCL
1 parent cc8a7b7 commit bab52a9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

IGC/Compiler/GenTTI.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -360,15 +360,17 @@ void GenIntrinsicsTTIImpl::getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
360360
if (AllocaFound) {
361361
// LLVM default only to 10, boost to UnrollMaxCountForAlloca
362362
UP.MaxIterationsCountToAnalyze = UnrollMaxCountForAlloca;
363-
UP.Threshold += ThresholdBoost;
364363
UP.UpperBound = true;
365364
UP.Force = UnrollLoopForCodeSizeOnly ? false : true;
366365

367-
LLVM_DEBUG(dbgs() << "Increasing L:" << L->getName() << " threshold to " << UP.Threshold
368-
<< " due to Alloca accessed by:");
369-
for (const auto &pair : isGEPLoopInduction)
370-
LLVM_DEBUG(dbgs() << " " << pair.first->getName());
371-
LLVM_DEBUG(dbgs() << " \n");
366+
if (ctx->type != ShaderType::OPENCL_SHADER) {
367+
UP.Threshold += ThresholdBoost;
368+
LLVM_DEBUG(dbgs() << "Increasing L:" << L->getName() << " threshold to " << UP.Threshold
369+
<< " due to Alloca accessed by:");
370+
for (const auto &pair : isGEPLoopInduction)
371+
LLVM_DEBUG(dbgs() << " " << pair.first->getName());
372+
LLVM_DEBUG(dbgs() << " \n");
373+
}
372374
}
373375
}
374376

0 commit comments

Comments
 (0)