Index: lib/Transforms/Utils/LCSSA.cpp
===================================================================
--- lib/Transforms/Utils/LCSSA.cpp      (revision 39919)
+++ lib/Transforms/Utils/LCSSA.cpp      (working copy)
@@ -242,6 +242,13 @@
   // dominate this block.  Note that we *know* that the block defining the
   // original instruction is in the idom chain, because if it weren't, then the
   // original value didn't dominate this use.
+
+  // If the block has no dominator, bail
+  if (!IDom) {
+    V = UndefValue::get(OrigInst->getType());
+    return V;
+  }
+
   if (!inLoop(IDom->getBlock())) {
     // Idom is not in the loop, we must still be "below" the exit block and must
     // be fully dominated by the value live in the idom.
