This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Select XRO addressing mode with wide immediates
ClosedPublic

Authored by paquette on Jul 28 2020, 11:48 AM.

Details

Summary

Port the wide immediate case from AArch64DAGToDAGISel::SelectAddrModeXRO.

If we have a wide immediate which can't be represented in an add, we can end up with code like this:

mov  x0, imm
add x1, base, x0
ldr  x2, [x1, 0]

If we use the [base, xN] addressing mode instead, we can produce this:

mov  x0, imm
ldr  x2, [base, x0]

This saves 0.4% code size on 7zip at -O3, and gives a geomean code size improvement of 0.1% on CTMark.

Diff Detail

Event Timeline

paquette created this revision.Jul 28 2020, 11:48 AM
paquette requested review of this revision.Jul 28 2020, 11:48 AM
aemerson accepted this revision.Jul 29 2020, 9:37 AM

LGTM. Nice improvements.

This revision is now accepted and ready to land.Jul 29 2020, 9:37 AM