diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 8e28a072bfd..42e23e7e08a 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -6150,12 +6150,15 @@ fs_visitor::optimize() OPT(fixup_nomask_control_flow); if (progress) { - OPT(opt_copy_propagation); + if (OPT(opt_copy_propagation)) + OPT(opt_algebraic); + /* Only run after logical send lowering because it's easier to implement * in terms of physical sends. */ - if (OPT(opt_zero_samples)) - OPT(opt_copy_propagation); + if (OPT(opt_zero_samples) && OPT(opt_copy_propagation)) + OPT(opt_algebraic); + /* Run after logical send lowering to give it a chance to CSE the * LOAD_PAYLOAD instructions created to construct the payloads of * e.g. texturing messages in cases where it wasn't possible to CSE the @@ -6197,7 +6200,8 @@ fs_visitor::optimize() if (devinfo->ver <= 5 && OPT(lower_minmax)) { OPT(opt_cmod_propagation); OPT(opt_cse); - OPT(opt_copy_propagation); + if (OPT(opt_copy_propagation)) + OPT(opt_algebraic); OPT(dead_code_eliminate); } @@ -6205,7 +6209,8 @@ fs_visitor::optimize() OPT(lower_derivatives); OPT(lower_regioning); if (progress) { - OPT(opt_copy_propagation); + if (OPT(opt_copy_propagation)) + OPT(opt_algebraic); OPT(dead_code_eliminate); OPT(lower_simd_width); }