diff options
| author | Oliver Stannard <oliver.stannard@linaro.org> | 2019-08-02 10:23:17 +0000 |
|---|---|---|
| committer | Oliver Stannard <oliver.stannard@linaro.org> | 2019-08-02 10:23:17 +0000 |
| commit | 4b7239ebaca72f2cd92682019fbe0bef5b46cd4e (patch) | |
| tree | 9e69d9d57dd2290f21ab73a63cf156a676e4cf36 /llvm/test | |
| parent | f6b00c279a5587a25876752a6ecd8da0bed959dc (diff) | |
| download | bcm5719-llvm-4b7239ebaca72f2cd92682019fbe0bef5b46cd4e.tar.gz bcm5719-llvm-4b7239ebaca72f2cd92682019fbe0bef5b46cd4e.zip | |
[IPRA][ARM] Disable no-CSR optimisation for ARM
This optimisation isn't generally profitable for ARM, because we can
save/restore many registers in the prologue and epilogue using the PUSH
and POP instructions, but mostly use individual LDR/STR instructions for
other spills.
Differential revision: https://reviews.llvm.org/D64910
llvm-svn: 367670
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/ARM/ipra-no-csr.ll | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/ipra-no-csr.ll b/llvm/test/CodeGen/ARM/ipra-no-csr.ll new file mode 100644 index 00000000000..8070573fbc0 --- /dev/null +++ b/llvm/test/CodeGen/ARM/ipra-no-csr.ll @@ -0,0 +1,22 @@ +; RUN: llc -mtriple armv7a--none-eabi < %s | FileCheck %s +; RUN: llc -mtriple armv7a--none-eabi < %s -enable-ipra | FileCheck %s + +; Other targets disable callee-saved registers for internal functions when +; using IPRA, but that isn't profitable for ARM because the PUSH/POP +; instructions can more efficiently save registers than using individual +; LDR/STRs in the caller. + +define internal void @callee() norecurse { +; CHECK-LABEL: callee: +entry: +; CHECK: push {r4, lr} +; CHECK: pop {r4, pc} + tail call void asm sideeffect "", "~{r4}"() + ret void +} + +define void @caller() { +entry: + call void @callee() + ret void +} |

