[PATCH] D153247: [DAG] Fix and expand fmin/fmax reassociation fold.

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 19 00:02:24 PDT 2023


dmgreen created this revision.
dmgreen added reviewers: anna, RKSimon, nikic.
Herald added subscribers: luke, StephenFan, frasercrmck, luismarques, apazos, sameer.abuasal, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya.
Herald added a project: All.
dmgreen requested review of this revision.
Herald added subscribers: wangpc, MaskRay.
Herald added a project: LLVM.

This call to reassociateReduction is used by both fminnum/fmaxnum and fminimum/fmaximum. In adding support for fminimum/fmaximum we appear to be fixing the use of an incorrect reduction type, which should have only applied to minnum/maxnum.

I also believe that it doesn't need nsz and reassoc to perform the reassociation. For float min/max it should always be valid.


https://reviews.llvm.org/D153247

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/AArch64/double_reduct.ll
  llvm/test/CodeGen/AArch64/sve-doublereduct.ll
  llvm/test/CodeGen/RISCV/double_reduct.ll
  llvm/test/CodeGen/Thumb2/mve-doublereduct.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153247.532544.patch
Type: text/x-patch
Size: 7451 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230619/800323a6/attachment.bin>


More information about the llvm-commits mailing list