We might want to resolve something to be in a particular register,
so we can access it outside of the gen_mi framework...but it may already
be in that register, at which point there's no work to do.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
case GEN_MI_VALUE_TYPE_REG32:
case GEN_MI_VALUE_TYPE_REG64:
#if GEN_GEN >= 8 || GEN_IS_HASWELL
- gen_mi_builder_emit(b, GENX(MI_LOAD_REGISTER_REG), lrr) {
- lrr.SourceRegisterAddress = src.reg;
- lrr.DestinationRegisterAddress = dst.reg;
+ if (src.reg != dst.reg) {
+ gen_mi_builder_emit(b, GENX(MI_LOAD_REGISTER_REG), lrr) {
+ lrr.SourceRegisterAddress = src.reg;
+ lrr.DestinationRegisterAddress = dst.reg;
+ }
}
#else
unreachable("Cannot do reg <-> reg copy on IVB and earlier");