Skip to content

Commit 330acbf

Browse files
Gang Y Chenigcbot
authored andcommitted
Another tweek to reduce time on LiveVar update
1 parent 3393606 commit 330acbf

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

IGC/Compiler/CISACodeGen/LiveVars.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,15 @@ void LiveVars::MarkVirtRegAliveInBlock(LiveVars::LVInfo& VRInfo,
270270
continue; // We already know the block is live
271271

272272
WorkList.push_back(PredBlk);
273-
Instruction* cbr = PredBlk->getTerminator();
274-
if (cbr && WIA->whichDepend(cbr) != WIAnalysis::UNIFORM)
275-
hasNonUniformBranch = true;
273+
// Check if we need to update liveness for uniform variable
274+
// inside divergent control-flow
276275
if (PredBlk == MBB->getPrevNode())
277276
hasLayoutPred = false;
277+
if (hasLayoutPred && VRInfo.uniform) {
278+
Instruction* cbr = PredBlk->getTerminator();
279+
if (cbr && WIA->whichDepend(cbr) != WIAnalysis::UNIFORM)
280+
hasNonUniformBranch = true;
281+
}
278282
}
279283
if (hasLayoutPred && hasNonUniformBranch && VRInfo.uniform) {
280284
BasicBlock* simdPred = MBB->getPrevNode();

0 commit comments

Comments
 (0)