[AArch64][GlobalISel] Fix incorrect ABI when tail call not supported (#70215)llvmorg-17.0.4
commit309d55140c46384b6de7a7573206cbeba3f7077f
authorNikita Popov <npopov@redhat.com>
Mon, 30 Oct 2023 14:01:01 +0000 (30 15:01 +0100)
committerTobias Hieta <tobias@hieta.se>
Tue, 31 Oct 2023 08:00:30 +0000 (31 09:00 +0100)
tree237eea05c51c2e4dde10e9673da8d66d0b4f42eb
parent9477268e4247c7689b8252659151837f9e11b9d0
[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.

(cherry picked from commit 292f34b0d3cb2a04be5ebb85aaeb838b29f71323)
llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
llvm/test/CodeGen/AArch64/GlobalISel/call-lowering-tail-call-fallback.ll