[PATCH] D47441: SafepointIRVerifier should ignore dead blocks and dead edges
    Anna Thomas via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue May 29 10:58:57 PDT 2018
    
    
  
anna added inline comments.
================
Comment at: lib/IR/SafepointIRVerifier.cpp:242
+/// without splitting critical edges. So the CFG is kept intact.
+class DeadBlocks : public SetVector<const BasicBlock *> {
+  const DominatorTree &DT;
----------------
This seems like a generally useful analysis to have outside of the safepoint IR Verifier. We should think of moving the code into Analysis. 
You mentioned it's taken from the GVN but modified to avoid splitting the critical edges. Could you please state that as a comment here: modified version from `GVN::addDeadBlock`. 
================
Comment at: lib/IR/SafepointIRVerifier.cpp:282
+      const BasicBlock *D = NewDead.pop_back_val();
+      if (isDeadBlock(D))
+        continue;
----------------
comment here that block maybe already dead if it's dominated by `NewDead` blocks processed earlier.
================
Comment at: lib/IR/SafepointIRVerifier.cpp:302
+  void processFoldableCondBr(const BranchInst *BI) {
+    if (!BI || BI->isUnconditional())
+      return;
----------------
Change to assert instead of check.
https://reviews.llvm.org/D47441
    
    
More information about the llvm-commits
mailing list