@@ -1084,13 +1084,18 @@ namespace IGCMetrics
1084
1084
auto spillMD = instr.getMetadata (metric->fillInstrKindID );
1085
1085
if (spillMD != nullptr )
1086
1086
{
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 ();
1089
1093
1090
- spillFill_m->set_countfillinstr (spillFill_m->countfillinstr () + 1 );
1094
+ spillFill_m->set_countfillinstr (spillFill_m->countfillinstr () + 1 );
1091
1095
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
+ }
1094
1099
}
1095
1100
}
1096
1101
@@ -1099,13 +1104,18 @@ namespace IGCMetrics
1099
1104
auto fillMD = instr.getMetadata (metric->spillInstrKindID );
1100
1105
if (fillMD != nullptr )
1101
1106
{
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 ();
1104
1113
1105
- spillFill_m->set_countspillinstr (spillFill_m->countspillinstr () + 1 );
1114
+ spillFill_m->set_countspillinstr (spillFill_m->countspillinstr () + 1 );
1106
1115
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
+ }
1109
1119
}
1110
1120
}
1111
1121
};
0 commit comments