[pre-RFC] Vectorized TIR Buffers

Thank you for the C0/C1 definitions. That is exactly the difference I had been thinking of, but hadn’t been aware of the existing terminology. That also makes sense on the pros and cons of C0/C1. That C0 fits better to the for high-level descriptions of the computation to be performed, while C1 fits better to the low-level codegen.

I think that’s the same way I was leaning, where the high-level descriptions are done in either C0 or C1, depending on which is more convenient. The LegalizeVectorization pass would then convert everything to either in the form required based on the capabilities of each target. Whether that means normalizing fully to C1, or having the final result be somewhere in between, I like that method of pulling the logic out into a pass. I’d tend toward having the LegalizeVectorization result in pure C1, but that’s at least partly due to me being most familiar with the Vulkan backend.

What is the advantage in leaving the index as a ramp, rather than having the pass convert it to a type-cast, followed by a scalar index? In my mind, the latter would be a simpler constraint to provide to the codegen (all indices are scalar, all array access results in either the array element’s type, or the explicitly specified type-cast), and a simpler constraint for the legalization pass to follow (when legalizing for targets that do not support type casting, no type casts may be added).