[PATCH] D75501: [DAGCombine] Check the uses of negated floating constant and remove the hack
    qshanz via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Mar  2 23:36:28 PST 2020
    
    
  
steven.zhang created this revision.
steven.zhang added reviewers: spatel, lebedev.ri, craig.topper, arsenm, RKSimon, rampitec, nemanjai, jsji, PowerPC.
Herald added subscribers: kerbowa, wuzish, hiraditya, nhaehnle, wdng, jvesely.
Herald added a project: LLVM.
This patch is motivated by the case I added in PowerPC/fma-combine.ll, and we hit an assertion here due to somewhat the same reason as https://reviews.llvm.org/D70975 . The case is narrowed down from spec and it is important to us. Though we have some hack, it still failed with my case, as the operand 0 now is NOT a const fp, it is another fma that with const fp. And that const fp is negated which result in multi-uses.
So, I think a better fix is to check the uses of the negated const fp. If there are already use of its negated value, we will have benefit as no extra Node is added.
Repository:
  rG LLVM Github Monorepo
https://reviews.llvm.org/D75501
Files:
  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  llvm/test/CodeGen/AMDGPU/fdiv32-to-rcp-folding.ll
  llvm/test/CodeGen/PowerPC/fma-combine.ll
  llvm/test/CodeGen/X86/sse3-avx-addsub-2.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75501.247798.patch
Type: text/x-patch
Size: 9251 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200303/f215d6c4/attachment.bin>
    
    
More information about the llvm-commits
mailing list