if (!src || src->file != GRF)
return false;
- return (src->reg == inst->dst.reg &&
- src->reg_offset == inst->dst.reg_offset &&
- inst->dst.writemask & (1 << BRW_GET_SWZ(src->swizzle, ch)));
+ return (src->in_range(inst->dst, inst->regs_written) &&
+ inst->dst.writemask & (1 << BRW_GET_SWZ(src->swizzle, ch)));
}
static unsigned
inst->src[i].reladdr)
continue;
+ /* We only handle single-register copies. */
+ if (inst->regs_read(i) != 1)
+ continue;
+
int reg = (alloc.offsets[inst->src[i].reg] +
inst->src[i].reg_offset);