[PATCH] D70597: [PHIEliminate] skip dbg instruction when LowerPHINode

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 04:54:59 PST 2019


jmorse added a comment.

> Look like adding one more method for SkipPHIsAndLabels with const_iterator would be more easier. I thought will be more duplicate code to implement SkipPHIsAndLabels and SkipPHIsLabelsAndDebug in MachineVerifier.

Fair enough,

> As the "No debug in PHI and labels" assert already be added in PHIElimination.cpp, is that safe if we do not add the checking in MachineVerifier?

The assertion is testing that what we're doing is safe at the last possible moment. The machine verifier runs much earlier (and can be run independently over a MIR file, I think), and gives much more context and information about where the problem has happened. It'll save future developers a large amount of time narrowing down problems, and improve the user experience if a bug is encountered. It also makes it easier for us to argue "this MIR file is invalid" if someone disagrees about whether their code is valid.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70597/new/

https://reviews.llvm.org/D70597





More information about the llvm-commits mailing list