[llvm-commits] [llvm] r88864 - /llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp

Chris Lattner sabre at nondot.org
Sun Nov 15 11:57:43 PST 2009


Author: lattner
Date: Sun Nov 15 13:57:43 2009
New Revision: 88864

URL: http://llvm.org/viewvc/llvm-project?rev=88864&view=rev
Log:
fix a bug handling 'not x' when x is undef.

Modified:
    llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=88864&r1=88863&r2=88864&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Sun Nov 15 13:57:43 2009
@@ -350,8 +350,9 @@
 
       // 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;
     }
   }





More information about the llvm-commits mailing list