| 1 |
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py |
| 2 |
// REQUIRES: amdgpu-registered-target |
| 3 |
// RUN: %clang_cc1 -cl-std=CL2.0 -triple amdgcn-unknown-unknown -target-cpu gfx1250 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-GFX1250 |
| 4 |
|
| 5 |
typedef int v2i __attribute__((ext_vector_type(2))); |
| 6 |
typedef int v4i __attribute__((ext_vector_type(4))); |
| 7 |
|
| 8 |
// CHECK-GFX1250-LABEL: @test_amdgcn_global_load_monitor_b32( |
| 9 |
// CHECK-GFX1250-NEXT: entry: |
| 10 |
// CHECK-GFX1250-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.amdgcn.global.load.monitor.b32.i32(ptr addrspace(1) [[INPTR:%.*]], i32 1) |
| 11 |
// CHECK-GFX1250-NEXT: ret i32 [[TMP0]] |
| 12 |
// |
| 13 |
int test_amdgcn_global_load_monitor_b32(global int* inptr) |
| 14 |
{ |
| 15 |
return __builtin_amdgcn_global_load_monitor_b32(inptr, 1); |
| 16 |
} |
| 17 |
|
| 18 |
// CHECK-GFX1250-LABEL: @test_amdgcn_global_load_monitor_b64( |
| 19 |
// CHECK-GFX1250-NEXT: entry: |
| 20 |
// CHECK-GFX1250-NEXT: [[TMP0:%.*]] = tail call <2 x i32> @llvm.amdgcn.global.load.monitor.b64.v2i32(ptr addrspace(1) [[INPTR:%.*]], i32 10) |
| 21 |
// CHECK-GFX1250-NEXT: ret <2 x i32> [[TMP0]] |
| 22 |
// |
| 23 |
v2i test_amdgcn_global_load_monitor_b64(global v2i* inptr) |
| 24 |
{ |
| 25 |
return __builtin_amdgcn_global_load_monitor_b64(inptr, 10); |
| 26 |
} |
| 27 |
|
| 28 |
// CHECK-GFX1250-LABEL: @test_amdgcn_global_load_monitor_b128( |
| 29 |
// CHECK-GFX1250-NEXT: entry: |
| 30 |
// CHECK-GFX1250-NEXT: [[TMP0:%.*]] = tail call <4 x i32> @llvm.amdgcn.global.load.monitor.b128.v4i32(ptr addrspace(1) [[INPTR:%.*]], i32 22) |
| 31 |
// CHECK-GFX1250-NEXT: ret <4 x i32> [[TMP0]] |
| 32 |
// |
| 33 |
v4i test_amdgcn_global_load_monitor_b128(global v4i* inptr) |
| 34 |
{ |
| 35 |
return __builtin_amdgcn_global_load_monitor_b128(inptr, 22); |
| 36 |
} |
| 37 |
|
| 38 |
// CHECK-GFX1250-LABEL: @test_amdgcn_flat_load_monitor_b32( |
| 39 |
// CHECK-GFX1250-NEXT: entry: |
| 40 |
// CHECK-GFX1250-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.amdgcn.flat.load.monitor.b32.i32(ptr [[INPTR:%.*]], i32 27) |
| 41 |
// CHECK-GFX1250-NEXT: ret i32 [[TMP0]] |
| 42 |
// |
| 43 |
int test_amdgcn_flat_load_monitor_b32(int* inptr) |
| 44 |
{ |
| 45 |
return __builtin_amdgcn_flat_load_monitor_b32(inptr, 27); |
| 46 |
} |
| 47 |
|
| 48 |
// CHECK-GFX1250-LABEL: @test_amdgcn_flat_load_monitor_b64( |
| 49 |
// CHECK-GFX1250-NEXT: entry: |
| 50 |
// CHECK-GFX1250-NEXT: [[TMP0:%.*]] = tail call <2 x i32> @llvm.amdgcn.flat.load.monitor.b64.v2i32(ptr [[INPTR:%.*]], i32 1) |
| 51 |
// CHECK-GFX1250-NEXT: ret <2 x i32> [[TMP0]] |
| 52 |
// |
| 53 |
v2i test_amdgcn_flat_load_monitor_b64(v2i* inptr) |
| 54 |
{ |
| 55 |
return __builtin_amdgcn_flat_load_monitor_b64(inptr, 1); |
| 56 |
} |
| 57 |
|
| 58 |
// CHECK-GFX1250-LABEL: @test_amdgcn_flat_load_monitor_b128( |
| 59 |
// CHECK-GFX1250-NEXT: entry: |
| 60 |
// CHECK-GFX1250-NEXT: [[TMP0:%.*]] = tail call <4 x i32> @llvm.amdgcn.flat.load.monitor.b128.v4i32(ptr [[INPTR:%.*]], i32 0) |
| 61 |
// CHECK-GFX1250-NEXT: ret <4 x i32> [[TMP0]] |
| 62 |
// |
| 63 |
v4i test_amdgcn_flat_load_monitor_b128(v4i* inptr) |
| 64 |
{ |
| 65 |
return __builtin_amdgcn_flat_load_monitor_b128(inptr, 0); |
| 66 |
} |