This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add experimental option to separately tune alignment of innermost loops
ClosedPublic

Authored by mkazantsev on Jan 18 2021, 12:34 AM.

Details

Summary

We already have an experimental option to tune loop alignment. Its impact
is very wide (and there is a suspicion that it's not always profitable). We want
to have something more narrow to play with. This patch adds similar option that
overrides preferred alignment for innermost loops. This is for experimental
purposes, default values do not change the existing behavior.

Diff Detail

Event Timeline

mkazantsev created this revision.Jan 18 2021, 12:34 AM
mkazantsev requested review of this revision.Jan 18 2021, 12:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 18 2021, 12:34 AM
pengfei added inline comments.Jan 19 2021, 6:19 PM
llvm/lib/Target/X86/X86ISelLowering.cpp
51713

Should it be Align(1ULL << ExperimentalPrefLoopAlignment)?

llvm/test/CodeGen/X86/innermost-loop-alignment.ll
4

Should add a test for combination with option x86-experimental-pref-loop-alignment?

mkazantsev marked an inline comment as done.

Added test for combination of these options.

llvm/lib/Target/X86/X86ISelLowering.cpp
51713

This is already stored in PrefLoopAlignment field. See usages of this option in code. IMO usage of default implementation is better than code copy-paste.

pengfei accepted this revision.Jan 20 2021, 5:21 AM

LGTM.

llvm/lib/Target/X86/X86ISelLowering.cpp
51713

I see. Thank you.

This revision is now accepted and ready to land.Jan 20 2021, 5:21 AM