summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2016-02-19 15:33:13 +0000
committerTom Stellard <thomas.stellard@amd.com>2016-02-19 15:33:13 +0000
commit2d26fe7aa639e9aa84097bf5aadc83dd4a780e35 (patch)
treef36b3773186fbe534ff9aeae93e5e82c40a3122a /llvm/test
parent9630a4ab15b4ece614d18f20e30bd65d8cf2d262 (diff)
downloadbcm5719-llvm-2d26fe7aa639e9aa84097bf5aadc83dd4a780e35.tar.gz
bcm5719-llvm-2d26fe7aa639e9aa84097bf5aadc83dd4a780e35.zip
AMDGPU/SI: Fix s_waitcnt insertion for flat instructions
Summary: This was broken in r260694 which swapped the address and data operands for flat store instructions. The code in SIInsertWaits assumes that the data operand always comes before the address operand, so we need to add a special case for flat. Reviewers: arsenm Subscribers: arsenm, llvm-commits Differential Revision: http://reviews.llvm.org/D17366 llvm-svn: 261330
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/AMDGPU/waitcnt-flat.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/waitcnt-flat.ll b/llvm/test/CodeGen/AMDGPU/waitcnt-flat.ll
new file mode 100644
index 00000000000..d2703453d40
--- /dev/null
+++ b/llvm/test/CodeGen/AMDGPU/waitcnt-flat.ll
@@ -0,0 +1,16 @@
+; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri | FileCheck --check-prefix=GCN %s
+; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=fiji | FileCheck --check-prefix=GCN %s
+
+; If flat_store_dword and flat_load_dword use different registers for the data
+; operand, this test is not broken. It just means it is no longer testing
+; for the original bug.
+
+; GCN: {{^}}test:
+; GCN: flat_store_dword v[{{[0-9]+:[0-9]+}}], [[DATA:v[0-9]+]]
+; GCN: s_waitcnt vmcnt(0) lgkmcnt(0)
+; GCN: flat_load_dword [[DATA]], v[{{[0-9]+:[0-9]+}}]
+define void @test(i32 addrspace(1)* %out, i32 %in) {
+ store volatile i32 0, i32 addrspace(1)* %out
+ %val = load volatile i32, i32 addrspace(1)* %out
+ ret void
+}
OpenPOWER on IntegriCloud