From 64c60582b54e6b8b25bb94835bf5ee17469ef5ca Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Sat, 7 Mar 2026 11:26:44 -0800 Subject: [PATCH] elk/algebraic: Don't optimize SEL.L.SAT or SEL.G.SAT shader-db: Broadwell total instructions in shared programs: 18607516 -> 18607530 (<.01%) instructions in affected programs: 2095 -> 2109 (0.67%) helped: 0 / HURT: 8 total cycles in shared programs: 955704436 -> 955702925 (<.01%) cycles in affected programs: 34299 -> 32788 (-4.41%) helped: 2 / HURT: 6 All Haswell and older platforms had similar results. (Haswell shown) total instructions in shared programs: 16989200 -> 16989201 (<.01%) instructions in affected programs: 461 -> 462 (0.22%) helped: 0 / HURT: 1 total cycles in shared programs: 946537070 -> 946537035 (<.01%) cycles in affected programs: 16378 -> 16343 (-0.21%) helped: 1 / HURT: 0 Test: piglit!1100 Reported-by: Georg Lehmann Fixes: ca675b73d3a ("i965/fs: Optimize saturating SEL.L(E) with imm val >= 1.0.") Reviewed-by: Caio Oliveira Part-of: --- src/intel/compiler/elk/elk_fs.cpp | 37 ------------------------------- 1 file changed, 37 deletions(-) diff --git a/src/intel/compiler/elk/elk_fs.cpp b/src/intel/compiler/elk/elk_fs.cpp index 6483bb2b6f5..ead4475bc61 100644 --- a/src/intel/compiler/elk/elk_fs.cpp +++ b/src/intel/compiler/elk/elk_fs.cpp @@ -2367,43 +2367,6 @@ elk_fs_visitor::opt_algebraic() inst->predicate_inverse = false; inst->conditional_mod = ELK_CONDITIONAL_NONE; progress = true; - } else if (inst->saturate && inst->src[1].file == IMM) { - switch (inst->conditional_mod) { - case ELK_CONDITIONAL_LE: - case ELK_CONDITIONAL_L: - switch (inst->src[1].type) { - case ELK_REGISTER_TYPE_F: - if (inst->src[1].f >= 1.0f) { - inst->opcode = ELK_OPCODE_MOV; - inst->sources = 1; - inst->src[1] = reg_undef; - inst->conditional_mod = ELK_CONDITIONAL_NONE; - progress = true; - } - break; - default: - break; - } - break; - case ELK_CONDITIONAL_GE: - case ELK_CONDITIONAL_G: - switch (inst->src[1].type) { - case ELK_REGISTER_TYPE_F: - if (inst->src[1].f <= 0.0f) { - inst->opcode = ELK_OPCODE_MOV; - inst->sources = 1; - inst->src[1] = reg_undef; - inst->conditional_mod = ELK_CONDITIONAL_NONE; - progress = true; - } - break; - default: - break; - } - break; - default: - break; - } } break; case ELK_OPCODE_MAD: