diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2018-10-07 16:30:42 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2018-10-07 16:30:42 +0000 |
| commit | ecc8af61e78bce8075475a947538f7599aa0587e (patch) | |
| tree | dda676101b2ae4b8f6583b88abc558094e03e370 /llvm | |
| parent | f956840dbe41f3121ecceea24e0f1aa15cb0f5bb (diff) | |
| download | bcm5719-llvm-ecc8af61e78bce8075475a947538f7599aa0587e.tar.gz bcm5719-llvm-ecc8af61e78bce8075475a947538f7599aa0587e.zip | |
[DAGCombiner] allow undef elts in vector fadd matching
llvm-svn: 343945
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 2 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/fadd-combines.ll | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 69ed0304985..e4b8d8e8455 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -10865,7 +10865,7 @@ SDValue DAGCombiner::visitFADD(SDNode *N) { return DAG.getNode(ISD::FADD, DL, VT, N1, N0, Flags); // N0 + -0.0 --> N0 (also allowed with +0.0 and fast-math) - ConstantFPSDNode *N1C = isConstOrConstSplatFP(N1); + ConstantFPSDNode *N1C = isConstOrConstSplatFP(N1, true); if (N1C && N1C->isZero()) if (N1C->isNegative() || Options.UnsafeFPMath || Flags.hasNoSignedZeros()) return N0; diff --git a/llvm/test/CodeGen/X86/fadd-combines.ll b/llvm/test/CodeGen/X86/fadd-combines.ll index efd31d43265..fdd83dacd70 100644 --- a/llvm/test/CodeGen/X86/fadd-combines.ll +++ b/llvm/test/CodeGen/X86/fadd-combines.ll @@ -20,8 +20,6 @@ define <4 x float> @fadd_zero_4f32(<4 x float> %x) #0 { define <4 x float> @fadd_zero_4f32_undef(<4 x float> %x) { ; CHECK-LABEL: fadd_zero_4f32_undef: ; CHECK: # %bb.0: -; CHECK-NEXT: xorps %xmm1, %xmm1 -; CHECK-NEXT: addps %xmm1, %xmm0 ; CHECK-NEXT: retq %y = fadd nsz <4 x float> %x, <float 0.0, float undef, float 0.0, float undef> ret <4 x float> %y |

