intel/compiler: Do not reswizzle dst if instruction writes to flag register
authorDanylo Piliaiev <danylo.piliaiev@globallogic.com>
Mon, 25 Mar 2019 12:15:27 +0000 (14:15 +0200)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 16 Apr 2019 09:42:08 +0000 (09:42 +0000)
If we write to the flag register changing the swizzle would change
what channels are written to the flag register.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110201
Fixes: 4cd1a0be
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: <ian.d.romanick@intel.com>
src/intel/compiler/brw_vec4.cpp

index bb8b554c852221d94be37a1d8d930071aebe52a3..7d60665b6211b758d5e033973d01435fb1e97323 100644 (file)
@@ -1154,6 +1154,12 @@ vec4_instruction::can_reswizzle(const struct gen_device_info *devinfo,
    if (devinfo->gen == 6 && is_math() && swizzle != BRW_SWIZZLE_XYZW)
       return false;
 
+   /* If we write to the flag register changing the swizzle would change
+    * what channels are written to the flag register.
+    */
+   if (writes_flag())
+      return false;
+
    /* We can't swizzle implicit accumulator access.  We'd have to
     * reswizzle the producer of the accumulator value in addition
     * to the consumer (i.e. both MUL and MACH).  Just skip this.