[all-commits] [llvm/llvm-project] e6e62e: [RS4GC] Copy argument attributes from call to stat...

Markus Böck via All-commits all-commits at lists.llvm.org
Mon Oct 16 14:24:00 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e6e62efa880e7afe8a054f24857d1b64b8567767
      https://github.com/llvm/llvm-project/commit/e6e62efa880e7afe8a054f24857d1b64b8567767
  Author: Markus Böck <markus.boeck02 at gmail.com>
  Date:   2023-10-16 (Mon, 16 Oct 2023)

  Changed paths:
    M llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
    A llvm/test/Transforms/RewriteStatepointsForGC/call-argument-attributes.ll

  Log Message:
  -----------
  [RS4GC] Copy argument attributes from call to statepoint (#68475)

The current implementation completely ignores argument attributes on
calls, discarding them completely when creating a statepoint from a call
instruction. This is problematic in some scenarios as the argument
attributes affect the ABI of the call, leading to undefined behavior if
called with the wrong ABI attributes. Note that this cannot be solved
either by just having the function declaration annotated with the right
parameter attributes as the call might be indirect, therefore requiring
them to be present on the arguments.

This PR simply copies all parameter attributes over from the original
call to the created statepoint.
Note that some argument attributes become invalid after the lowering as
they imply memory effects that no longer hold with the statepoints.
These do not need to be explicitly handled in this PR as they are
removed by the `stripNonValidDataFromBody`.




More information about the All-commits mailing list