[AArch64][GlobalISel] Reorder stack up-adjustment and register copies
authorAmara Emerson <amara@apple.com>
Mon, 27 Feb 2023 19:02:37 +0000 (11:02 -0800)
committerAmara Emerson <amara@apple.com>
Mon, 27 Feb 2023 19:24:24 +0000 (11:24 -0800)
commit31d6a572579a5d1d9ae14a1a9d4ffbdb1b098e49
tree5b81f6dca231710da8c3a982e7006b83c18c26e9
parent06daa515b27029885826833a5626937355abc4a1
[AArch64][GlobalISel] Reorder stack up-adjustment and register copies

This change reorders the stack up-adjustment and return value copying phases of
machine-ir generation on Aarch64. Doing so prevents a bug observed for fastcc
calls with >8 arguments, where the up-adjustment required from making that call
is placed in the wrong place relative to spill and reloading code.

See: https://github.com/llvm/llvm-project/issues/60972 for full issue
reproduction and context.

Patch contributed by Bruce Collie

Differential Revision: https://reviews.llvm.org/D144791
24 files changed:
llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
llvm/test/CodeGen/AArch64/GlobalISel/arm64-callingconv-ios.ll
llvm/test/CodeGen/AArch64/GlobalISel/arm64-callingconv.ll
llvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator-switch.ll
llvm/test/CodeGen/AArch64/GlobalISel/call-lowering-signext.ll
llvm/test/CodeGen/AArch64/GlobalISel/call-lowering-vectors.ll
llvm/test/CodeGen/AArch64/GlobalISel/call-lowering-zeroext.ll
llvm/test/CodeGen/AArch64/GlobalISel/call-translator-tail-call.ll
llvm/test/CodeGen/AArch64/GlobalISel/call-translator.ll
llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll
llvm/test/CodeGen/AArch64/GlobalISel/legalize-cos.mir
llvm/test/CodeGen/AArch64/GlobalISel/legalize-exp.mir
llvm/test/CodeGen/AArch64/GlobalISel/legalize-fexp2.mir
llvm/test/CodeGen/AArch64/GlobalISel/legalize-fmaxnum.mir
llvm/test/CodeGen/AArch64/GlobalISel/legalize-fminnum.mir
llvm/test/CodeGen/AArch64/GlobalISel/legalize-log.mir
llvm/test/CodeGen/AArch64/GlobalISel/legalize-log10.mir
llvm/test/CodeGen/AArch64/GlobalISel/legalize-log2.mir
llvm/test/CodeGen/AArch64/GlobalISel/legalize-pow.mir
llvm/test/CodeGen/AArch64/GlobalISel/legalize-rem.mir
llvm/test/CodeGen/AArch64/GlobalISel/legalize-s128-div.mir
llvm/test/CodeGen/AArch64/GlobalISel/legalize-sin.mir
llvm/test/CodeGen/AArch64/aarch64-fastcc-stackup.ll [new file with mode: 0644]
llvm/test/CodeGen/AArch64/arm64-this-return.ll