[PATCH] D75467: [instcombine] remove fsub to fneg hacks; only emit fneg

Simon Moll via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 09:30:13 PST 2020


simoll created this revision.
simoll added reviewers: arsenm, craig.topper, rengolin, cameron.mcinally, spatel, xbolva00, mcberg2017, k-ishizaka.
Herald added subscribers: llvm-commits, hiraditya, wdng.
Herald added a project: LLVM.

Rewrite the fsub-0.0 idiom to fneg and always emit fneg for fp negation. This also extends the scalarization cost in instcombine for unary operators to result in the same IR rewrites for fneg as for the idiom.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75467

Files:
  llvm/include/llvm/IR/PatternMatch.h
  llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
  llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
  llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
  llvm/test/Transforms/InstCombine/X86/x86-avx512.ll
  llvm/test/Transforms/InstCombine/cos-1.ll
  llvm/test/Transforms/InstCombine/fadd.ll
  llvm/test/Transforms/InstCombine/fast-math.ll
  llvm/test/Transforms/InstCombine/fdiv.ll
  llvm/test/Transforms/InstCombine/fmul.ll
  llvm/test/Transforms/InstCombine/fneg.ll
  llvm/test/Transforms/InstCombine/fpextend.ll
  llvm/test/Transforms/InstCombine/fsub.ll
  llvm/test/Transforms/InstCombine/maximum.ll
  llvm/test/Transforms/InstCombine/maxnum.ll
  llvm/test/Transforms/InstCombine/minimum.ll
  llvm/test/Transforms/InstCombine/minnum.ll
  llvm/test/Transforms/InstCombine/operand-complexity.ll
  llvm/test/Transforms/InstCombine/vec_shuffle.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75467.247669.patch
Type: text/x-patch
Size: 43944 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200302/7ff304c9/attachment-0001.bin>


More information about the llvm-commits mailing list