nir/algebraic: Move all the individual transforms to a common table.

Cuts 28% of the remaining relocations in libvulkan_intel.so, shrinks
binary size by 290kb.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13987>
This commit is contained in:
Emma Anholt
2021-12-01 15:45:54 -08:00
committed by Marge Bot
parent a29b54f014
commit de33205f88
3 changed files with 33 additions and 34 deletions

View File

@@ -884,8 +884,9 @@ nir_algebraic_instr(nir_builder *build, nir_instr *instr,
int xform_idx = *util_dynarray_element(states, uint16_t,
alu->dest.dest.ssa.index);
for (uint16_t i = 0; i < table->transform_counts[xform_idx]; i++) {
const struct transform *xform = &table->transforms[xform_idx][i];
for (const struct transform *xform = &table->transforms[table->transform_offsets[xform_idx]];
xform->condition_offset != ~0;
xform++) {
if (condition_flags[xform->condition_offset] &&
!(table->values[xform->search].expression.inexact && ignore_inexact) &&
nir_replace_instr(build, alu, range_ht, states, table,