[PATCH] D102774: [LoopVectorize] Add a flag to prevent reordering of FP operations with hints

Kerry McLaughlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 19 06:52:33 PDT 2021


kmclaughlin created this revision.
kmclaughlin added reviewers: sdesmalen, david-arm, fhahn, dmgreen.
Herald added a subscriber: hiraditya.
kmclaughlin requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When loop hints are passed via metadata, the allowReordering() function
in LoopVectorizationLegality will allow the order of floating point
operations to be changed:

  bool allowReordering() const {
    // When enabling loop hints are provided we allow the vectorizer to change
    // the order of operations that is given by the scalar loop. This is not
    // enabled by default because can be unsafe or inefficient.

This patch adds a flag to disable this behaviour for testing purposes,
particularly for testing vectorization with in-order reductions, which
requires further changes (D101836 <https://reviews.llvm.org/D101836>) to be enabled without the use of hints.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102774

Files:
  llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/AArch64/scalable-strict-fadd.ll
  llvm/test/Transforms/LoopVectorize/AArch64/strict-fadd.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102774.346443.patch
Type: text/x-patch
Size: 8856 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210519/03d7f5b7/attachment.bin>


More information about the llvm-commits mailing list