From: Sanjay Patel Date: Tue, 20 Feb 2018 21:52:46 +0000 (+0000) Subject: [InstCombine] remove unneeded operand swap: NFCI X-Git-Tag: llvmorg-7.0.0-rc1~12401 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7365b44b8558c855531962c71ac0c42fea755f4a;p=platform%2Fupstream%2Fllvm.git [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 --- 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);