[HLSL] Matrix layout is lost when type sugar is removed
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
## Issue
We need an AST representation of the layout as mentioned here:
Please fix the representation of matrix types in the AST so the layout doesn't depend on type sugar.
_Originally posted by @efriedma-quic in https://github.com/llvm/llvm-project/pull/211978#pullrequestreview-4782329852_
## Why Do we need this?
Explicit row_major and column_major orientation is stored only as AttributedType sugar. When matrices are desugared or wrapped in arrays and resources, CodeGen can lose the orientation and incorrectly use the translation-unit default.
Matrix orientation should be represented directly in ConstantMatrixType, preserved through serialization, importing, transformations, and template deduction, while retaining attributes for source fidelity.
Add CodeGen coverage for local arrays, structured resources, GEPs, loads, stores, and explicit layout overriding the default.
Contributor guide
Assessment
This issue has not been assessed yet.