diff options
| author | Reid Kleckner <rnk@google.com> | 2019-12-02 16:42:33 -0800 |
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2020-01-03 11:27:41 -0800 |
| commit | 9c2b72821be64db7795dd18586c2ae7edb905c21 (patch) | |
| tree | f80ab96f0c8ee84a36f5a08399f5ed73c2d07e9f /llvm/test/CodeGen/RISCV | |
| parent | e5a56f2d50ce1939eba4fddbeb9c8e032db4fc95 (diff) | |
| download | bcm5719-llvm-9c2b72821be64db7795dd18586c2ae7edb905c21.tar.gz bcm5719-llvm-9c2b72821be64db7795dd18586c2ae7edb905c21.zip | |
Move tail call disabling code to target independent code
When the "disable-tail-calls" attribute was added, checks were added for
it in various backends. Now this code has proliferated, and it is
something the target is responsible for checking. Move that
responsibility back to the ISels (fast, global, and SD).
There's no major functionality change, except for targets that never
implemented this check.
This LLVM attribute was originally added in
d9699bc7bdf0362173fcd256690f61a4d47429c2 (2015).
Reviewers: echristo, MaskRay
Differential Revision: https://reviews.llvm.org/D72118
Diffstat (limited to 'llvm/test/CodeGen/RISCV')
| -rw-r--r-- | llvm/test/CodeGen/RISCV/tail-calls.ll | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/RISCV/tail-calls.ll b/llvm/test/CodeGen/RISCV/tail-calls.ll index 30e530b5116..14af16ed3c8 100644 --- a/llvm/test/CodeGen/RISCV/tail-calls.ll +++ b/llvm/test/CodeGen/RISCV/tail-calls.ll @@ -158,6 +158,16 @@ entry: ret void } +; Do not tail call optimize if disabled. +define i32 @disable_tail_calls(i32 %i) nounwind "disable-tail-calls"="true" { +; CHECK-LABEL: disable_tail_calls: +; CHECK-NOT: tail callee_nostruct +; CHECK: call callee_tail +entry: + %rv = tail call i32 @callee_tail(i32 %i) + ret i32 %rv +} + !llvm.module.flags = !{!0} !0 = !{i32 1, !"ProfileSummary", !1} !1 = !{!2, !3, !4, !5, !6, !7, !8, !9} |

