[clang] [llvm] [HLSL] Handle WaveActiveBallot struct return type appropriately (PR #175105)

Farzon Lotfi via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 16 15:02:07 PST 2026


================
@@ -1,28 +1,37 @@
-; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-compute %s | FileCheck --check-prefix LOWER %s
-; RUN: opt -S -scalarizer -mtriple=dxil-pc-shadermodel6.3-library < %s | FileCheck --check-prefix SCALAR %s
-
-%dx.types.fouri32 = type { i32, i32, i32, i32 }
-
-define %dx.types.fouri32 @wave_ballot_simple(i1 noundef %p1) {
-entry:
-; LOWER: call %dx.types.fouri32 @dx.op.waveActiveBallot(i32 116, i1 %p1)
-; SCALAR: call { i32, i32, i32, i32 } @llvm.dx.wave.ballot.i32(i1 %p1)
-
-  %s = call %dx.types.fouri32 @llvm.dx.wave.ballot(i1 %p1)
- 
-; Scalarization may occur
-; CHECK: extractvalue
-; CHECK: insertvalue
-; CHECK: extractvalue
-; CHECK: insertvalue
-; CHECK: extractvalue
-; CHECK: insertvalue
-; CHECK: extractvalue
-; CHECK: insertvalue
-
-; CHECK-NOT: ret %dx.types.fouri32
-; CHECK: ret <4 x i32>
-  ret %dx.types.fouri32 %s
-}
-
-declare %dx.types.fouri32 @llvm.dx.wave.ballot(i1)
+; RUN: opt -S -scalarizer -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-compute %s | FileCheck %s
+
+target datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64-v48:16:16-v96:32:32-v192:64:64"
+target triple = "dxilv1.3-pc-shadermodel6.3-compute"
----------------
farzonl wrote:

If you are going to define the target triple here then you don’t need to do it via the mtriple flag.

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


More information about the llvm-commits mailing list