[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
Wed Jan 25 00:09:31 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL293033: Do not verify dominator tree if it has no roots (authored by sepavloff).

Changed prior to commit:
  https://reviews.llvm.org/D28767?vs=85576&id=85703#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D28767

Files:
  llvm/trunk/lib/CodeGen/MachineDominators.cpp
  llvm/trunk/lib/IR/Dominators.cpp
  llvm/trunk/test/CodeGen/Generic/externally_available.ll


Index: llvm/trunk/test/CodeGen/Generic/externally_available.ll
===================================================================
--- llvm/trunk/test/CodeGen/Generic/externally_available.ll
+++ llvm/trunk/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: llvm/trunk/lib/IR/Dominators.cpp
===================================================================
--- llvm/trunk/lib/IR/Dominators.cpp
+++ llvm/trunk/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: llvm/trunk/lib/CodeGen/MachineDominators.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/MachineDominators.cpp
+++ llvm/trunk/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.85703.patch
Type: text/x-patch
Size: 1378 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170125/9a7af7f2/attachment.bin>


More information about the llvm-commits mailing list