diff options
author | Chris Lattner <sabre@nondot.org> | 2009-11-15 19:57:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-11-15 19:57:43 +0000 |
commit | 1fb5630474d261eca0b4de9c79279b9c9e42a444 (patch) | |
tree | cfa1db96baea4a3e43a388e951bea92daa6e6b93 /lib/Transforms/Scalar/JumpThreading.cpp | |
parent | 5415127330d3b3ccb91cc6fef196f066563740a9 (diff) |
fix a bug handling 'not x' when x is undef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88864 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/JumpThreading.cpp')
-rw-r--r-- | lib/Transforms/Scalar/JumpThreading.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/JumpThreading.cpp b/lib/Transforms/Scalar/JumpThreading.cpp index d5ce86aca0..de4c118b69 100644 --- a/lib/Transforms/Scalar/JumpThreading.cpp +++ b/lib/Transforms/Scalar/JumpThreading.cpp @@ -350,8 +350,9 @@ ComputeValueKnownInPredecessors(Value *V, BasicBlock *BB,PredValueInfo &Result){ // Invert the known values. for (unsigned i = 0, e = Result.size(); i != e; ++i) - Result[i].first = - cast<ConstantInt>(ConstantExpr::getNot(Result[i].first)); + if (Result[i].first) + Result[i].first = + cast<ConstantInt>(ConstantExpr::getNot(Result[i].first)); return true; } } |