for (unsigned int i = 0; i < 3; i++) {
if (inst->src[i].file == GRF) {
spill_costs[inst->src[i].reg] += loop_scale;
+
+ /* Register spilling logic assumes full-width registers; smeared
+ * registers have a width of 1 so if we try to spill them we'll
+ * generate invalid assembly. This shouldn't be a problem because
+ * smeared registers are only used as short-term temporaries when
+ * loading pull constants, so spilling them is unlikely to reduce
+ * register pressure anyhow.
+ */
+ if (inst->src[i].smear >= 0) {
+ no_spill[inst->src[i].reg] = true;
+ }
}
}
if (inst->dst.file == GRF) {
spill_costs[inst->dst.reg] += inst->regs_written() * loop_scale;
+
+ if (inst->dst.smear >= 0) {
+ no_spill[inst->dst.reg] = true;
+ }
}
switch (inst->opcode) {