From 33f3e77a5bc84847bcf5a35786a36cb71e5c68c3 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 1 Dec 2008 21:06:30 +0000 Subject: [PATCH] Don't rebuild RHSNeg. Just use the one that's already there. llvm-svn: 60370 --- lib/Transforms/Scalar/InstructionCombining.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 9ee375c3825..8d7616053b1 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -2937,8 +2937,7 @@ Instruction *InstCombiner::visitSDiv(BinaryOperator &I) { if (RHS != RHSNeg) { // Check that there is no overflow. Constant *CINeg = ConstantExpr::getNeg(CI); if (CI != CINeg) // Check that there is no overflow. - return BinaryOperator::CreateSDiv(LHSNeg, - ConstantExpr::getNeg(RHS)); + return BinaryOperator::CreateSDiv(LHSNeg, RHSNeg); } } }