[clang] [HLSL][Matrix] Load and store ConstantMatrixBoolTypes as i32 FixedVectorTypes (PR #175245)

Deric C. via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 9 13:25:31 PST 2026


================
@@ -180,6 +180,19 @@ llvm::Type *CodeGenTypes::convertTypeForLoadStore(QualType T,
     return llvm::IntegerType::get(getLLVMContext(),
                                   (unsigned)Context.getTypeSize(T));
 
+  if (T->isConstantMatrixBoolType()) {
----------------
Icohedron wrote:

It should be noted that when `CodeGenTypes::convertTypeForLoadStore` is called where `T->isConstantMatrixBoolType()`, the `LLVMTy` passed in is of type `<N x i1>`.
Normally the `LLVMTy` is returned and therefore no ZExt occurs because the type of the value being stored is already a `<N x i1>`.
Therefore this change makes it so that if  `T->isConstantMatrixBoolType()`, then we return a `<N x i32>` instead to reuse the existing logic that ZExts boolean vectors `<N x i1>` to `<N x i32>`

https://github.com/llvm/llvm-project/pull/175245


More information about the cfe-commits mailing list