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

Sarah Spall via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 12 08:06:56 PST 2025


================
@@ -2064,6 +2064,9 @@ llvm::Value *CodeGenFunction::EmitToMemory(llvm::Value *Value, QualType Ty) {
 
   if (Ty->isExtVectorBoolType()) {
----------------
spall wrote:

My intention was to replace calls to 'isExtVectorBoolType' and 'isPackedVectorBoolType' anywhere we want an hlsl boolean vector to follow the normal handling path for vectors; Hopefully reviews will verify I got this right.
Here we can't follow the normal vector path because it returns the value unchanged, and we need to convert a vec of i1s to a vec of i32s, which is why we zero extend here. The normally "boolean vector packing" does something different.

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


More information about the cfe-commits mailing list