[PATCH] D47441: SafepointIRVerifier should ignore dead blocks and dead edges

Artur Pilipenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 14 03:07:24 PDT 2018


apilipenko 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;
----------------
anna wrote:
> 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`. 
> 
@anna, I think this is not of much use outside of SafepointIRVerifier. Most passes don't need to worry about this patterns as it's reasonable to expect simplifycfg to have cleaned things up.

Verifiers is a different story as you don't want you verification logic depend on the optimizations performed on the code. You also don't want to modify the code to clean up the mess.

I would suggest keeping this logic in SafepointIRVerifier. If we want to extract it as a separate analysis I'd suggest making a clear comment that it has very specific purpose.


https://reviews.llvm.org/D47441





More information about the llvm-commits mailing list