Skip to content

Commit 221f8ee

Browse files
authored
[AMDGPU] Add gfx1251 runlines to cooperative atomcis tests. NFC (#159437)
1 parent 4a8008c commit 221f8ee

File tree

3 files changed

+35
-23
lines changed

3 files changed

+35
-23
lines changed

clang/test/CodeGenOpenCL/builtins-amdgcn-gfx1250-cooperative-atomics.cl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
// REQUIRES: amdgpu-registered-target
44
// RUN: %clang_cc1 -cl-std=CL2.0 -triple amdgcn-unknown-unknown -target-cpu gfx1250 -emit-llvm -o - %s | FileCheck %s
5+
// RUN: %clang_cc1 -cl-std=CL2.0 -triple amdgcn-unknown-unknown -target-cpu gfx1251 -emit-llvm -o - %s | FileCheck %s
56

67
typedef int v2i __attribute__((ext_vector_type(2)));
78
typedef int v4i __attribute__((ext_vector_type(4)));
Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,59 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc -global-isel=0 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1250 < %s | FileCheck -check-prefixes=GFX1250,GFX1250-SDAG %s
3-
; RUN: llc -global-isel=1 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1250 < %s | FileCheck -check-prefixes=GFX1250,GFX1250-GISEL %s
2+
; RUN: llc -global-isel=0 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1250 < %s | FileCheck -check-prefixes=GCN,GFX1250,GFX1250-SDAG %s
3+
; RUN: llc -global-isel=0 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1251 < %s | FileCheck -check-prefixes=GCN,GFX1251,GFX1251-SDAG %s
4+
5+
; RUN: llc -global-isel=1 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1250 < %s | FileCheck -check-prefixes=GCN,GFX1250,GFX1250-GISEL %s
6+
; RUN: llc -global-isel=1 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1251 < %s | FileCheck -check-prefixes=GCN,GFX1251,GFX1251-GISEL %s
7+
8+
; this test has both gfx1250/1251 run lines to check availability of the intrinsic on both variants.
49

510
; test behavior with unsupported 'consume' and 'acq_rel' ordering
611

712
define i32 @test_load_consume(ptr noundef readonly %addr) {
8-
; GFX1250-LABEL: test_load_consume:
9-
; GFX1250: ; %bb.0: ; %entry
10-
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
11-
; GFX1250-NEXT: s_wait_kmcnt 0x0
12-
; GFX1250-NEXT: flat_load_b32 v0, v[0:1] scope:SCOPE_SYS
13-
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
14-
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
13+
; GCN-LABEL: test_load_consume:
14+
; GCN: ; %bb.0: ; %entry
15+
; GCN-NEXT: s_wait_loadcnt_dscnt 0x0
16+
; GCN-NEXT: s_wait_kmcnt 0x0
17+
; GCN-NEXT: flat_load_b32 v0, v[0:1] scope:SCOPE_SYS
18+
; GCN-NEXT: s_wait_loadcnt_dscnt 0x0
19+
; GCN-NEXT: s_set_pc_i64 s[30:31]
1520
entry:
1621
%0 = tail call i32 @llvm.amdgcn.cooperative.atomic.load.32x4B.p0(ptr %addr, i32 1, metadata !0)
1722
ret i32 %0
1823
}
1924

2025
define i32 @test_load_acqrel(ptr noundef readonly %addr) {
21-
; GFX1250-LABEL: test_load_acqrel:
22-
; GFX1250: ; %bb.0: ; %entry
23-
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
24-
; GFX1250-NEXT: s_wait_kmcnt 0x0
25-
; GFX1250-NEXT: flat_load_b32 v0, v[0:1] scope:SCOPE_SYS
26-
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
27-
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
26+
; GCN-LABEL: test_load_acqrel:
27+
; GCN: ; %bb.0: ; %entry
28+
; GCN-NEXT: s_wait_loadcnt_dscnt 0x0
29+
; GCN-NEXT: s_wait_kmcnt 0x0
30+
; GCN-NEXT: flat_load_b32 v0, v[0:1] scope:SCOPE_SYS
31+
; GCN-NEXT: s_wait_loadcnt_dscnt 0x0
32+
; GCN-NEXT: s_set_pc_i64 s[30:31]
2833
entry:
2934
%0 = tail call i32 @llvm.amdgcn.cooperative.atomic.load.32x4B.p0(ptr %addr, i32 4, metadata !0)
3035
ret i32 %0
3136
}
3237

3338
define void @test_store_acqrel(ptr noundef %addr, i32 noundef %val) {
34-
; GFX1250-LABEL: test_store_acqrel:
35-
; GFX1250: ; %bb.0: ; %entry
36-
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
37-
; GFX1250-NEXT: s_wait_kmcnt 0x0
38-
; GFX1250-NEXT: flat_store_b32 v[0:1], v2 scope:SCOPE_SYS
39-
; GFX1250-NEXT: s_wait_dscnt 0x0
40-
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
39+
; GCN-LABEL: test_store_acqrel:
40+
; GCN: ; %bb.0: ; %entry
41+
; GCN-NEXT: s_wait_loadcnt_dscnt 0x0
42+
; GCN-NEXT: s_wait_kmcnt 0x0
43+
; GCN-NEXT: flat_store_b32 v[0:1], v2 scope:SCOPE_SYS
44+
; GCN-NEXT: s_wait_dscnt 0x0
45+
; GCN-NEXT: s_set_pc_i64 s[30:31]
4146
entry:
4247
tail call void @llvm.amdgcn.cooperative.atomic.store.32x4B.p0(ptr %addr, i32 %val, i32 4, metadata !0)
4348
ret void
4449
}
4550

4651
!0 = !{ !"" }
52+
4753
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
54+
; GFX1250: {{.*}}
4855
; GFX1250-GISEL: {{.*}}
4956
; GFX1250-SDAG: {{.*}}
57+
; GFX1251: {{.*}}
58+
; GFX1251-GISEL: {{.*}}
59+
; GFX1251-SDAG: {{.*}}

llvm/test/Verifier/AMDGPU/llvm.amdgcn.cooperative.atomic.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
; RUN: not opt -mtriple=amdgcn -mcpu=gfx1250 -passes=verify -disable-output <%s 2>&1 | FileCheck %s
2+
; RUN: not opt -mtriple=amdgcn -mcpu=gfx1251 -passes=verify -disable-output <%s 2>&1 | FileCheck %s
23

34
; CHECK: cooperative atomic intrinsics require a generic or global pointer
45
define i32 @load_local_as(ptr addrspace(3) noundef %addr) {

0 commit comments

Comments
 (0)