This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Set MaxBytesForLoopAlignment for more targets
ClosedPublic

Authored by NickGuy on Mar 28 2022, 2:29 AM.

Details

Summary

Further implementation of D114590 for the AArch64 backend. Specifying the max padding allowed for loop alignment for further AArch64 targets.

Diff Detail

Event Timeline

NickGuy created this revision.Mar 28 2022, 2:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2022, 2:29 AM
NickGuy requested review of this revision.Mar 28 2022, 2:29 AM

Adding a MaxBytesForLoopAlignment without a PrefLoopLogAlignment doesn't seem to make a lot of sense. I don't think it would do much on its own. Can this add sensible values for PrefLoopLogAlignment at the same time?

It could then extend the test in D114879 for all the CPUs added, to show it's tested.

llvm/lib/Target/AArch64/AArch64Subtarget.cpp
117–124

These should be added too if they can be. They may need to be split into separate case blocks, if the A510 is different to the others now.

NickGuy updated this revision to Diff 418569.Mar 28 2022, 6:45 AM
NickGuy marked an inline comment as done.
dmgreen added inline comments.Mar 29 2022, 2:27 AM
llvm/lib/Target/AArch64/AArch64Subtarget.cpp
82

This needn't be set if there is no PrefLoopLogAlignment set too.

Either that, or it can be treated like a CortexA53/A55 below by adding it to the same case block.

llvm/test/CodeGen/AArch64/aarch64-p2align-max-bytes-neoverse.ll
9

Should this be checking for 4, 8? Can we add some of the other cpus like A53 and A55 too?

NickGuy updated this revision to Diff 418903.Mar 29 2022, 9:23 AM
NickGuy marked 2 inline comments as done.
NickGuy added inline comments.
llvm/lib/Target/AArch64/AArch64Subtarget.cpp
82

I missed that when adding the others, now added.

llvm/test/CodeGen/AArch64/aarch64-p2align-max-bytes-neoverse.ll
9

Fixed, and added more of the effected cpus.

dmgreen accepted this revision.Mar 31 2022, 12:25 AM

Thanks. LGTM

llvm/lib/Target/AArch64/AArch64Subtarget.cpp
82

I would fold this into the CortexA53 block. The cpus in those blocks are similar, and I dont believe there is any reason to treat them differently for function alignment.

This revision is now accepted and ready to land.Mar 31 2022, 12:25 AM
This revision was landed with ongoing or failed builds.Mar 31 2022, 3:37 AM
This revision was automatically updated to reflect the committed changes.