[PATCH] D29280: Do not verify MachimeDominatorTree if it is not calculated

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 1 02:26:41 PST 2017


fhahn added a comment.

In https://reviews.llvm.org/D29280#661308, @sepavloff wrote:

> Not only dominator pass was skipped, all machine code passes were skipped too. According to the documentation (http://llvm.org/docs/LangRef.html#linkage-types):
>
> > Globals with “available_externally” linkage are never emitted into the object file
>
> So there is no sense to run machine code generation for them.


Ah thanks that makes sense. The only thing I am still wondering about:  if no machine passes are run, `MachineDominatorTree::verifyAnalysis` or `MachineDominatorTree::verifyDomTree` shouldn't be called in the first place, no?



================
Comment at: lib/CodeGen/MachineDominators.cpp:142
 void MachineDominatorTree::verifyDomTree() const {
+  if (!DT)
+    return;
----------------
Would this change here in combination with moving the allocation of the dominator tree to runOnMachineFunction be enough to skip the verification in cases runOnMachineFunction is not executed?

The change to use unique_ptr might be a worthwhile refactoring, but it looks like most of the changes in this patch are related to the change to unique_ptr instead of skipping the dominator tree verification. I think it would make it easier for reviewers if the patch would only contain the changes required to skip the dominator tree verification.


https://reviews.llvm.org/D29280





More information about the llvm-commits mailing list