Skip to content

Commit 173eb2a

Browse files
jhananitsys_zuul
authored and
sys_zuul
committed
FindInterestingConstant pass can now detect subloops in constant buffer
trace path for weight calculation. Change-Id: I56b18046ba5c630270a78ac17977d17fbc14cbf1
1 parent fdda08a commit 173eb2a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

IGC/Compiler/FindInterestingConstants.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,20 @@ unsigned int FindInterestingConstants::BranchSize(llvm::Instruction* I, llvm::Br
399399
isLoop = true;
400400
return size;
401401
}
402+
for (Loop* subLoop : L->getSubLoops())
403+
{
404+
body = subLoop->getLoopLatch();
405+
br = cast<BranchInst>(body->getTerminator());
406+
if (br == dyn_cast<BranchInst>(Br))
407+
{
408+
for (BasicBlock* BB : subLoop->getBlocks())
409+
{
410+
size += BB->size();
411+
}
412+
isLoop = true;
413+
return size;
414+
}
415+
}
402416
}
403417
for (auto& U : Br->operands())
404418
{

0 commit comments

Comments
 (0)