diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-11-27 19:40:37 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-11-27 19:40:37 +0000 |
commit | 3a1e76d62706f2773c23a684446b4c549c151669 (patch) | |
tree | b3f9e6ce42c4c9dcf99a9fb3b6f2bf5ae2026aae /test/CodeGen/SPARC | |
parent | 1cefde83ffcfe869e86ef1976667f47856087dd3 (diff) | |
download | external_llvm-3a1e76d62706f2773c23a684446b4c549c151669.zip external_llvm-3a1e76d62706f2773c23a684446b4c549c151669.tar.gz external_llvm-3a1e76d62706f2773c23a684446b4c549c151669.tar.bz2 |
Merging r195576:
------------------------------------------------------------------------
r195576 | venkatra | 2013-11-24 12:23:25 -0800 (Sun, 24 Nov 2013) | 2 lines
[Sparc] Emit large negative adjustments to SP/FP with sethi+xor instead of sethi+or. This generates correct code for both sparc32 and sparc64.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@195870 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/SPARC')
-rw-r--r-- | test/CodeGen/SPARC/64abi.ll | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/CodeGen/SPARC/64abi.ll b/test/CodeGen/SPARC/64abi.ll index 8a5c996..8b752a1 100644 --- a/test/CodeGen/SPARC/64abi.ll +++ b/test/CodeGen/SPARC/64abi.ll @@ -390,3 +390,24 @@ entry: %2 = add nsw i32 %0, %1 ret i32 %2 } + +; CHECK-LABEL: test_large_stack + +; CHECK: sethi 16, %g1 +; CHECK: xor %g1, -176, %g1 +; CHECK: save %sp, %g1, %sp + +; CHECK: sethi 14, %g1 +; CHECK: xor %g1, -1, %g1 +; CHECK: add %g1, %fp, %g1 +; CHECK: call use_buf + +define i32 @test_large_stack() { +entry: + %buffer1 = alloca [16384 x i8], align 8 + %buffer1.sub = getelementptr inbounds [16384 x i8]* %buffer1, i32 0, i32 0 + %0 = call i32 @use_buf(i32 16384, i8* %buffer1.sub) + ret i32 %0 +} + +declare i32 @use_buf(i32, i8*) |