From 7a579039ccce056ef144c17ab0b48043d234a8d1 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 14 Jan 2022 13:41:55 +0000 Subject: [PATCH] nir/unsigned_upper_bound: don't follow 64-bit f2u32() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes Doom Eternal crash. Signed-off-by: Rhys Perry Reviewed-by: Timur Kristóf Fixes: 72ac3f60261 ("nir: add nir_unsigned_upper_bound and nir_addition_might_overflow") Part-of: (cherry picked from commit d95a0b52e45f8c16e72bdcad99ad02ccca1756c3) --- .pick_status.json | 2 +- src/compiler/nir/nir_range_analysis.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 4927867ee35..b6fc3af013b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3748,7 +3748,7 @@ "description": "nir/unsigned_upper_bound: don't follow 64-bit f2u32()", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "72ac3f60261a8510512861b93e843e695331e2ab" }, diff --git a/src/compiler/nir/nir_range_analysis.c b/src/compiler/nir/nir_range_analysis.c index a50e43651bb..8cdefb8fe3d 100644 --- a/src/compiler/nir/nir_range_analysis.c +++ b/src/compiler/nir/nir_range_analysis.c @@ -1465,7 +1465,6 @@ nir_unsigned_upper_bound(nir_shader *shader, struct hash_table *range_ht, case nir_op_b32csel: case nir_op_ubfe: case nir_op_bfm: - case nir_op_f2u32: case nir_op_fmul: case nir_op_extract_u8: case nir_op_extract_i8: @@ -1476,6 +1475,7 @@ nir_unsigned_upper_bound(nir_shader *shader, struct hash_table *range_ht, case nir_op_u2u8: case nir_op_u2u16: case nir_op_u2u32: + case nir_op_f2u32: if (nir_ssa_scalar_chase_alu_src(scalar, 0).def->bit_size > 32) { /* If src is >32 bits, return max */ return max;