While working on #5283 I noticed x86 and Z are the only platforms where we set:
self()->setSupportsCompactedLocals();
This means compact locals is only enabled on those two platforms. Taking a closer look at things it seems the Z support only lives in OpenJ9 [1] which is also a problem. More generally, local compaction doesn't really have to have any real codegen support as the optimization which computes the interference graph is a common opt. The codegen consumes the interference graph and uses the computed graph colors to map locals to stack offsets.
This entire operation should be codegen agnostic, and indeed looking at the x86 and Z implementations of mapCompactedStack [2] [3] we can see that most (all?) of the code can be shared. As part of this task we should do the following:
Sink the Z local compaction from OpenJ9 into OMR
Common the x86 and Z implementations of mapping the compacted stack
While working on #5283 I noticed x86 and Z are the only platforms where we set:
This means compact locals is only enabled on those two platforms. Taking a closer look at things it seems the Z support only lives in OpenJ9 [1] which is also a problem. More generally, local compaction doesn't really have to have any real codegen support as the optimization which computes the interference graph is a common opt. The codegen consumes the interference graph and uses the computed graph colors to map locals to stack offsets.
This entire operation should be codegen agnostic, and indeed looking at the x86 and Z implementations of
mapCompactedStack
[2] [3] we can see that most (all?) of the code can be shared. As part of this task we should do the following:[1] https://github.com/eclipse/openj9/blob/dc9a6dd43cf060b3ad3e34eb6490570723deb718/runtime/compiler/z/codegen/J9CodeGenerator.cpp#L127-L129 [2] https://github.com/eclipse/omr/blob/77c5c5b76ea1c7685979c5a9b1ee45ad58dca889/compiler/x/codegen/OMRLinkage.cpp#L83-L332 [3] https://github.com/eclipse/openj9/blob/dc9a6dd43cf060b3ad3e34eb6490570723deb718/runtime/compiler/z/codegen/S390PrivateLinkage.cpp#L247-L634