[PATCH] D28767: Do not verify Dominator tree if it has no roots
Serge Pavlov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 24 05:50:55 PST 2017
sepavloff updated this revision to Diff 85576.
sepavloff added a comment.
Added similar check in IR/Dominators.
https://reviews.llvm.org/D28767
Files:
lib/CodeGen/MachineDominators.cpp
lib/IR/Dominators.cpp
test/CodeGen/Generic/externally_available.ll
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() {
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: 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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28767.85576.patch
Type: text/x-patch
Size: 1279 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170124/7cbadc4b/attachment.bin>
More information about the llvm-commits
mailing list