brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · 3544017 Raw
99 lines · plain
1; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s2;3; Test that we have the correct shader flags to indicate that there are wave4; ops set at the module level5;6; CHECK: ; Shader Flags Value: [[WAVE_FLAG:0x00080000]]7; CHECK: ; Note: shader requires additional functionality:8; CHECK-NEXT: ;       Wave level operations9; CHECK-NEXT: ; Note: extra DXIL module flags:10 11target triple = "dxil-pc-shadermodel6.7-library"12 13; Test the indiviual ops that they have the same Shader Wave flag at the14; function level to ensure that each op is setting it accordingly15 16define noundef i1 @wave_is_first_lane() {17entry:18  ; CHECK: Function wave_is_first_lane : [[WAVE_FLAG]]19  %ret = call i1 @llvm.dx.wave.is.first.lane()20  ret i1 %ret21}22 23define noundef i32 @wave_getlaneindex() {24entry:25  ; CHECK: Function wave_getlaneindex : [[WAVE_FLAG]]26  %ret = call i32 @llvm.dx.wave.getlaneindex()27  ret i32 %ret28}29 30define noundef i1 @wave_any(i1 %x) {31entry:32  ; CHECK: Function wave_any : [[WAVE_FLAG]]33  %ret = call i1 @llvm.dx.wave.any(i1 %x)34  ret i1 %ret35}36 37define noundef i1 @wave_all(i1 %x) {38entry:39  ; CHECK: Function wave_all : [[WAVE_FLAG]]40  %ret = call i1 @llvm.dx.wave.all(i1 %x)41  ret i1 %ret42}43 44define noundef i1 @wave_readlane(i1 %x, i32 %idx) {45entry:46  ; CHECK: Function wave_readlane : [[WAVE_FLAG]]47  %ret = call i1 @llvm.dx.wave.readlane.i1(i1 %x, i32 %idx)48  ret i1 %ret49}50 51define noundef i32 @wave_reduce_sum(i32 noundef %x) {52entry:53  ; CHECK: Function wave_reduce_sum : [[WAVE_FLAG]]54  %ret = call i32 @llvm.dx.wave.reduce.sum.i32(i32 %x)55  ret i32 %ret56}57 58define noundef i32 @wave_reduce_usum(i32 noundef %x) {59entry:60  ; CHECK: Function wave_reduce_usum : [[WAVE_FLAG]]61  %ret = call i32 @llvm.dx.wave.reduce.usum.i32(i32 %x)62  ret i32 %ret63}64 65define noundef i32 @wave_reduce_max(i32 noundef %x) {66entry:67  ; CHECK: Function wave_reduce_max : [[WAVE_FLAG]]68  %ret = call i32 @llvm.dx.wave.reduce.max.i32(i32 %x)69  ret i32 %ret70}71 72define noundef i32 @wave_reduce_umax(i32 noundef %x) {73entry:74  ; CHECK: Function wave_reduce_umax : [[WAVE_FLAG]]75  %ret = call i32 @llvm.dx.wave.reduce.umax.i32(i32 %x)76  ret i32 %ret77}78 79define noundef i32 @wave_reduce_min(i32 noundef %x) {80entry:81  ; CHECK: Function wave_reduce_min : [[WAVE_FLAG]]82  %ret = call i32 @llvm.dx.wave.reduce.min.i32(i32 %x)83  ret i32 %ret84}85 86define noundef i32 @wave_reduce_umin(i32 noundef %x) {87entry:88  ; CHECK: Function wave_reduce_umin : [[WAVE_FLAG]]89  %ret = call i32 @llvm.dx.wave.reduce.umin.i32(i32 %x)90  ret i32 %ret91}92 93define void @wave_active_countbits(i1 %expr) {94entry:95  ; CHECK: Function wave_active_countbits : [[WAVE_FLAG]]96  %0 = call i32 @llvm.dx.wave.active.countbits(i1 %expr)97  ret void98}99