Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/asahi/compiler/agx_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -21155,9 +21155,15 @@ agx_compile_shader_nir_internal(nir_shader *nir, struct agx_shader_key *key,
if (is_agx3 && nir->info.shared_size > 0) {
bool shared_fold = false;
NIR_PASS(shared_fold, nir, agx_nir_opt_shared_byte_offsets);
if (shared_fold) {
bool shared_reassoc = false;
NIR_PASS(shared_reassoc, nir, agx_nir_opt_shared_index_reassoc);
if (shared_fold || shared_reassoc) {
post_opt_progress = true;
NIR_PASS(_, nir, nir_opt_cse);
if (shared_reassoc) {
if (agx_nir_opt_shared_index_reassoc(nir))
NIR_PASS(_, nir, nir_opt_cse);
}
NIR_PASS(_, nir, nir_opt_dce);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/asahi/compiler/agx_nir.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ struct nir_def *agx_nir_quad_ddy(struct nir_builder *b, struct nir_def *v);
* still guarantees it for any AGX3 target. */
bool agx_nir_lower_shared_element_index(struct nir_shader *s);
bool agx_nir_opt_shared_byte_offsets(struct nir_shader *s);
bool agx_nir_opt_shared_index_reassoc(struct nir_shader *s);
/* Byte stride of the index immediate of AGX2 I32 lload/lstore, measured on the
* chips with AGX_CAP_FOLD_SHARED_OFFSETS (four 32-bit elements per unit). */
#define G13X_I32_SHARED_INDEX_UNIT_B 16
Expand Down
Loading