Index: llvm/lib/Transforms/Utils/Local.cpp
===================================================================
--- llvm/lib/Transforms/Utils/Local.cpp
+++ llvm/lib/Transforms/Utils/Local.cpp
@@ -949,7 +949,9 @@
       DominatorTree::UpdateType UT = {DominatorTree::Delete, *PI, BB};
       if (std::find(Updates.begin(), Updates.end(), UT) == Updates.end()) {
         Updates.push_back(UT);
-        Updates.push_back({DominatorTree::Insert, *PI, Succ});
+        // Succ cannot dominate itself.
+        if (*PI != Succ)
+          Updates.push_back({DominatorTree::Insert, *PI, Succ});
       }
     }