RFR: Implement better address lowering for AArch64
adinn at redhat.com
Mon Apr 3 11:37:34 UTC 2017
The following pull request includes changes to improve address lowering
I would be grateful for review and feedback and, if acceptbale, a pull
to the main repo.
The point of this change is to allow AArch64 addresses to be converted
to use either index or displacement mode (n.b. index and displacement
cannot be combined on AArch64). This requires a different approach to
AMD64/SPARC because the suitability of a displacement for embedding in a
load/store instruction depends on the nature of that usage
(specifically, the transfer size for the datum affects the decision as
to whether a given displacement can be embedded).
A secondary part of the change is to implement address improvement
during lowering to allow certain patterns of address combination to be
The basic change is to provide a new phase AddressLoweringByUsePhase
which schedules addresses to an address lowering implementation per use,
providing it with the ability to take the use into account when doing
AArch64 provides a callback class AArch64AddressLoweringByUse which
implements this phase. This replaces the previous lowering callback
AArch64AddressLowering which has been deleted. It includes optimization
of certain nested address combinations as per the other address lowering
implementations (there are less such opportunities for AArch64).
Making use of the new phase also requires modifying the
HotSpotSuiteProvider classes which previously configured the
AddressLoweringPhase used by AMD64, SPARC and AArch64.
A superclass HotSpotSuiteProviderBase has been factored out of the
original class HotSpotSuiteProvider making it a subclass specific to
AMD64 and SPARC. An alternative subclass, AArch64HotSpotSuiteProvider,
has been provided for AArch64. The two subclasses perform almost all
their work by delegating to the super class. They only differ in how
they configure address lowering. The step which previously added an
AddressLoweringPhase to the low tier is now performed in each subclass.
HotSpotSuiteProvider configures an AddressLoweringPhase while
AArch64HotSpotSuiteProvider configures an AddressLoweringByUsePhase.
I have run several small Java programs. I have eyeballed the generated
code for these programs and for JDK runtime methods to verify that
address lowering is being done correctly.
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander
More information about the graal-dev