git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157708
91177308-0d34-0410-b5e6-
96231b3b80d8
return DAG.getNode(ISD::FADD, N->getDebugLoc(), VT, N0, N2);
// Canonicalize (fma c, x, y) -> (fma x, c, y)
- if (!N0CFP && N1CFP)
+ if (N0CFP && !N1CFP)
return DAG.getNode(ISD::FMA, N->getDebugLoc(), VT, N1, N0, N2);
return SDValue();
define float @test_fma_canonicalize(float %a, float %b) nounwind {
; CHECK: test_fma_canonicalize
; CHECK: vmov.f32 s0
-; CHECK: vfma.f32 s2, s0, s1
+; CHECK: vfma.f32 s2, s1, s0
%ret = call float @llvm.fma.f32(float 2.0, float %a, float %b)
ret float %ret
}