This patch adds a matrix type to Clang as described in
"Matrix Support in Clang" on cfe-dev . The patch is not intended for
review yet, just to provide an idea how the implementation would look
One aspect in particular I would appreciate feedback on is how to best
ensure matrix type values are aligned the same as pointers to the
element type, while using LLVM's vector type to lower operations.
The main problem is struct layouting, where LLVM's vector type has a
larger alignment than desired.
To work around that fact, the patch uses array types as storage types for
matrix values, but vector types in other contexts. After loading/before
storing, we bitcast between array type and vector type. Alternatively
we could opt for generating packed LLVM structs.
The builtins will be added in separate, follow-on patches.