After CSEing some MOV ..., VF instructions we have code like
mov tmp, [1F, 2F, 3F, 4F]VF
mov r10, tmp
mov r11, tmp
...
use r10
use r11
We want to copy propagate tmp into the uses of r10 and r11, but *not*
constant propagate the VF immediate into the uses of tmp.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
bool opt_reduce_swizzle();
bool dead_code_eliminate();
bool virtual_grf_interferes(int a, int b);
- bool opt_copy_propagation();
+ bool opt_copy_propagation(bool do_constant_prop = true);
bool opt_cse_local(bblock_t *block);
bool opt_cse();
bool opt_algebraic();
}
bool
-vec4_visitor::opt_copy_propagation()
+vec4_visitor::opt_copy_propagation(bool do_constant_prop)
{
bool progress = false;
struct copy_entry entries[virtual_grf_reg_count];
if (c != 4)
continue;
- if (try_constant_propagate(brw, inst, i, &entry))
+ if (do_constant_prop && try_constant_propagate(brw, inst, i, &entry))
progress = true;
if (try_copy_propagate(brw, inst, i, &entry, reg))