[PATCH] D123394: [CodeGen] Late cleanup of redundant address/immediate definitions.
Jonas Paulsson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 19 09:50:06 PDT 2022
jonpa added a comment.
In D123394#3439949 <https://reviews.llvm.org/D123394#3439949>, @efriedma wrote:
> Have you compared your approach to LocalStackSlotAllocation? That's doing something sort of similar, but earlier in the pass pipeline. Not sure if that covers exactly the same cases as this patch.
Thanks for pointing out LocalStackSlotAllocation - I had not tried that before. What I saw in my experiments with it on SystemZ is that:
1. It is only handling local variables - spill slots are not yet allocated as this is pre-RA.
2. On SystemZ different instructions on SystemZ have different offset ranges: Some instructions can handle a 20-bit signed offfset range while others only have unsigned 12-bits. orderFrameObjects() sorts the frame objects after looking at the users to try to eliminate the need to load the offset into a register. LocalStackSlotAllocation does not consider this at all but merely computes offsets to objects in the given order.
I saw cases actually getting worse with this which I think relates to #2 above (at least in the test case I analyzed), which makes me skeptical to enabling it on SystemZ.
In case it's of any interest, here is my little experimental patch enabling this on SystemZ: F22818303: VirtBaseRegs.patch <https://reviews.llvm.org/F22818303>
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123394/new/
https://reviews.llvm.org/D123394
More information about the llvm-commits
mailing list