@@ -1084,13 +1084,18 @@ namespace IGCMetrics
10841084 auto spillMD = instr.getMetadata (metric->fillInstrKindID );
10851085 if (spillMD != nullptr )
10861086 {
1087- auto func_m = metric->GetFuncMetric (&instr);
1088- auto spillFill_m = func_m->mutable_spillfill_stats ();
1087+ // Some instructions dosen't have visa offset
1088+ // that means the instruction is a dead code
1089+ if (CurrentVISA->HasVisaOffset (&instr))
1090+ {
1091+ auto func_m = metric->GetFuncMetric (&instr);
1092+ auto spillFill_m = func_m->mutable_spillfill_stats ();
10891093
1090- spillFill_m->set_countfillinstr (spillFill_m->countfillinstr () + 1 );
1094+ spillFill_m->set_countfillinstr (spillFill_m->countfillinstr () + 1 );
10911095
1092- // Add spill instruction to metrics
1093- spillFill_m->add_fillinstrvisaid (CurrentVISA->GetVisaOffset (&instr));
1096+ // Add spill instruction to metrics
1097+ spillFill_m->add_fillinstrvisaid (CurrentVISA->GetVisaOffset (&instr));
1098+ }
10941099 }
10951100 }
10961101
@@ -1099,13 +1104,18 @@ namespace IGCMetrics
10991104 auto fillMD = instr.getMetadata (metric->spillInstrKindID );
11001105 if (fillMD != nullptr )
11011106 {
1102- auto func_m = metric->GetFuncMetric (&instr);
1103- auto spillFill_m = func_m->mutable_spillfill_stats ();
1107+ // Some instructions dosen't have visa offset
1108+ // that means the instruction is a dead code
1109+ if (CurrentVISA->HasVisaOffset (&instr))
1110+ {
1111+ auto func_m = metric->GetFuncMetric (&instr);
1112+ auto spillFill_m = func_m->mutable_spillfill_stats ();
11041113
1105- spillFill_m->set_countspillinstr (spillFill_m->countspillinstr () + 1 );
1114+ spillFill_m->set_countspillinstr (spillFill_m->countspillinstr () + 1 );
11061115
1107- // Add spill instruction to metrics
1108- spillFill_m->add_spillinstrvisaid (CurrentVISA->GetVisaOffset (&instr));
1116+ // Add spill instruction to metrics
1117+ spillFill_m->add_spillinstrvisaid (CurrentVISA->GetVisaOffset (&instr));
1118+ }
11091119 }
11101120 }
11111121 };
0 commit comments