[PATCH] D101836: [LoopVectorize] Enable strict reductions when allowReordering() returns false

Kerry McLaughlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 4 07:38:46 PDT 2021


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

The `-enable-strict-reductions` flag introduced in D98435 <https://reviews.llvm.org/D98435> will currently only
vectorize reductions in-loop if hints are used, since using hints to
enable vectorization allows reordering. If no hints are given, the flag
will have no effect as canVectorizeFPMath() will return false.

This patch adds a function to query whether it is safe to vectorize the
loop with ordered reductions if no hints are used.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101836

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101836.342733.patch
Type: text/x-patch
Size: 26740 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210504/6a2bec02/attachment.bin>


More information about the llvm-commits mailing list