Skip to content

WIP: nir: Improve nir_opt_shrink_vectors so it can trim starting components.

Previously, it could only trim unused components from the end.

With this patch it can now also trim from both start and end.
The following technique is used to achieve this:

  1. Adjust component offset and num_components in the intrinsic to account for the trimmed components.
  2. Create a new SSA def where we fill the space left by the unused components with undefs.
  3. Finally, replace all uses of the old SSA def with the replacement that now uses the shrunk vector.

Merge request reports