From 2a2dba1bc74a31661e8a5130d1d3e9d3bb8ad913 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 (cherry picked from commit 64c60582b54e6b8b25bb94835bf5ee17469ef5ca) Part-of: --- .pick_status.json | 2 +- src/intel/compiler/elk/elk_fs.cpp | 37 ------------------------------- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 75db7b2dc36..4d81f6f5c66 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1134,7 +1134,7 @@ "description": "elk/algebraic: Don't optimize SEL.L.SAT or SEL.G.SAT", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "ca675b73d3ac2e1b57ec385c2c80b05b6382f6b6", "notes": null diff --git a/src/intel/compiler/elk/elk_fs.cpp b/src/intel/compiler/elk/elk_fs.cpp index 9ad48310716..f85422ddaf4 100644 --- a/src/intel/compiler/elk/elk_fs.cpp +++ b/src/intel/compiler/elk/elk_fs.cpp @@ -2409,43 +2409,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: