[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
Fri Jan 31 12:40:57 PST 2025
================
@@ -0,0 +1,52 @@
+// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s
+
+// CHECK: %struct.S = type { <2 x i32>, float }
+// CHECK: [[ConstS:@.*]] = private unnamed_addr constant %struct.S { <2 x i32> splat (i32 1), float 1.000000e+00 }, align 8
+struct S {
+ bool2 bv;
+ float f;
+};
+
+// CHECK-LABEL: define noundef i1 {{.*}}fn1{{.*}}
+// CHECK: [[B:%.*]] = alloca <2 x i32>, align 8
+// CHECK-NEXT: store <2 x i32> splat (i32 1), ptr [[B]], align 8
----------------
spall wrote:
I seem to have accidentally fixed the alignment issues in the last commit. This used to be 'align 1'
https://github.com/llvm/llvm-project/pull/123977
More information about the cfe-commits
mailing list