Skip to content

Commit 9695142

Browse files
itsimbalsys_zuul
authored andcommitted
The reason of the assert is that debug intrinsic llvm.dbg.value is
located in a block, which does not dominate its argument. Something like this: B1: call llvm.dbg.value(metadata var, ...) .... B2: definition of var and B1 doesn't dominate B2. This happens in Codesinking pass. It moved the definition of var closer to it's usage but left debug intrinsic intact as debug intrinsics are not included in a list of users of var definition. There is a special code to handle debug intrinsics but unfortunately this code was not triggered in this specific case. Check for such intrinsics in a block and trigger the code to process the intrinsics. Change-Id: I410d41ffdfd79f1f4803e5f922943bdad13f22ad
1 parent 931b875 commit 9695142

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

IGC/Compiler/CISACodeGen/CodeSinking.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ namespace IGC {
368368
BasicBlock::iterator I = blk.end();
369369
--I;
370370
bool processedBegin = false;
371+
bool metDbgValueIntrinsic = false;
371372
SmallPtrSet<Instruction*, 16> stores;
372373
undoLocas.clear();
373374
movedInsts.clear();
@@ -389,6 +390,10 @@ namespace IGC {
389390
else if (isa<DbgInfoIntrinsic>(inst) || inst->isTerminator() ||
390391
isa<PHINode>(inst) || inst->use_empty())
391392
{
393+
if (isa<DbgValueInst>(inst))
394+
{
395+
metDbgValueIntrinsic = true;
396+
}
392397
prevLoca = inst;
393398
}
394399
else {
@@ -431,7 +436,7 @@ namespace IGC {
431436
}
432437
}
433438
}
434-
if (madeChange) {
439+
if (madeChange || metDbgValueIntrinsic) {
435440
ProcessDbgValueInst(blk);
436441
}
437442

0 commit comments

Comments
 (0)