commit | d137ab47832768b416453ee3e3a568faefa77852 | [log] [tgz] |
---|---|---|
author | Chris Lattner <sabre@nondot.org> | Thu Jul 17 06:07:20 2008 +0000 |
committer | Chris Lattner <sabre@nondot.org> | Thu Jul 17 06:07:20 2008 +0000 |
tree | 52138af43bb893e2aea4ab88dd62095170114531 | |
parent | f595266b91ea5aef953ce3019557a5f3d3291ff9 [diff] [blame] |
Fix PR2553 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53715 91177308-0d34-0410-b5e6-96231b3b80d8
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::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...