i965/fs: Remove opt_drop_redundant_mov_to_flags().
authorMatt Turner <mattst88@gmail.com>
Mon, 3 Nov 2014 19:24:03 +0000 (11:24 -0800)
committerMatt Turner <mattst88@gmail.com>
Tue, 2 Dec 2014 00:42:13 +0000 (16:42 -0800)
Dead code elimination now handles this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h

index 37015ec607b39b09a246f524e761b9dac939c512..5ed42339ad86b17022bc99e6dc8af97e9b0d433c 100644 (file)
@@ -3419,35 +3419,6 @@ fs_visitor::calculate_register_pressure()
    }
 }
 
-/**
- * Look for repeated FS_OPCODE_MOV_DISPATCH_TO_FLAGS and drop the later ones.
- *
- * The needs_unlit_centroid_workaround ends up producing one of these per
- * channel of centroid input, so it's good to clean them up.
- *
- * An assumption here is that nothing ever modifies the dispatched pixels
- * value that FS_OPCODE_MOV_DISPATCH_TO_FLAGS reads from, but the hardware
- * dictates that anyway.
- */
-void
-fs_visitor::opt_drop_redundant_mov_to_flags()
-{
-   bool flag_mov_found[2] = {false};
-
-   foreach_block_and_inst_safe(block, fs_inst, inst, cfg) {
-      if (inst->is_control_flow()) {
-         memset(flag_mov_found, 0, sizeof(flag_mov_found));
-      } else if (inst->opcode == FS_OPCODE_MOV_DISPATCH_TO_FLAGS) {
-         if (!flag_mov_found[inst->flag_subreg])
-            flag_mov_found[inst->flag_subreg] = true;
-         else
-            inst->remove(block);
-      } else if (inst->writes_flag()) {
-         flag_mov_found[inst->flag_subreg] = false;
-      }
-   }
-}
-
 void
 fs_visitor::optimize()
 {
@@ -3459,8 +3430,6 @@ fs_visitor::optimize()
    assign_constant_locations();
    demote_pull_constants();
 
-   opt_drop_redundant_mov_to_flags();
-
 #define OPT(pass, args...) do {                                         \
       pass_num++;                                                       \
       bool this_progress = pass(args);                                  \
index 1deb7743cea9cb9490692fa01a5f136f4c5c313a..2e6296d4f23fabf35231401d33dfa58355c2abb7 100644 (file)
@@ -422,7 +422,6 @@ public:
    bool try_constant_propagate(fs_inst *inst, acp_entry *entry);
    bool opt_copy_propagate_local(void *mem_ctx, bblock_t *block,
                                  exec_list *acp);
-   void opt_drop_redundant_mov_to_flags();
    bool opt_register_renaming();
    bool register_coalesce();
    bool compute_to_mrf();