[AArch64][GlobalISel] Fix incorrect ABI when tail call not supported (#70215)
commit292f34b0d3cb2a04be5ebb85aaeb838b29f71323
authorNikita Popov <npopov@redhat.com>
Mon, 30 Oct 2023 14:01:01 +0000 (30 15:01 +0100)
committerGitHub <noreply@github.com>
Mon, 30 Oct 2023 14:01:01 +0000 (30 15:01 +0100)
tree5f465f63b01af6c693b15b2441598744594c0dd6
parent43a94cbafae13780f67ec4adac2a48863468671b
[AArch64][GlobalISel] Fix incorrect ABI when tail call not supported (#70215)

The check for whether a tail call is supported calls
determineAssignments(), which may modify argument flags. As such, even
though the check fails and a non-tail call will be emitted, it will not
have a different (incorrect) ABI.

Fix this by operating on a separate copy of the arguments.

Fixes https://github.com/llvm/llvm-project/issues/70207.
llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
llvm/test/CodeGen/AArch64/GlobalISel/call-lowering-tail-call-fallback.ll