Skip to content

Commit 0046203

Browse files
matborzyszkowskiigcbot
authored andcommitted
Skip dbg calls for vector aliasing heuristic
When we're calculating instructions count in BB, we should skip `dbg` calls, because we cross threshold for ScalarAliasBBSizeThreshold, and we disable scalar aliasing in case with `-g`.
1 parent ad36cbf commit 0046203

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

IGC/Compiler/CISACodeGen/VariableReuseAnalysis.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1732,5 +1732,7 @@ bool VariableReuseAnalysis::checkSubAlign(e_alignment& BaseAlign,
17321732
bool VariableReuseAnalysis::skipScalarAliaser(BasicBlock* BB, Value* ScalarVal) const
17331733
{
17341734
Instruction* I = dyn_cast<Instruction>(ScalarVal);
1735-
return ((BB->size() > m_BBSizeThreshold) || !I || I->getParent() != BB);
1735+
// Don't count dbg instructions in BB
1736+
unsigned InstCountInBB = BB->sizeWithoutDebug();
1737+
return ((InstCountInBB > m_BBSizeThreshold) || !I || I->getParent() != BB);
17361738
}

0 commit comments

Comments
 (0)