[PATCH] D96604: [LoopVectorizer] Require no-signed-zeros-fp-math=true for fmin/fmax

Kerry McLaughlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 06:52:05 PST 2021


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

Currently, setting the `no-nans-fp-math` attribute to true will allow
loops with fmin/fmax to vectorize, though we should be requiring that
`no-signed-zeros-fp-math` is also set.

This patch adds the check for no-signed-zeros at the function level and includes
tests to make sure we don't vectorize functions with only one of the attributes
associated.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96604

Files:
  llvm/include/llvm/Analysis/IVDescriptors.h
  llvm/lib/Analysis/IVDescriptors.cpp
  llvm/test/Transforms/LoopVectorize/X86/reduction-fastmath.ll
  llvm/test/Transforms/LoopVectorize/float-minmax-instruction-flag.ll
  llvm/test/Transforms/LoopVectorize/minmax_reduction.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96604.323314.patch
Type: text/x-patch
Size: 14852 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210212/6369e25e/attachment.bin>


More information about the llvm-commits mailing list