[PATCH] D95690: [LoopVectorize] improve IR fast-math-flags propagation in reductions

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 29 11:16:54 PST 2021


spatel created this revision.
spatel added reviewers: dmgreen, fhahn, SjoerdMeijer.
Herald added subscribers: dexonsmith, hiraditya, mcrosier.
spatel requested review of this revision.
Herald added a project: LLVM.

This is another step (see D95452 <https://reviews.llvm.org/D95452>) towards correcting fast-math-flags bugs in vector reductions.

There are multiple bugs visible in the test diffs, and this is still not working as it should. We still use function attributes (rather than FMF) to drive part of the logic, but we are not checking for the correct FP function attributes.

Note that FMF may not be propagated optimally on selects (example in https://llvm.org/PR35607 ). That's why I'm proposing to union the FMF of a fcmp+select pair and avoid regressions on existing vectorizer tests.


https://reviews.llvm.org/D95690

Files:
  llvm/include/llvm/IR/Operator.h
  llvm/include/llvm/Transforms/Utils/LoopUtils.h
  llvm/lib/Analysis/IVDescriptors.cpp
  llvm/lib/Transforms/Utils/LoopUtils.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/X86/reduction-fastmath.ll
  llvm/test/Transforms/LoopVectorize/float-minmax-instruction-flag.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95690.320176.patch
Type: text/x-patch
Size: 9830 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210129/78851e67/attachment.bin>


More information about the llvm-commits mailing list