summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2017-08-02 01:42:04 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2017-08-02 01:42:04 +0000
commit1d6317c3ad5d16355f2a261ff8bdda78f76357b5 (patch)
tree66e66d0180ae362a09ce6a37e27acef860554341 /llvm/test/CodeGen
parent6ed7b9bfc09b98b0987c6d87bd250620050ff2d5 (diff)
downloadbcm5719-llvm-1d6317c3ad5d16355f2a261ff8bdda78f76357b5.tar.gz
bcm5719-llvm-1d6317c3ad5d16355f2a261ff8bdda78f76357b5.zip
AMDGPU: Fix emitting encoded calls
This was failing on out of bounds access to the extra operands on the s_swappc_b64 beyond those in the instruction definition. This was working, but somehow regressed within the past few weeks, although I don't see any obvious commit. llvm-svn: 309782
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/AMDGPU/call-encoding.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/call-encoding.ll b/llvm/test/CodeGen/AMDGPU/call-encoding.ll
new file mode 100644
index 00000000000..01e35368de9
--- /dev/null
+++ b/llvm/test/CodeGen/AMDGPU/call-encoding.ll
@@ -0,0 +1,19 @@
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=fiji -amdgpu-function-calls -filetype=obj -verify-machineinstrs < %s | llvm-objdump -triple amdgcn--amdhsa -mcpu=fiji -d - | FileCheck -check-prefixes=GCN,VI %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -amdgpu-function-calls -filetype=obj -verify-machineinstrs < %s | llvm-objdump -triple amdgcn--amdhsa -mcpu=gfx900 -d - | FileCheck -check-prefixes=GCN,GFX9 %s
+; XUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=hawaii -amdgpu-function-calls -filetype=obj -verify-machineinstrs < %s | llvm-objdump -triple amdgcn--amdhsa -mcpu=hawaii -d - | FileCheck -check-prefixes=GCN,CI %s
+
+; GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GCN-NEXT: s_setpc_b64
+define void @void_func_void() #1 {
+ ret void
+}
+
+; GCN: s_getpc_b64
+; GCN: s_swappc_b64
+define amdgpu_kernel void @test_call_void_func_void() {
+ call void @void_func_void()
+ ret void
+}
+
+attributes #0 = { nounwind }
+attributes #1 = { nounwind noinline }
OpenPOWER on IntegriCloud