diff --git a/.pick_status.json b/.pick_status.json index ed83e28d011..9205e3927a9 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -5593,7 +5593,7 @@ "description": "nir/large_constants: only search for constant duplicates", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "b6d475356846f57a034e662ab9245d11ed0dd4a0" }, diff --git a/src/compiler/nir/nir_opt_large_constants.c b/src/compiler/nir/nir_opt_large_constants.c index 94af7a464b1..01356758e3d 100644 --- a/src/compiler/nir/nir_opt_large_constants.c +++ b/src/compiler/nir/nir_opt_large_constants.c @@ -50,7 +50,9 @@ var_info_cmp(const void *_a, const void *_b) uint32_t a_size = a->constant_data_size; uint32_t b_size = b->constant_data_size; - if (a_size < b_size) { + if (a->is_constant != b->is_constant) { + return (int)a->is_constant - (int)b->is_constant; + } else if (a_size < b_size) { return -1; } else if (a_size > b_size) { return 1;