From 6cadd406ccbf4ea0fa8b7fc31b094eeb3db979fb Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 7 Mar 2014 20:12:39 +0000 Subject: R600/SI: Using SGPRs is illegal for instructions that read carry-out from VCC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Michel Dänzer git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203281 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/R600/add.ll | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test') diff --git a/test/CodeGen/R600/add.ll b/test/CodeGen/R600/add.ll index 600419cd16..e9db52ae4a 100644 --- a/test/CodeGen/R600/add.ll +++ b/test/CodeGen/R600/add.ll @@ -125,3 +125,18 @@ entry: store i64 %0, i64 addrspace(1)* %out ret void } + +; The V_ADDC_U32 and V_ADD_I32 instruction can't read SGPRs, because they +; use VCC. The test is designed so that %a will be stored in an SGPR and +; %0 will be stored in a VGPR, so the comiler will be forced to copy %a +; to a VGPR before doing the add. + +; FUNC-LABEL: @add64_sgpr_vgpr +; SI-CHECK-NOT: V_ADDC_U32_e32 s +define void @add64_sgpr_vgpr(i64 addrspace(1)* %out, i64 %a, i64 addrspace(1)* %in) { +entry: + %0 = load i64 addrspace(1)* %in + %1 = add i64 %a, %0 + store i64 %1, i64 addrspace(1)* %out + ret void +} -- cgit v1.2.3