From 2a55951d08d130845d111c87bc0fc87c6ad18b8f Mon Sep 17 00:00:00 2001 From: Frits van Bommel Date: Sat, 29 Jan 2011 17:50:27 +0000 Subject: Call SimplifyFDivInst() in InstCombiner::visitFDiv(). llvm-svn: 124535 --- llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp') diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp index 32b2a0ac0ee..035ee721bfd 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp @@ -473,6 +473,15 @@ Instruction *InstCombiner::visitSDiv(BinaryOperator &I) { return 0; } +Instruction *InstCombiner::visitFDiv(BinaryOperator &I) { + Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); + + if (Value *V = SimplifyFDivInst(Op0, Op1, TD)) + return ReplaceInstUsesWith(I, V); + + return 0; +} + /// This function implements the transforms on rem instructions that work /// regardless of the kind of rem instruction it is (urem, srem, or frem). It /// is used by the visitors to those instructions. -- cgit v1.2.3