1- ; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s
1+ ; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck --check-prefixes=CHECK-TYPE %s
2+ ; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-compute %s 2>&1 | FileCheck --check-prefixes=CHECK-STAGE %s
23
34; DXIL operation ddx.coarse does not support double overload type
4- ; CHECK: in function ddx.coarse
5- ; CHECK-SAME: Cannot create DerivCoarseX operation: Invalid overload type
5+ ; CHECK-TYPE : in function ddx.coarse
6+ ; CHECK-TYPE- SAME: Cannot create DerivCoarseX operation: Invalid overload type
67
78; Function Attrs: noinline nounwind optnone
89define noundef double @ddx.coarse_double (double noundef %a ) #0 {
@@ -13,3 +14,16 @@ entry:
1314 %dx.ddx.coarse = call double @llvm.dx.ddx.coarse.f64 (double %0 )
1415 ret double %dx.ddx.coarse
1516}
17+
18+ ; DXIL operation ddx.coarse does not support compute shader stage
19+ ; CHECK-STAGE: in function ddx.coarse
20+ ; CHECK-STAGE-SAME: Cannot create DerivCoarseX operation: Invalid stage
21+ ; Function Attrs: noinline nounwind optnone
22+ define noundef float @ddx.coarse_float (float noundef %a ) #0 {
23+ entry:
24+ %a.addr = alloca float , align 8
25+ store float %a , ptr %a.addr , align 8
26+ %0 = load float , ptr %a.addr , align 8
27+ %dx.ddx.coarse = call float @llvm.dx.ddx.coarse.f32 (float %0 )
28+ ret float %dx.ddx.coarse
29+ }
0 commit comments