diff --git a/.pick_status.json b/.pick_status.json index 78ec2b91f4c..24361ca41d6 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1273,7 +1273,7 @@ "description": "nir/liveness: Consider if uses in nir_ssa_defs_interfere", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "f86902e75d989b781be36ced5dc98dfc0cd34b7b" }, diff --git a/src/compiler/nir/nir_liveness.c b/src/compiler/nir/nir_liveness.c index 16dbeb4a223..c3c181b3263 100644 --- a/src/compiler/nir/nir_liveness.c +++ b/src/compiler/nir/nir_liveness.c @@ -250,6 +250,15 @@ search_for_use_after_instr(nir_instr *start, nir_ssa_def *def) return true; node = node->next; } + + /* If uses are considered to be in the block immediately preceding the if + * so we need to also check the following if condition, if any. + */ + nir_if *following_if = nir_block_get_following_if(start->block); + if (following_if && following_if->condition.is_ssa && + following_if->condition.ssa == def) + return true; + return false; }