From 7365b44b8558c855531962c71ac0c42fea755f4a Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Tue, 20 Feb 2018 21:52:46 +0000 Subject: [PATCH] [InstCombine] remove unneeded operand swap: NFCI FMul is commutative, so complexity-based canonicalization should always take care of the swap via SimplifyAssociativeOrCommutative(). llvm-svn: 325628 --- llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp index 7e402eb..cb42d24 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp @@ -549,9 +549,6 @@ Instruction *InstCombiner::visitFMul(BinaryOperator &I) { if (Value *V = SimplifyVectorOp(I)) return replaceInstUsesWith(I, V); - if (isa(Op0)) - std::swap(Op0, Op1); - if (Value *V = SimplifyFMulInst(Op0, Op1, I.getFastMathFlags(), SQ.getWithInstruction(&I))) return replaceInstUsesWith(I, V); -- 2.7.4