This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Generate literals by the little end
ClosedPublic

Authored by evandro on Jan 13 2017, 1:36 PM.

Details

Summary

ARM seems to prefer that long literals be formed from their little end (v. "Cortex A57 Software Optimisation Guide", section 4.14).

This also promotes fusion of literal generation using the instrs pairs MOV/MOVK and MOVK/MOVK on Cortex A57 and others.

Diff Detail

Repository
rL LLVM

Event Timeline

evandro updated this revision to Diff 84364.Jan 13 2017, 1:36 PM
evandro retitled this revision from to [AArch64] Generate literals by the little end.
evandro updated this object.
evandro added reviewers: t.p.northover, jmolloy.
evandro set the repository for this revision to rL LLVM.
evandro added subscribers: llvm-commits, MatzeB, mssimpso and 2 others.

Hi Evandro,

Isn't this specific to A57 (as in D28698)? Do you have any data that this will perform equally or better on the other AArch64 cores, too?

Also, the commit message could be improved by mentioning why "ARM seems to prefer that long literals be formed from their little end.", ie. a reference to the A57 manual.

cheers,
--renato

Hi, @rengolin .

Isn't this specific to A57 (as in D28698)? Do you have any data that this will perform equally or better on the other AArch64 cores, too?

D28698 needs this change, but I think that it makes more sense to have both patches separated.

Unfortunately, I don't have access to other targets. On A57, which may fuse the resulting instr sequence, benefits from this change. On the only other target that I have access to, the M1, which doesn't fuse literals generation, this change was a wash.

Also, the commit message could be improved by mentioning why "ARM seems to prefer that long literals be formed from their little end.", ie. a reference to the A57 manual.

OK

evandro edited the summary of this revision. (Show Details)Jan 17 2017, 8:19 AM
evandro added a subscriber: pgode.Jan 17 2017, 8:31 AM

Ok, I'm adding Kristof to check the other cores' behaviour.

kristof.beyls edited edge metadata.Jan 18 2017, 7:59 AM

Ok, I'm adding Kristof to check the other cores' behaviour.

For the cores for which I know the answer, this change is either beneficial or neutral.
In other words, the code generation change in this patch is OK from my perspective.

rengolin accepted this revision.Jan 18 2017, 8:12 AM

Thanks Kristof! I can't see any problem either. LGTM. Thanks!

This revision is now accepted and ready to land.Jan 18 2017, 8:12 AM
This revision was automatically updated to reflect the committed changes.