Skip to content

Commit 22dc83a

Browse files
lioujheyupszymich
authored andcommitted
Diable PromoteLoopUnrollWithAlloc for OCL
Diable PromoteLoopUnrollWithAlloc for OCL (cherry picked from commit bab52a9)
1 parent 5fff125 commit 22dc83a

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
@@ -359,15 +359,17 @@ void GenIntrinsicsTTIImpl::getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
359359
if (AllocaFound) {
360360
// LLVM default only to 10, boost to UnrollMaxCountForAlloca
361361
UP.MaxIterationsCountToAnalyze = UnrollMaxCountForAlloca;
362-
UP.Threshold += ThresholdBoost;
363362
UP.UpperBound = true;
364363
UP.Force = UnrollLoopForCodeSizeOnly ? false : true;
365364

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

0 commit comments

Comments
 (0)