Handle instructions in the map, but that map to a null pointer.
This unbreaks smg2000.

llvm-svn: 29127
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index eeb6911..c6f5075 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -157,7 +157,8 @@
     const Instruction *OrigCall = I->first.getInstruction();
     
     std::map<const Value*, Value*>::iterator VMI = ValueMap.find(OrigCall);
-    if (VMI != ValueMap.end()) { // Only copy the edge if the call was inlined!
+    // Only copy the edge if the call was inlined!
+    if (VMI != ValueMap.end() && VMI->second) {
       // If the call was inlined, but then constant folded, there is no edge to
       // add.  Check for this case.
       if (Instruction *NewCall = dyn_cast<Instruction>(VMI->second))