1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -march=amdgcn -mcpu=gfx1030 -stop-after=amdgpu-remove-incompatible-functions\
3 ; RUN: -pass-remarks=amdgpu-remove-incompatible-functions %s -o - 2>%t | FileCheck -check-prefixes=COMPATIBLE,REALTIME,MEMTIME %s
4 ; RUN: FileCheck -allow-empty --check-prefixes=WARN-REALTIME,WARN-MEMTIME %s < %t
5 ; RUN: llc -march=amdgcn -mcpu=gfx1030 -verify-machineinstrs < %s
7 ; RUN: llc -march=amdgcn -mcpu=gfx1102 -stop-after=amdgpu-remove-incompatible-functions\
8 ; RUN: -pass-remarks=amdgpu-remove-incompatible-functions %s -o - 2>%t | FileCheck -check-prefixes=INCOMPATIBLE,NOREALTIME,NOMEMTIME %s
9 ; RUN: FileCheck --check-prefixes=WARN-NOREALTIME,WARN-NOMEMTIME %s < %t
10 ; RUN: llc -march=amdgcn -mcpu=gfx1102 -verify-machineinstrs < %s
12 ; Note: This test checks the IR, but also has a run line to codegen the file just to check we
13 ; do not crash when trying to select those functions.
15 ; WARN-REALTIME-NOT: removing function 'needs_s_memrealtime':
16 ; WARN-MEMTIME-NOT: removing function 'needs_s_memtime':
17 ; WARN-NOREALTIME: removing function 'needs_s_memrealtime': +s-memrealtime is not supported on the current target
18 ; WARN-NOMEMTIME: removing function 'needs_s_memtime': +s-memtime-inst is not supported on the current target
20 ; COMPATIBLE: @GVRefs {{.*}} [ptr @needs_s_memrealtime, ptr @needs_s_memtime]
21 ; INCOMPATIBLE: @GVRefs {{.*}} zeroinitializer
22 @GVRefs = internal global [2 x ptr] [
23 ptr @needs_s_memrealtime,
27 ; REALTIME: @ConstantExpr0 = internal global i64 ptrtoint (ptr @needs_s_memrealtime to i64)
28 ; NOREALTIME: @ConstantExpr0 = internal global i64 0
29 @ConstantExpr0 = internal global i64 ptrtoint (ptr @needs_s_memrealtime to i64)
31 ; MEMTIME: @ConstantExpr1 = internal global i64 ptrtoint (ptr @needs_s_memtime to i64)
32 ; NOMEMTIME: @ConstantExpr1 = internal global i64 0
33 @ConstantExpr1 = internal global i64 ptrtoint (ptr @needs_s_memtime to i64)
35 ; REALTIME: define i64 @needs_s_memrealtime
36 ; NOREALTIME-NOT: define i64 @needs_s_memrealtime
37 define i64 @needs_s_memrealtime() #0 {
38 %t = tail call i64 @llvm.amdgcn.s.memrealtime()
42 ; IR: define void @s_memrealtime_caller(
43 define i64 @s_memrealtime_caller() {
44 ; REALTIME: call i64 @needs_s_memrealtime(
45 ; NOREALTIME: call i64 null
46 %t = call i64 @needs_s_memrealtime()
51 ; MEMTIME: define i64 @needs_s_memtime
52 ; NOMEMTIME-NOT: define i64 @needs_s_memtime
53 define i64 @needs_s_memtime() #1 {
54 %t = tail call i64 @llvm.amdgcn.s.memtime()
58 ; IR: define void @s_memtime_caller(
59 define i64 @s_memtime_caller() {
60 ; MEMTIME: call i64 @needs_s_memtime(
61 ; NOMEMTIME: call i64 null
62 %t = call i64 @needs_s_memtime()
68 declare i64 @llvm.amdgcn.s.memrealtime()
69 declare i64 @llvm.amdgcn.s.memtime()
71 attributes #0 = { "target-features"="+s-memrealtime"}
72 attributes #1 = { "target-features"="+s-memtime-inst"}