OSDN Git Service

[DAGCombiner] remove hasOneUse() check from fadd constants transform
authorSanjay Patel <spatel@rotateright.com>
Wed, 13 Jun 2018 15:22:48 +0000 (15:22 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 13 Jun 2018 15:22:48 +0000 (15:22 +0000)
commit7177c61dc991ca3efb48076cc6499c2638bf85ee
tree24373d0f8ea76a447713396973ed631d2c485fdd
parent98e05fe5290287a9912bfcf0ad712d0c0e09ac72
[DAGCombiner] remove hasOneUse() check from fadd constants transform

We're constant folding here, so we shouldn't check uses. This matches
the IR optimizer behavior.

The x86 test shows the expected win. The AArch64 test shows something
else. This only seems to happen if the "generic" AArch64 CPU model is
used by MachineCombiner, so I'll file a bug report to follow-up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334608 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/AArch64/fadd-combines.ll
test/CodeGen/X86/fadd-combines.ll