i965: check inst->predicate when clearing flag_live at dead code eliminate
authorAlejandro Piñeiro <apinheiro@igalia.com>
Thu, 22 Oct 2015 20:22:14 +0000 (22:22 +0200)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Wed, 4 Nov 2015 18:33:56 +0000 (19:33 +0100)
Detected by Matt Turner while reviewing commit
a59359ecd22154cc2b3f88bb8c599f21af8a3934

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp
src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp

index 4b5548a9dc561403c54131e0cdc5678eaaeb6ace..1eaf1478877e8ea40ff34e4664ee4723c2edc734 100644 (file)
@@ -105,7 +105,7 @@ fs_visitor::dead_code_eliminate()
             }
          }
 
-         if (inst->writes_flag()) {
+         if (inst->writes_flag() && !inst->predicate) {
             BITSET_CLEAR(flag_live, inst->flag_subreg);
          }
 
index 284e0a8d0a5b569187eeb2919f144fae27d9b118..e8a51d6e0661fae6986e906f420f23cddf8f3e50 100644 (file)
@@ -145,7 +145,7 @@ vec4_visitor::dead_code_eliminate()
             }
          }
 
-         if (inst->writes_flag()) {
+         if (inst->writes_flag() && !inst->predicate) {
             for (unsigned c = 0; c < 4; c++)
                BITSET_CLEAR(flag_live, c);
          }