nir: Remove assert-only variable by inlining its single use

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29970>
This commit is contained in:
Jesse Natalie 2024-06-28 11:15:03 -07:00 committed by Marge Bot
parent 30db807f79
commit c2b53d7bd0

View file

@ -240,7 +240,6 @@ lower_mem_store(nir_builder *b, nir_intrinsic_instr *intrin,
nir_src *offset_src = nir_get_io_offset_src(intrin);
const bool offset_is_const = nir_src_is_const(*offset_src);
nir_def *offset = offset_src->ssa;
bool is_scratch = intrin->intrinsic == nir_intrinsic_store_scratch;
nir_component_mask_t writemask = nir_intrinsic_write_mask(intrin);
assert(writemask < (1 << num_components));
@ -295,7 +294,8 @@ lower_mem_store(nir_builder *b, nir_intrinsic_instr *intrin,
chunk_bytes > max_chunk_bytes) {
/* Otherwise the caller made a mistake with their return values. */
assert(chunk_bytes <= 4);
assert(allow_unaligned_stores_as_atomics || is_scratch);
assert(allow_unaligned_stores_as_atomics ||
intrin->intrinsic == nir_intrinsic_store_scratch);
/* We'll turn this into a pair of 32-bit atomics to modify only the right
* bits of memory.