Skip to content

Commit 3623209

Browse files
dmitryryintelsys_zuul
authored andcommitted
clean up: setting GenXKernelBuilder::HasBarrier in one place
Change-Id: I32dff2381141cc63bca0be7a8f689d4179ebae37
1 parent bba8e94 commit 3623209

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

IGC/VectorCompiler/lib/GenXCodeGen/GenXCisaBuilder.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ class GenXKernelBuilder {
517517
std::map<Function *, LoopInfoBase<BasicBlock, Loop> *> Loops;
518518
ValueMap<Function *, bool> IsInLoopCache;
519519

520+
// whether kernel has barrier or sbarrier instruction
520521
bool HasBarrier = false;
521522
bool HasCallable = false;
522523
bool HasStackcalls = false;
@@ -2643,9 +2644,6 @@ bool GenXKernelBuilder::buildMainInst(Instruction *Inst, BaleInfo BI,
26432644
return false; // Omit llvm.genx.constantpred that is EM or RM and so
26442645
// does not have a register allocated.
26452646
// fall through...
2646-
case GenXIntrinsic::genx_barrier:
2647-
case GenXIntrinsic::genx_sbarrier:
2648-
HasBarrier = true;
26492647
default:
26502648
if (!(CI->user_empty() &&
26512649
GenXIntrinsic::getAnyIntrinsicID(CI->getCalledFunction()) ==
@@ -2954,7 +2952,8 @@ void GenXKernelBuilder::collectKernelInfo() {
29542952
continue;
29552953
if (GenXIntrinsicInst *II = dyn_cast<GenXIntrinsicInst>(CI)) {
29562954
auto IID = II->getIntrinsicID();
2957-
if (IID == GenXIntrinsic::genx_barrier)
2955+
if (IID == GenXIntrinsic::genx_barrier ||
2956+
IID == GenXIntrinsic::genx_sbarrier)
29582957
HasBarrier = true;
29592958
else if (IID == GenXIntrinsic::genx_alloca)
29602959
HasAlloca = true;

0 commit comments

Comments
 (0)