[PATCH] D29020: [ARM] Change TCReturn to tBL if tailcall optimization fails.

Oliver Stannard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 1 05:39:27 PST 2017


olista01 added a comment.

There's a big comment in ARMSubtarget.cpp (line ~200) explaining the problem with being unable to pop back into LR, but it seems to have fallen out of sync with the code because it claims that we don't do this optimisation. Could you update that comment to match the code?



================
Comment at: test/CodeGen/ARM/v8m-tail-call.ll:3
+
+define i32 @test(i32 %Enum_Val_Par, i32* nocapture %Enum_Ref_Par) {
+entry:
----------------
I think these tests can be greatly simplified. For the first test case, this reproduces the bug:

  define void @test() {
  ; CHECK-LABEL: test:
  entry:
    %call = tail call i32 @foo()
    %tail = tail call i32 @foo()
    ret void
  ; CHECK: bl foo
  ; CHECK: bl foo
  ; CHECK-NOT: b foo
  }
  declare i32 @foo()

There should also be CHECK-LABELs for each of the test functions.


https://reviews.llvm.org/D29020





More information about the llvm-commits mailing list