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