aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-12-08 22:20:34 +0000
committerChris Lattner <sabre@nondot.org>2004-12-08 22:20:34 +0000
commit2a0cd9c9b56d0fff66183967951e592e2aec0dba (patch)
tree373d36e102e39aee5e86543bc182c628f8f565c6 /lib/Transforms
parentd5e4e1756feb1b99155ac96db5a320dd58c1fa77 (diff)
Fix Transforms/InstCombine/2004-12-08-RemInfiniteLoop.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18670 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 8915598da1..9eb30549f4 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -309,7 +309,8 @@ static inline Value *dyn_castNegVal(Value *V) {
// Constants can be considered to be negated values if they can be folded...
if (Constant *C = dyn_cast<Constant>(V))
- return ConstantExpr::getNeg(C);
+ if (!isa<UndefValue>(C))
+ return ConstantExpr::getNeg(C);
return 0;
}