Skip to content

Commit

Permalink
Switch the canonical FMA term operand order to match both the comment…
Browse files Browse the repository at this point in the history
… I wrote and the usual LLVM convention.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157708 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
resistor committed May 30, 2012
1 parent 85ef6f4 commit f917d20
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion test/CodeGen/ARM/fusedMAC.ll
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit f917d20

Please sign in to comment.