diff options
| author | Martin Storsjo <martin@martin.st> | 2018-03-19 20:06:50 +0000 |
|---|---|---|
| committer | Martin Storsjo <martin@martin.st> | 2018-03-19 20:06:50 +0000 |
| commit | 9a55c1b0dce1b0f03742ceea8292dcdcdcd37509 (patch) | |
| tree | 6ba91e0a7190274e86b3da0126c9951d00918d2f /llvm/test/CodeGen/ARM | |
| parent | eccd8ac7d825ed8f14f191a8de1d326dc7304beb (diff) | |
| download | bcm5719-llvm-9a55c1b0dce1b0f03742ceea8292dcdcdcd37509.tar.gz bcm5719-llvm-9a55c1b0dce1b0f03742ceea8292dcdcdcd37509.zip | |
[ARM, AArch64] Check the no-stack-arg-probe attribute for dynamic stack probes
This extends the use of this attribute on ARM and AArch64 from
SVN r325900 (where it was only checked for fixed stack
allocations on ARM/AArch64, but for all stack allocations on X86).
This also adds a testcase for the existing use of disabling the
fixed stack probe with the attribute on ARM and AArch64.
Differential Revision: https://reviews.llvm.org/D44291
llvm-svn: 327897
Diffstat (limited to 'llvm/test/CodeGen/ARM')
| -rw-r--r-- | llvm/test/CodeGen/ARM/Windows/alloca-no-stack-arg-probe.ll | 21 | ||||
| -rw-r--r-- | llvm/test/CodeGen/ARM/Windows/chkstk-no-stack-arg-probe.ll | 12 |
2 files changed, 33 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/Windows/alloca-no-stack-arg-probe.ll b/llvm/test/CodeGen/ARM/Windows/alloca-no-stack-arg-probe.ll new file mode 100644 index 00000000000..a1dce7fd4a3 --- /dev/null +++ b/llvm/test/CodeGen/ARM/Windows/alloca-no-stack-arg-probe.ll @@ -0,0 +1,21 @@ +; RUN: llc -mtriple thumbv7-windows -filetype asm -o - %s | FileCheck %s + +declare arm_aapcs_vfpcc i32 @num_entries() + +define arm_aapcs_vfpcc void @test___builtin_alloca() "no-stack-arg-probe" { +entry: + %array = alloca i8*, align 4 + %call = call arm_aapcs_vfpcc i32 @num_entries() + %mul = mul i32 4, %call + %0 = alloca i8, i32 %mul + store i8* %0, i8** %array, align 4 + ret void +} + +; CHECK: bl num_entries +; CHECK: movs [[R1:r[0-9]+]], #7 +; CHECK: add.w [[R0:r[0-9]+]], [[R1]], [[R0]], lsl #2 +; CHECK: bic [[R0]], [[R0]], #7 +; CHECK-NOT: bl __chkstk +; CHECK: sub.w [[R0]], sp, [[R0]] +; CHECK: mov sp, [[R0]] diff --git a/llvm/test/CodeGen/ARM/Windows/chkstk-no-stack-arg-probe.ll b/llvm/test/CodeGen/ARM/Windows/chkstk-no-stack-arg-probe.ll new file mode 100644 index 00000000000..a2a3bf0df88 --- /dev/null +++ b/llvm/test/CodeGen/ARM/Windows/chkstk-no-stack-arg-probe.ll @@ -0,0 +1,12 @@ +; RUN: llc -mtriple=thumbv7-windows -verify-machineinstrs %s -o - \ +; RUN: | FileCheck %s + +define arm_aapcs_vfpcc void @check_watermark() "no-stack-arg-probe" { +entry: + %buffer = alloca [4096 x i8], align 1 + ret void +} + +; CHECK: check_watermark: +; CHECK-NOT: bl __chkstk +; CHECK: sub.w sp, sp, #4096 |

