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`.
This commit is contained in:
Mateusz Borzyszkowski
2025-04-09 14:54:17 +00:00
committed by igcbot
parent ad36cbf9eb
commit 004620394e

View File

@ -1732,5 +1732,7 @@ bool VariableReuseAnalysis::checkSubAlign(e_alignment& BaseAlign,
bool VariableReuseAnalysis::skipScalarAliaser(BasicBlock* BB, Value* ScalarVal) const
{
Instruction* I = dyn_cast<Instruction>(ScalarVal);
return ((BB->size() > m_BBSizeThreshold) || !I || I->getParent() != BB);
// Don't count dbg instructions in BB
unsigned InstCountInBB = BB->sizeWithoutDebug();
return ((InstCountInBB > m_BBSizeThreshold) || !I || I->getParent() != BB);
}