i965: Don't try copy propagation if constant propagation succeeded.
authorFrancisco Jerez <currojerez@riseup.net>
Sat, 27 Feb 2016 01:28:03 +0000 (17:28 -0800)
committerFrancisco Jerez <currojerez@riseup.net>
Sun, 6 Mar 2016 20:22:40 +0000 (12:22 -0800)
It cannot get any better.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp

index 9dbe13df51487de080a6d3da89dfa00fd20a8c4f..2616e65fc625a4e76bff6d9731c7271c8a507661 100644 (file)
@@ -737,8 +737,7 @@ fs_visitor::opt_copy_propagate_local(void *copy_prop_ctx, bblock_t *block,
          foreach_in_list(acp_entry, entry, &acp[inst->src[i].nr % ACP_HASH_SIZE]) {
             if (try_constant_propagate(inst, entry))
                progress = true;
-
-            if (try_copy_propagate(inst, i, entry))
+            else if (try_copy_propagate(inst, i, entry))
                progress = true;
          }
       }
index 5c2516473a531f7e6b3d96d8e14c5c14d4610020..1da49fbc82aa8fe10c94c96c88dff1d0da826545 100644 (file)
@@ -453,8 +453,7 @@ vec4_visitor::opt_copy_propagation(bool do_constant_prop)
 
          if (do_constant_prop && try_constant_propagate(devinfo, inst, i, &entry))
             progress = true;
-
-         if (try_copy_propagate(devinfo, inst, i, &entry, attributes_per_reg))
+         else if (try_copy_propagate(devinfo, inst, i, &entry, attributes_per_reg))
            progress = true;
       }