Skip to content

Commit dc9c960

Browse files
mtargowsigcbot
authored andcommitted
Debug info of spilled variables fixed
1 parent a4a6872 commit dc9c960

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

IGC/DebugInfo/DwarfCompileUnit.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,8 +1194,24 @@ void CompileUnit::addSimdLane(IGC::DIEBlock* Block, DbgVariable& DV, VISAVariabl
11941194

11951195
EmitPushSimdLane(Block, isSecondHalf);
11961196
// *8 if 64-bit ptr or *4 if 32-bit ptr.
1197-
dwarf::LocationAtom litOP = (varSizeInBits == 64) ? dwarf::DW_OP_lit3 : dwarf::DW_OP_lit2;
1198-
IGC_ASSERT_MESSAGE((varSizeInBits == 32) || (varSizeInBits == 64), "Unexpected ptr size");
1197+
dwarf::LocationAtom litOP = dwarf::DW_OP_lit3; // Assumed for varSizeInBits == 64
1198+
1199+
if (varSizeInBits == 32)
1200+
{
1201+
litOP = dwarf::DW_OP_lit2;
1202+
}
1203+
else if (varSizeInBits == 16)
1204+
{
1205+
litOP = dwarf::DW_OP_lit1;
1206+
}
1207+
else if (varSizeInBits == 8)
1208+
{
1209+
litOP = dwarf::DW_OP_lit0;
1210+
}
1211+
else
1212+
{
1213+
IGC_ASSERT_MESSAGE((varSizeInBits == 64), "Unexpected spilled ptr or variable size");
1214+
}
11991215

12001216
addUInt(Block, dwarf::DW_FORM_data1, litOP);
12011217
addUInt(Block, dwarf::DW_FORM_data1, dwarf::DW_OP_shl);

0 commit comments

Comments
 (0)