This is an archive of the discontinued LLVM Phabricator instance.

[LoopVectorize] Rename pass options. NFC.
ClosedPublic

Authored by Meinersbur on Dec 17 2018, 12:46 PM.

Details

Summary

Rename:
NoUnrolling to InterleaveOnlyWhenForced
and
AlwaysVectorize to !VectorizeOnlyWhenForced

Contrary to what the name 'AlwaysVectorize' suggests, it does not unconditionally vectorize all loops, but applies a cost model to determine whether vectorization is profitable to all loops. Hence, passing false will disable the cost model, except when a loop is marked with llvm.loop.vectorize.enable. The 'OnlyWhenForced' suffix (suggested by @hfinkel in D55716) better matches this behavior.

Similarly, 'NoUnrolling' disables the profitability cost model for interleaving (a term to distinguish it from unrolling by the LoopUnrollPass); rename it for consistency.

Note that LoopVectorize'rs vectorize and interleaving transformations are not entirely independent. For instance, {!"llvm.loop.vectorize.enable", i32 0} disables interleaving as well.

Diff Detail

Event Timeline

Meinersbur created this revision.Dec 17 2018, 12:46 PM
hfinkel accepted this revision.Dec 17 2018, 12:54 PM

LGTM. Thanks, I think this naming is more accurate and useful.

This revision is now accepted and ready to land.Dec 17 2018, 12:54 PM
  • Rebase after commit of D55716
This revision was automatically updated to reflect the committed changes.