Index: lib/CodeGen/MachineDominators.cpp =================================================================== --- lib/CodeGen/MachineDominators.cpp +++ lib/CodeGen/MachineDominators.cpp @@ -143,6 +143,10 @@ } void MachineDominatorTree::verifyDomTree() const { + if (getRoots().empty()) + // If dominator tree is unavailable, skip verification. + return; + MachineFunction &F = *getRoot()->getParent(); MachineDominatorTree OtherDT; Index: lib/IR/Dominators.cpp =================================================================== --- lib/IR/Dominators.cpp +++ lib/IR/Dominators.cpp @@ -291,6 +291,10 @@ } void DominatorTree::verifyDomTree() const { + if (getRoots().empty()) + // If dominator tree is unavailable, skip verification. + return; + Function &F = *getRoot()->getParent(); DominatorTree OtherDT; Index: test/CodeGen/Generic/externally_available.ll =================================================================== --- test/CodeGen/Generic/externally_available.ll +++ test/CodeGen/Generic/externally_available.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s | not grep test_ +; RUN: llc -verify-machine-dom-info < %s | not grep test_ ; test_function should not be emitted to the .s file. define available_externally i32 @test_function() {