[clang] [Matrix][HLSL] Implement Matrix single constant index swizzle (PR #173044)
Justin Bogner via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 19 09:40:17 PST 2025
================
@@ -5239,8 +5240,28 @@ EmitExtVectorElementExpr(const ExtVectorElementExpr *E) {
return LValue::MakeExtVectorElt(Base.getAddress(), CV, type,
Base.getBaseInfo(), TBAAAccessInfo());
}
- if (Base.isMatrixRow())
+ if (Base.isMatrixRow()) {
+ if (auto *RowIdx =
+ llvm::dyn_cast<llvm::ConstantInt>(Base.getMatrixRowIdx())) {
+ llvm::SmallVector<llvm::Constant *, 8> MatIndices;
----------------
bogner wrote:
Probably better to use the heuristically sized SmallVector here unless there's a particular reason that 8 is a better choice.
```suggestion
llvm::SmallVector<llvm::Constant *> MatIndices;
```
https://github.com/llvm/llvm-project/pull/173044
More information about the cfe-commits
mailing list