Context
This diff 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.
Changes
The code change is small and consists only of moving one stanza of code-generation to occur earlier than another; no change is made to the substance of that code. Doing so entails a change to several GISel tests for AArch64; I verified by hand that all of these were simple reorderings and that no changes to instruction bodies were required to get the tests to pass.
Review
This is my first patch to LLVM of any kind and I'm sure that I will probably have missed something in the process. Some questions I have:
- Where is best to add a regression test for the issue I linked to above?
- Are there other related places I should have changed similar code, that my test didn't trigger?
If the approach or changes made in this PR are manifestly wrong, please feel free to reject them quickly! Thanks for your time spent addressing this diff.