|
| 1 | +; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s |
| 2 | +; |
| 3 | +; CHECK: ; Shader Flags Value: [[WAVE_FLAG:0x00080000]] |
| 4 | +; CHECK: ; Note: shader requires additional functionality: |
| 5 | +; CHECK-NEXT: ; Wave level operations |
| 6 | +; CHECK-NEXT: ; Note: extra DXIL module flags: |
| 7 | +; CHECK-NEXT: {{^;$}} |
| 8 | + |
| 9 | +target triple = "dxil-pc-shadermodel6.7-library" |
| 10 | + |
| 11 | +define noundef i1 @wave_is_first_lane() { |
| 12 | +entry: |
| 13 | + ; CHECK: Function wave_is_first_lane : [[WAVE_FLAG]] |
| 14 | + %ret = call i1 @llvm.dx.wave.is.first.lane() |
| 15 | + ret i1 %ret |
| 16 | +} |
| 17 | + |
| 18 | +define noundef i32 @wave_getlaneindex() { |
| 19 | +entry: |
| 20 | + ; CHECK: Function wave_getlaneindex : [[WAVE_FLAG]] |
| 21 | + %ret = call i32 @llvm.dx.wave.getlaneindex() |
| 22 | + ret i32 %ret |
| 23 | +} |
| 24 | + |
| 25 | +define noundef i1 @wave_any(i1 %x) { |
| 26 | +entry: |
| 27 | + ; CHECK: Function wave_any : [[WAVE_FLAG]] |
| 28 | + %ret = call i1 @llvm.dx.wave.any(i1 %x) |
| 29 | + ret i1 %ret |
| 30 | +} |
| 31 | + |
| 32 | +define noundef i1 @wave_all(i1 %x) { |
| 33 | +entry: |
| 34 | + ; CHECK: Function wave_all : [[WAVE_FLAG]] |
| 35 | + %ret = call i1 @llvm.dx.wave.all(i1 %x) |
| 36 | + ret i1 %ret |
| 37 | +} |
| 38 | + |
| 39 | +define noundef i1 @wave_readlane(i1 %x, i32 %idx) { |
| 40 | +entry: |
| 41 | + ; CHECK: Function wave_readlane : [[WAVE_FLAG]] |
| 42 | + %ret = call i1 @llvm.dx.wave.readlane.i1(i1 %x, i32 %idx) |
| 43 | + ret i1 %ret |
| 44 | +} |
| 45 | + |
| 46 | +define noundef i32 @wave_reduce_sum(i32 noundef %x) { |
| 47 | +entry: |
| 48 | + ; CHECK: Function wave_reduce_sum : [[WAVE_FLAG]] |
| 49 | + %ret = call i32 @llvm.dx.wave.reduce.sum.i32(i32 %x) |
| 50 | + ret i32 %ret |
| 51 | +} |
| 52 | + |
| 53 | +define noundef i32 @wave_reduce_usum(i32 noundef %x) { |
| 54 | +entry: |
| 55 | + ; CHECK: Function wave_reduce_usum : [[WAVE_FLAG]] |
| 56 | + %ret = call i32 @llvm.dx.wave.reduce.usum.i32(i32 %x) |
| 57 | + ret i32 %ret |
| 58 | +} |
| 59 | + |
| 60 | +define noundef i32 @wave_reduce_max(i32 noundef %x) { |
| 61 | +entry: |
| 62 | + ; CHECK: Function wave_reduce_max : [[WAVE_FLAG]] |
| 63 | + %ret = call i32 @llvm.dx.wave.reduce.max.i32(i32 %x) |
| 64 | + ret i32 %ret |
| 65 | +} |
| 66 | + |
| 67 | +define noundef i32 @wave_reduce_umax(i32 noundef %x) { |
| 68 | +entry: |
| 69 | + ; CHECK: Function wave_reduce_umax : [[WAVE_FLAG]] |
| 70 | + %ret = call i32 @llvm.dx.wave.reduce.umax.i32(i32 %x) |
| 71 | + ret i32 %ret |
| 72 | +} |
| 73 | + |
| 74 | +define void @wave_active_countbits(i1 %expr) { |
| 75 | +entry: |
| 76 | + ; CHECK: Function wave_active_countbits : [[WAVE_FLAG]] |
| 77 | + %0 = call i32 @llvm.dx.wave.active.countbits(i1 %expr) |
| 78 | + ret void |
| 79 | +} |
0 commit comments