-
Notifications
You must be signed in to change notification settings - Fork 11.8k
Commit
Add baseline tests which should comprehensively test the new atomic metadata. Test codegen / expansion, and preservation in a few transforms. New metadata defined in #89248
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4 | ||
; RUN: opt -mtriple=amdgcn-amd-amdhsa -S -passes=inline < %s | FileCheck %s | ||
; RUN: opt -mtriple=amdgcn-amd-amdhsa -S -passes='cgscc(inline)' < %s | FileCheck %s | ||
|
||
; Ensure that custom metadata survives inlining | ||
|
||
define i32 @atomic_xor(ptr addrspace(1) %ptr, i32 %val) { | ||
; CHECK-LABEL: define i32 @atomic_xor( | ||
; CHECK-SAME: ptr addrspace(1) [[PTR:%.*]], i32 [[VAL:%.*]]) { | ||
; CHECK-NEXT: [[RES:%.*]] = atomicrmw xor ptr addrspace(1) [[PTR]], i32 [[VAL]] monotonic, align 4, !amdgpu.no.fine.grained.memory [[META0:![0-9]+]], !amdgpu.no.remote.memory.access [[META0]] | ||
; CHECK-NEXT: ret i32 [[RES]] | ||
; | ||
%res = atomicrmw xor ptr addrspace(1) %ptr, i32 %val monotonic, !amdgpu.no.fine.grained.memory !0, !amdgpu.no.remote.memory.access !0 | ||
ret i32 %res | ||
} | ||
|
||
define i32 @caller(ptr addrspace(1) %ptr, i32 %val) { | ||
; CHECK-LABEL: define i32 @caller( | ||
; CHECK-SAME: ptr addrspace(1) [[PTR:%.*]], i32 [[VAL:%.*]]) { | ||
; CHECK-NEXT: [[RES_I:%.*]] = atomicrmw xor ptr addrspace(1) [[PTR]], i32 [[VAL]] monotonic, align 4, !amdgpu.no.fine.grained.memory [[META0]], !amdgpu.no.remote.memory.access [[META0]] | ||
; CHECK-NEXT: ret i32 [[RES_I]] | ||
; | ||
%res = call i32 @atomic_xor(ptr addrspace(1) %ptr, i32 %val) | ||
ret i32 %res | ||
} | ||
|
||
!0 = !{} | ||
;. | ||
; CHECK: [[META0]] = !{} | ||
;. |