[Mesa-dev] [PATCH 68/95] i965/vec4: Prevent copy propagation from violating pre-gen8 restrictions
Iago Toral Quiroga
itoral at igalia.com
Tue Jul 19 10:41:05 UTC 2016
In gen < 8 instructions that write more than one register need to read
more than one register too. Make sure we don't break that restriction
by copy propagating from a uniform.
src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
index 6f52eec..d284528 100644
@@ -322,6 +322,13 @@ try_copy_propagate(const struct brw_device_info *devinfo,
value.file != ATTR)
+ /* In gen < 8 instructions that write 2 registers also need to read 2
+ * registers. Make sure we don't break that restriction by copy
+ * propagating from a uniform.
+ if (devinfo->gen < 8 && inst->regs_written > 1 && is_uniform(value))
+ return false;
/* If the type of the copy value is different from the type of the
* instruction then the swizzles and writemasks involved don't have the same
* meaning and simply replacing the source would produce different semantics.
More information about the mesa-dev