[PATCH] D94913: [SLP] match maxnum/minnum intrinsics as FP reduction ops

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 18 06:59:58 PST 2021


spatel created this revision.
spatel added reviewers: ABataev, RKSimon, craig.topper, fhahn, dmgreen.
Herald added subscribers: hiraditya, mcrosier.
spatel requested review of this revision.
Herald added a project: LLVM.

After much refactoring over the last 2 weeks to the reduction matching code, I think this change is finally ready.
We effectively broke fmax/fmin vector reduction optimization when we started canonicalizing to intrinsics in instcombine, so this will hopefully restore that for SLP.
There are still FMF problems here as noted in the code comments, but we should be avoiding those for fmax/fmin (negative tests are included). I am planning to look at fixing FMF propagation next.
There's also an open cost model question: should we prefer the getIntrinsicInstrCost() API (as is currently shown in the patch) or use getMinMaxReductionCost() (as is currently shown for the integer min/max ops)? There are no test differences with the current regression tests, but that will need to be examined in more detail to make sure we are getting accurate costs.


https://reviews.llvm.org/D94913

Files:
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
  llvm/test/Transforms/PhaseOrdering/X86/vector-reductions-expanded.ll
  llvm/test/Transforms/SLPVectorizer/X86/fmaxnum.ll
  llvm/test/Transforms/SLPVectorizer/X86/fminnum.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94913.317346.patch
Type: text/x-patch
Size: 15542 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210118/6982ad0d/attachment.bin>


More information about the llvm-commits mailing list