Index: llvm/trunk/lib/Analysis/InstructionSimplify.cpp =================================================================== --- llvm/trunk/lib/Analysis/InstructionSimplify.cpp +++ llvm/trunk/lib/Analysis/InstructionSimplify.cpp @@ -4592,6 +4592,9 @@ static Value *SimplifyFMAFMul(Value *Op0, Value *Op1, FastMathFlags FMF, const SimplifyQuery &Q, unsigned MaxRecurse) { + if (Constant *C = simplifyFPOp({Op0, Op1})) + return C; + // fmul X, 1.0 ==> X if (match(Op1, m_FPOne())) return Op0; @@ -4626,9 +4629,6 @@ if (Constant *C = foldOrCommuteConstant(Instruction::FMul, Op0, Op1, Q)) return C; - if (Constant *C = simplifyFPOp({Op0, Op1})) - return C; - // Now apply simplifications that do not require rounding. return SimplifyFMAFMul(Op0, Op1, FMF, Q, MaxRecurse); }