[all-commits] [llvm/llvm-project] e3f218: [ARM] Re-generate a test

Oliver Stannard via All-commits all-commits at lists.llvm.org
Fri Oct 25 01:35:08 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e3f218096ca31863cc245fdd411f0b6e5cbfb1cb
      https://github.com/llvm/llvm-project/commit/e3f218096ca31863cc245fdd411f0b6e5cbfb1cb
  Author: Oliver Stannard <oliver.stannard at arm.com>
  Date:   2024-10-25 (Fri, 25 Oct 2024)

  Changed paths:
    M llvm/test/CodeGen/ARM/fp-arg-shuffle.ll

  Log Message:
  -----------
  [ARM] Re-generate a test


  Commit: 8e289e4fa60eb59fc12c39b88987d4956c1d38ea
      https://github.com/llvm/llvm-project/commit/8e289e4fa60eb59fc12c39b88987d4956c1d38ea
  Author: Oliver Stannard <oliver.stannard at arm.com>
  Date:   2024-10-25 (Fri, 25 Oct 2024)

  Changed paths:
    M llvm/lib/Target/ARM/ARMISelLowering.cpp

  Log Message:
  -----------
  [ARM] Fix comment typo


  Commit: 246baeb5fe7d9176f3bc143ab8abe9199a8636f4
      https://github.com/llvm/llvm-project/commit/246baeb5fe7d9176f3bc143ab8abe9199a8636f4
  Author: Oliver Stannard <oliver.stannard at arm.com>
  Date:   2024-10-25 (Fri, 25 Oct 2024)

  Changed paths:
    M llvm/lib/Target/ARM/ARMISelLowering.cpp

  Log Message:
  -----------
  [ARM] Add debug trace for tail-call optimisation

There are lots of reasons a call might not be eligible for tail-call
optimisation, this adds debug trace to help understand the compiler's
decisions here.


  Commit: c1eb790cd2f2a3fd48781167b50f091c0d20be8d
      https://github.com/llvm/llvm-project/commit/c1eb790cd2f2a3fd48781167b50f091c0d20be8d
  Author: Oliver Stannard <oliver.stannard at arm.com>
  Date:   2024-10-25 (Fri, 25 Oct 2024)

  Changed paths:
    M llvm/lib/Target/ARM/ARMISelLowering.cpp
    M llvm/test/CodeGen/ARM/fp-arg-shuffle.ll
    M llvm/test/CodeGen/ARM/fp16-vector-argument.ll
    A llvm/test/CodeGen/ARM/musttail.ll

  Log Message:
  -----------
  [ARM] Tail-calls do not require caller and callee arguments to match

The ARM backend was checking that the outgoing values for a tail-call
matched the incoming argument values of the caller. This isn't
necessary, because the caller can change the values in both registers
and the stack before doing the tail-call. The actual limitation is that
the callee can't need more stack space for it's arguments than the
caller does.

This is needed for code using the musttail attribute, as well as
enabling tail calls as an optimisation in more cases.


  Commit: 82e64721974b1ed9b112ca98466fa29d21dffc33
      https://github.com/llvm/llvm-project/commit/82e64721974b1ed9b112ca98466fa29d21dffc33
  Author: Oliver Stannard <oliver.stannard at arm.com>
  Date:   2024-10-25 (Fri, 25 Oct 2024)

  Changed paths:
    M llvm/lib/Target/ARM/ARMISelLowering.cpp
    M llvm/test/CodeGen/ARM/musttail.ll

  Log Message:
  -----------
  [ARM] Allow functions with sret returns to be tail-called

It is valid to tail-call a function which returns through an sret
argument, as long as we have an incoming sret pointer to pass on.


  Commit: 78ec2e2ed5e3dc61339b51f9d614029314a42005
      https://github.com/llvm/llvm-project/commit/78ec2e2ed5e3dc61339b51f9d614029314a42005
  Author: Oliver Stannard <oliver.stannard at arm.com>
  Date:   2024-10-25 (Fri, 25 Oct 2024)

  Changed paths:
    M llvm/lib/Target/ARM/ARMISelLowering.cpp
    M llvm/test/CodeGen/ARM/2013-05-13-AAPCS-byval-padding.ll
    M llvm/test/CodeGen/ARM/2013-05-13-AAPCS-byval-padding2.ll
    M llvm/test/CodeGen/ARM/musttail.ll

  Log Message:
  -----------
  [ARM] Allow tail calls with byval args

Byval arguments which are passed partially in registers get stored into
the local stack frame, but it is valid to tail-call them because the
part which gets spilled is always re-loaded into registers before doing
the tail-call, so it's OK for the spill area to be deallocated.


  Commit: a96c14eeb8fcb1a141c0f55ed5d28dd7f1f3e38e
      https://github.com/llvm/llvm-project/commit/a96c14eeb8fcb1a141c0f55ed5d28dd7f1f3e38e
  Author: Kiran <kiran.sturt at arm.com>
  Date:   2024-10-25 (Fri, 25 Oct 2024)

  Changed paths:
    M clang/lib/CodeGen/CGCall.cpp
    A clang/test/CodeGen/musttail-sret.cpp

  Log Message:
  -----------
  [Clang] Always forward sret parameters to musttail calls

If a call using the musttail attribute returns it's value through an
sret argument pointer, we must forward an incoming sret pointer to it,
instead of creating a new alloca. This is always possible because the
musttail attribute requires the caller and callee to have the same
argument and return types.


  Commit: 914a3990d1a055f5f1848c6979f621ceff97fa7c
      https://github.com/llvm/llvm-project/commit/914a3990d1a055f5f1848c6979f621ceff97fa7c
  Author: Oliver Stannard <oliver.stannard at arm.com>
  Date:   2024-10-25 (Fri, 25 Oct 2024)

  Changed paths:
    M llvm/lib/Target/ARM/ARMISelLowering.cpp
    M llvm/test/CodeGen/ARM/musttail.ll

  Log Message:
  -----------
  [ARM] Avoid clobbering byval arguments when passing to tail-calls

When passing byval arguments to tail-calls, we need to store them into
the stack memory in which this the caller received it's arguments. If
any of the outgoing arguments are forwarded from incoming byval
arguments, then the source of the copy is from the same stack memory.
This can result in the copy corrupting a value which is still to be
read.

The fix is to first make a copy of the outgoing byval arguments in local
stack space, and then copy them to their final location. This fixes the
correctness issue, but results in extra copying, which could be
optimised.


  Commit: 376d7b27fa3de4f72c2a3cec4f941c1ca3f1d7f2
      https://github.com/llvm/llvm-project/commit/376d7b27fa3de4f72c2a3cec4f941c1ca3f1d7f2
  Author: Oliver Stannard <oliver.stannard at arm.com>
  Date:   2024-10-25 (Fri, 25 Oct 2024)

  Changed paths:
    M llvm/lib/Target/ARM/ARMISelLowering.cpp
    M llvm/lib/Target/ARM/ARMISelLowering.h
    M llvm/test/CodeGen/ARM/musttail.ll

  Log Message:
  -----------
  [ARM] Optimise byval arguments in tail-calls

We don't need to copy byval arguments to tail calls via a temporary, if
we can prove that we are not copying from the outgoing argument area.
This patch does this when the source if the argument is one of:
* Memory in the local stack frame, which can't be used for tail-call
  arguments.
* A global variable.

We can also avoid doing the copy completely if the source and
destination are the same memory location, which is the case when the
caller and callee have the same signature, and pass some arguments
through unmodified.


Compare: https://github.com/llvm/llvm-project/compare/e738a5d8e339...376d7b27fa3d

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list