1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=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,IR %s
4 ; RUN: FileCheck -allow-empty --check-prefix=WARN-COMPATIBLE %s < %t
5 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1030 -verify-machineinstrs < %s
7 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -stop-after=amdgpu-remove-incompatible-functions\
8 ; RUN: -pass-remarks=amdgpu-remove-incompatible-functions %s -o - 2>%t | FileCheck -check-prefixes=INCOMPATIBLE,IR %s
9 ; RUN: FileCheck --check-prefixes=WARN-INCOMPATIBLE %s < %t
10 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -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-COMPATIBLE-NOT: removing function 'needs_gws':
16 ; WARN-INCOMPATIBLE: removing function 'needs_gws': +gws is not supported on the current target
19 ; COMPATIBLE: @GVRefs {{.*}} [ptr @needs_gws]
20 ; INCOMPATIBLE: @GVRefs {{.*}} zeroinitializer
21 @GVRefs = internal global [1 x ptr] [
26 ; COMPATIBLE: @ConstantExpr = internal global i64 ptrtoint (ptr @needs_gws to i64)
27 ; INCOMPATIBLE: @ConstantExpr = internal global i64 0
28 @ConstantExpr = internal global i64 ptrtoint (ptr @needs_gws to i64)
31 ; COMPATIBLE: define void @needs_gws
32 ; INCOMPATIBLE-NOT: define void @needs_gws
33 define void @needs_gws(i32 %val0, i32 %val1) #0 {
34 call void @llvm.amdgcn.ds.gws.init(i32 %val0, i32 %val1)
35 call void @llvm.amdgcn.ds.gws.barrier(i32 %val0, i32 %val1)
39 ; IR: define void @gws_caller(
40 define void @gws_caller(i32 %val0, i32 %val1) {
41 call void @needs_gws(i32 %val0, i32 %val1)
45 declare void @llvm.amdgcn.ds.gws.barrier(i32, i32) #1
46 declare void @llvm.amdgcn.ds.gws.init(i32, i32) #2
49 attributes #0 = { "target-features"="+gws"}
50 attributes #1 = { convergent inaccessiblememonly nounwind }
51 attributes #2 = { convergent inaccessiblememonly nounwind writeonly }
52 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
54 ; INCOMPATIBLE: {{.*}}