Skip to content
Snippets Groups Projects
Commit a1c68851 authored by Faith Ekstrand's avatar Faith Ekstrand :speech_balloon:
Browse files

nir/opt_deref: Properly optimize ptr_as_array derefs


When handling casts, we can't blindly propagate the parent of a cast
into a ptr_as_array deref because doing so might loose the stride
information from the cast.  Instead, before we can propagate into
ptr_as_array derefs, we need to check that the cast is a cast of an
array deref and that the stride matches.  For other types of derefs, we
can continue to propagate casts as normal because they don't need the
stride.  We also add an optimization which can combine a ptr_as_array
deref with it parent if it is also an array deref of some form.

Reviewed-by: default avatarAlejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: default avatarCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
parent 427558a7
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment