SROA read chains
Resolves #16 (closed). Handles mixed index types in reads and writes and also handles reads of products out of non-product types (e.g. a read from an array of products) and writes of products into non-product types (e.g. writing into an array of products).
- For reads with mixed indices we split the read into a sequence of reads where each read either has only field indices or non-field indices. Then, the reads with field indices are handled by the rest of the SROA algorithm and the reads over non-field-indices are not (though if they produce product values, they are handled as described below).
- For writes with mixed indices we split it into two writes where the first write contains any initial fields (i.e. a write to
[field(0), selection(i), ...]
is split into writes to[field(0)]
and[selection(i), ...]
while a write to[selection(i), field(0), ...]
is unchanged) and the other write contains all other indices (it therefore always is writing into some non-product collection. Doing this involves also inserting a read for the initial fields and that read is also fed to the rest of SROA along with the write to the initial fields. - For reads from non-product collections that produce products, we insert reads of all (leaf) fields of that product and add them to the node list so that SROA can break up uses of the read (though the resulting code still has a read, both the non-product read and the read for the individual fields). Note that we may want to run CRC following SROA to collapse the resulting read chain before codegen.
- For writes of products into non-products, we write each field of the product into the collection individually (which involves inserting reads of the product, which are then eliminated by the rest of SROA).
I've left the default pass order the same, but did test this with removing the early SLF pass.
Merge request reports
Activity
requested review from @rarbore2
assigned to @aaronjc4
added 3 commits
-
993d3a48...eed60d07 - 2 commits from branch
main
- db1c95c5 - Merge branch 'main' into sroa-read-chains
-
993d3a48...eed60d07 - 2 commits from branch
mentioned in commit 254bea95
Please register or sign in to reply