diff options
| author | Tom Stellard <thomas.stellard@amd.com> | 2014-05-15 14:41:54 +0000 |
|---|---|---|
| committer | Tom Stellard <thomas.stellard@amd.com> | 2014-05-15 14:41:54 +0000 |
| commit | 73b98ed8cf2a05e2aabd55eaf1462d981788a955 (patch) | |
| tree | d4fdf565259b317cc891cd7b85a2cb44d2f0ef2e /llvm/test | |
| parent | 365a2b49f2ef8c1c946ef3d4cde8db82c04a5c96 (diff) | |
| download | bcm5719-llvm-73b98ed8cf2a05e2aabd55eaf1462d981788a955.tar.gz bcm5719-llvm-73b98ed8cf2a05e2aabd55eaf1462d981788a955.zip | |
R600/SI: Only use SALU instructions for 64-bit add in a block of CF depth 0
llvm-svn: 208886
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/R600/add.ll | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/R600/add.ll b/llvm/test/CodeGen/R600/add.ll index e9db52ae4ae..711a2bc4177 100644 --- a/llvm/test/CodeGen/R600/add.ll +++ b/llvm/test/CodeGen/R600/add.ll @@ -140,3 +140,28 @@ entry: store i64 %1, i64 addrspace(1)* %out ret void } + +; Test i64 add inside a branch. We don't allow SALU instructions inside of +; branches. +; FIXME: We are being conservative here. We could allow this in some cases. +; FUNC-LABEL: @add64_in_branch +; SI-CHECK-NOT: S_ADD_I32 +; SI-CHECK-NOT: S_ADDC_U32 +define void @add64_in_branch(i64 addrspace(1)* %out, i64 addrspace(1)* %in, i64 %a, i64 %b, i64 %c) { +entry: + %0 = icmp eq i64 %a, 0 + br i1 %0, label %if, label %else + +if: + %1 = load i64 addrspace(1)* %in + br label %endif + +else: + %2 = add i64 %a, %b + br label %endif + +endif: + %3 = phi i64 [%1, %if], [%2, %else] + store i64 %3, i64 addrspace(1)* %out + ret void +} |

