summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIago Toral Quiroga <itoral@igalia.com>2016-06-16 13:41:48 +0200
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>2017-01-03 11:26:51 +0100
commit70cc6b0a022c1bfd8d17d5e931b276cb2ef2a456 (patch)
treec092e97f907d80779cbfe811aeb5e82f6dbe343a
parent0fec5e9867fe46c543509f6555d31b8ada835f8e (diff)
i965/vec4: prevent copy-propagation from values with a different type size
Because the meaning of the swizzles and writemasks involved is different, so replacing the source would lead to different semantics. Reviewed-by: Matt Turner <mattst88@gmail.com>
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp7
1 files changed, 7 insertions, 0 deletions
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 55413abbc6e..4ef34f25dfc 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
@@ -324,6 +324,13 @@ try_copy_propagate(const struct gen_device_info *devinfo,
value.file != ATTR)
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.
+ */
+ if (type_sz(value.type) != type_sz(inst->src[arg].type))
+ return false;
+
if (devinfo->gen >= 8 && (value.negate || value.abs) &&
is_logic_op(inst->opcode)) {
return false;