mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 01:18:06 +02:00
nir/lower_io: Emit less iadd(x, 0)
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22890>
This commit is contained in:
parent
0b259e72bd
commit
0e679e80a9
1 changed files with 3 additions and 0 deletions
|
|
@ -908,6 +908,9 @@ build_addr_iadd_imm(nir_builder *b, nir_ssa_def *addr,
|
|||
nir_variable_mode modes,
|
||||
int64_t offset)
|
||||
{
|
||||
if (!offset)
|
||||
return addr;
|
||||
|
||||
return build_addr_iadd(b, addr, addr_format, modes,
|
||||
nir_imm_intN_t(b, offset,
|
||||
addr_get_offset_bit_size(addr, addr_format)));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue