From 2a0cd9c9b56d0fff66183967951e592e2aec0dba Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 8 Dec 2004 22:20:34 +0000 Subject: [PATCH] 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 --- lib/Transforms/Scalar/InstructionCombining.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 8915598da11..9eb30549f47 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(V)) - return ConstantExpr::getNeg(C); + if (!isa(C)) + return ConstantExpr::getNeg(C); return 0; }