diff options
author | Owen Anderson <resistor@mac.com> | 2012-05-30 18:54:50 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2012-05-30 18:54:50 +0000 |
commit | f917d20561688ca79fab5a58feb495e332f84903 (patch) | |
tree | c38f5744d6d7e07bde007f508cd5b4e7602b2976 | |
parent | 85ef6f4c99aee3c2ed43bbe6d190541f283a7e43 (diff) |
Switch the canonical FMA term operand order to match both the comment I wrote and the usual LLVM convention.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157708 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 2 | ||||
-rw-r--r-- | test/CodeGen/ARM/fusedMAC.ll | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 647ff6b6b2..3b8489f03b 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -5771,7 +5771,7 @@ SDValue DAGCombiner::visitFMA(SDNode *N) { 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(); diff --git a/test/CodeGen/ARM/fusedMAC.ll b/test/CodeGen/ARM/fusedMAC.ll index 8ebca02df9..da0789ec3e 100644 --- a/test/CodeGen/ARM/fusedMAC.ll +++ b/test/CodeGen/ARM/fusedMAC.ll @@ -192,7 +192,7 @@ define float @test_fma_const_fold(float %a, float %b) nounwind { 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 } |