This is an archive of the discontinued LLVM Phabricator instance.

[AArch64TargetMachine] Enable LICM Hosting LOAD only optimization in case of -O3
AbandonedPublic

Authored by djtodoro on Nov 5 2021, 8:29 AM.

Details

Reviewers
efriedma
Summary

Enable LICM Hosting LOAD only optimization in case of -O3.

NOTE: This doesn't depend on the SeparateConstOffsetFromGEP, but the flag for this optimization will be enabled iff the SeparateConstOffsetFromGEP is active in the case of AARCH64 target, which is the goal arch for this stack of patches.

This addresses [0].
[0] https://bugs.llvm.org/show_bug.cgi?id=51193

Co-authored-by: @mmatic05, @milica-lazarevic, @dmilosevic141

Diff Detail

Event Timeline

djtodoro created this revision.Nov 5 2021, 8:29 AM
djtodoro requested review of this revision.Nov 5 2021, 8:29 AM
djtodoro retitled this revision from [WIP] [AArch64TargetMachine] Enable LICM Hosting LOAD only optimization in case of -O3 to [AArch64TargetMachine] Enable LICM Hosting LOAD only optimization in case of -O3.Nov 16 2021, 2:06 AM
djtodoro added a reviewer: efriedma.

Not sure why you want to turn it on specifically for aarch64, and only late in the optimization pipeline.

llvm/lib/Transforms/Scalar/LICM.cpp
336

You can't mess with a global variable like this; among other issues, it breaks thread safety. If you need a variable, add a member to the LegacyLICMPass class.

@efriedma Thanks for the comment!

Not sure why you want to turn it on specifically for aarch64, and only late in the optimization pipeline.

Actually, it doesn't need to be called very late. And, I don't think this is applicable to AArch64 only.
I've been experimenting with a few potential improvements in LLVM that could bring benefits to AArch64 Aggressive optimization mode, so this patch just follows that direction (that's why it was marked as WIP).

djtodoro added a comment.EditedNov 24 2021, 5:55 AM

This isn't needed, since the feature will be target-independent.

djtodoro abandoned this revision.Nov 24 2021, 5:55 AM