1 // RUN: %clang_cc1 "-triple" "nvptx-nvidia-cuda" "-target-feature" "+ptx70" "-target-cpu" "sm_80" -emit-llvm -fcuda-is-device -o - %s | FileCheck %s
2 // RUN: %clang_cc1 "-triple" "nvptx64-nvidia-cuda" "-target-feature" "+ptx70" "-target-cpu" "sm_80" -emit-llvm -fcuda-is-device -o - %s | FileCheck %s
4 // CHECK: define{{.*}} void @_Z6kernelPi(i32* noundef %out)
5 __attribute__((global)) void kernel(int *out) {
10 out[i++] = __nvvm_redux_sync_add(a, 0xFF);
11 // CHECK: call i32 @llvm.nvvm.redux.sync.add
13 out[i++] = __nvvm_redux_sync_add(b, 0x01);
14 // CHECK: call i32 @llvm.nvvm.redux.sync.add
16 out[i++] = __nvvm_redux_sync_min(a, 0x0F);
17 // CHECK: call i32 @llvm.nvvm.redux.sync.min
19 out[i++] = __nvvm_redux_sync_umin(b, 0xF0);
20 // CHECK: call i32 @llvm.nvvm.redux.sync.umin
22 out[i++] = __nvvm_redux_sync_max(a, 0xF0);
23 // CHECK: call i32 @llvm.nvvm.redux.sync.max
25 out[i++] = __nvvm_redux_sync_umax(b, 0x0F);
26 // CHECK: call i32 @llvm.nvvm.redux.sync.umax
28 out[i++] = __nvvm_redux_sync_and(a, 0xF0);
29 // CHECK: call i32 @llvm.nvvm.redux.sync.and
31 out[i++] = __nvvm_redux_sync_and(b, 0x0F);
32 // CHECK: call i32 @llvm.nvvm.redux.sync.and
34 out[i++] = __nvvm_redux_sync_xor(a, 0x10);
35 // CHECK: call i32 @llvm.nvvm.redux.sync.xor
37 out[i++] = __nvvm_redux_sync_xor(b, 0x01);
38 // CHECK: call i32 @llvm.nvvm.redux.sync.xor
40 out[i++] = __nvvm_redux_sync_or(a, 0xFF);
41 // CHECK: call i32 @llvm.nvvm.redux.sync.or
43 out[i++] = __nvvm_redux_sync_or(b, 0xFF);
44 // CHECK: call i32 @llvm.nvvm.redux.sync.or