diff options
author | Chris Lattner <sabre@nondot.org> | 2008-07-17 06:07:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-07-17 06:07:20 +0000 |
commit | c600c53d1ffc759deca57a650fb774d6fada8105 (patch) | |
tree | 35e6b424fd4b20c0979865b9fd9670fed0b6df7f /llvm/lib | |
parent | 1e2c6bfa41f2c15776dd9cafbcefddf6e4d412b6 (diff) | |
download | bcm5719-llvm-c600c53d1ffc759deca57a650fb774d6fada8105.tar.gz bcm5719-llvm-c600c53d1ffc759deca57a650fb774d6fada8105.zip |
Fix PR2553
llvm-svn: 53715
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 4a45e668cf7..861badf8f03 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/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... |