From 08e355a2877f0cb785135bf2bcbad3603d4038fd Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Thu, 7 Nov 2024 16:51:03 +0000 Subject: [PATCH] nir/opt_move_discards_to_top: use nir_intrinsic_can_reorder fossil-db (navi21): Totals from 2306 (2.90% of 79395) affected shaders: MaxWaves: 65920 -> 65952 (+0.05%); split: +0.22%, -0.17% Instrs: 1056765 -> 1058517 (+0.17%); split: -0.09%, +0.26% CodeSize: 5802396 -> 5808076 (+0.10%); split: -0.13%, +0.23% VGPRs: 79976 -> 79248 (-0.91%); split: -1.46%, +0.55% Latency: 17215154 -> 17527774 (+1.82%); split: -0.11%, +1.92% InvThroughput: 4911203 -> 4918838 (+0.16%); split: -0.06%, +0.22% VClause: 16214 -> 16268 (+0.33%); split: -0.44%, +0.78% SClause: 33208 -> 34167 (+2.89%); split: -1.02%, +3.91% Copies: 58352 -> 58343 (-0.02%); split: -1.20%, +1.18% Branches: 21857 -> 21863 (+0.03%); split: -0.02%, +0.05% PreSGPRs: 73666 -> 74298 (+0.86%); split: -0.82%, +1.67% PreVGPRs: 55234 -> 55720 (+0.88%); split: -0.41%, +1.29% VALU: 756386 -> 756329 (-0.01%); split: -0.06%, +0.05% SALU: 123838 -> 124320 (+0.39%); split: -0.35%, +0.74% VMEM: 25002 -> 25009 (+0.03%) SMEM: 60765 -> 60580 (-0.30%); split: -0.41%, +0.11% Signed-off-by: Rhys Perry Reviewed-by: Alyssa Rosenzweig Reviewed-by: Georg Lehmann Part-of: --- src/compiler/nir/nir_opt_move_discards_to_top.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/compiler/nir/nir_opt_move_discards_to_top.c b/src/compiler/nir/nir_opt_move_discards_to_top.c index 6ab71cd3873..5950bb86711 100644 --- a/src/compiler/nir/nir_opt_move_discards_to_top.c +++ b/src/compiler/nir/nir_opt_move_discards_to_top.c @@ -49,14 +49,8 @@ add_src_to_worklist(nir_src *src, void *worklist) if (instr->type == nir_instr_type_intrinsic) { nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr); - if (intrin->intrinsic == nir_intrinsic_load_deref) { - nir_deref_instr *deref = nir_src_as_deref(intrin->src[0]); - if (!nir_deref_mode_is_one_of(deref, nir_var_read_only_modes)) - return false; - } else if (!(nir_intrinsic_infos[intrin->intrinsic].flags & - NIR_INTRINSIC_CAN_REORDER)) { + if (!nir_intrinsic_can_reorder(intrin)) return false; - } } /* Set pass_flags and remember the instruction to add it's own sources and for potential