[clang] [HLSL] Make memory representation of boolean vectors in HLSL, vectors of i32. Add support for boolean swizzling. (PR #123977)

Chris B via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 14 12:56:38 PST 2025


================
@@ -2081,6 +2084,9 @@ llvm::Value *CodeGenFunction::EmitToMemory(llvm::Value *Value, QualType Ty) {
 llvm::Value *CodeGenFunction::EmitFromMemory(llvm::Value *Value, QualType Ty) {
   if (Ty->isExtVectorBoolType()) {
     const auto *RawIntTy = Value->getType();
+    if (getLangOpts().HLSL)
+      return Builder.CreateTrunc(Value, ConvertType(Ty), "loadedv");
----------------
llvm-beanz wrote:

Similar here right? we only need this if the loaded type differs?

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


More information about the cfe-commits mailing list