This is an archive of the discontinued LLVM Phabricator instance.

[LSR] Add a flag that overrides the target's preferred addressing mode
ClosedPublic

Authored by SjoerdMeijer on Feb 17 2021, 3:58 AM.

Details

Summary

This adds flag -lsr-preferred-addressing-mode to override the target's preferred addressing mode. It replaces flag -lsr-backedge-indexing, which is equivalent to preindexed addressing that is one of the options that -lsr-preferred-addressing-mode accepts.

Diff Detail

Event Timeline

SjoerdMeijer created this revision.Feb 17 2021, 3:58 AM
SjoerdMeijer requested review of this revision.Feb 17 2021, 3:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2021, 3:58 AM

Thank for putting this together.

llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
5572

Could this use PreferredAddresingMode.getNumOccurrences() > 0 to allwo overriding to None, even if the target returns Pre/PostIndexed?

Thanks Dave, fixed that.

dmgreen accepted this revision.Feb 17 2021, 7:49 AM

Thanks. LGTM

This revision is now accepted and ready to land.Feb 17 2021, 7:49 AM