nir/opt_move: fix handling of if-condition

By accident, this used the parent of the nir_src which is a nir_if
instead of the parent of the SSA value.

Totals from 10814 (8.10% of 133461) affected shaders: (GFX11)
Instrs: 21759185 -> 21757190 (-0.01%); split: -0.02%, +0.01%
CodeSize: 112320272 -> 112316008 (-0.00%); split: -0.02%, +0.01%
SpillSGPRs: 11220 -> 11212 (-0.07%)
SpillVGPRs: 911 -> 903 (-0.88%); split: -1.54%, +0.66%
Latency: 258334759 -> 258316073 (-0.01%); split: -0.02%, +0.01%
InvThroughput: 31428650 -> 31426394 (-0.01%); split: -0.02%, +0.01%
VClause: 309119 -> 309090 (-0.01%); split: -0.01%, +0.01%
SClause: 657028 -> 657150 (+0.02%); split: -0.03%, +0.04%
Copies: 1434209 -> 1432420 (-0.12%); split: -0.28%, +0.15%
Branches: 481804 -> 481801 (-0.00%)
PreSGPRs: 829995 -> 829966 (-0.00%)
PreVGPRs: 758249 -> 758253 (+0.00%)

Fixes: 8a78706643 ('nir: refactor nir_opt_move')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24695>
(cherry picked from commit 7e246f7f2b)
This commit is contained in:
Daniel Schürmann 2023-08-15 12:44:01 +02:00 committed by Eric Engestrom
parent 59a25fc82c
commit c1dae7d2ba
3 changed files with 3 additions and 3 deletions

View file

@ -1075,7 +1075,7 @@
"description": "nir/opt_move: fix handling of if-condition",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "8a78706643ecad8a1f303cc9358873abc29978b4"
},

View file

@ -70,7 +70,7 @@ nir_opt_move_block(nir_block *block, nir_move_options options)
nir_instr *last_instr = nir_block_ends_in_jump(block) ?
nir_block_last_instr(block) : NULL;
const nir_if *iff = nir_block_get_following_if(block);
const nir_instr *if_cond_instr = iff ? iff->condition.parent_instr : NULL;
const nir_instr *if_cond_instr = iff ? iff->condition.ssa->parent_instr : NULL;
/* Walk the instructions backwards.
* The instructions get indexed while iterating.

View file

@ -31,7 +31,7 @@ traces:
checksum: 433b69bea68cfe81914b857bbdc60ea5
gputest/pixmark-piano-v2.trace:
gl-zink-anv-tgl:
checksum: acdfae98a5a31da0a4450af4eea00aa1
checksum: 30a5073830e15db17f5c060be32c5708
gputest/triangle-v2.trace:
gl-zink-anv-tgl:
checksum: 5f694874b15bcd7a3689b387c143590b