From 27fbef4a8fd19e9ab3d007ff11778576368ea39c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 17 Jul 2008 06:07:20 +0000 Subject: Fix PR2553 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53715 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/InstructionCombining.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 4a45e66..861badf 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -2255,7 +2255,8 @@ Instruction *InstCombiner::visitAdd(BinaryOperator &I) { Instruction *InstCombiner::visitSub(BinaryOperator &I) { Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); - if (Op0 == Op1) // sub X, X -> 0 + if (Op0 == Op1 && // sub X, X -> 0 + !I.getType()->isFPOrFPVector()) return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType())); // If this is a 'B = x-(-A)', change to B = x+A... -- cgit v1.1