[llvm] [SystemZ] Eliminate call sequence instructions early. (PR #77812)

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 08:02:10 PST 2024


JonPsson1 wrote:

> This seems like an extreme measure to fix the reported issue. We're just missing a helper function to preserve the frame size attributes during a block size split? Seems easier to keep the call frame handling in line with other targets instead of doing something different

I agree it would solve the current issue fairly well to add a helper function in MachineBasicBlock that would do this. But on the other hand, I wonder if it's only x86 primarily that needs the CALLSEQ pseudos around to do SP adjustments around each call. If that's the case, maybe the default should actually be to compute the MaxCallFrameSize during instruction selection? One step in that direction then, would be to eliminate them during finalize-isel for SystemZ.

I have found myself the Frame Lowering to be quite complex to work with and it doesn't help to have those pseudos around. It's confusing that they are emitted and then used not until PEI to compute this value looking at all the calls, when in fact that is something known already during isel. And adding to this by worrying about preserving this value across MBBs is making things even worse...

So this is not only to fix the issue, but also a nice cleanup of the SystemZ backend, I think. Does this make sense?


https://github.com/llvm/llvm-project/pull/77812


More information about the llvm-commits mailing list