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

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 16 07:48:16 PST 2019


jmorse added a comment.

> I try to add below reference code to MachineVerifier::checkPHIOps, but meet a build error. In the function the type of MBB.begin() is const_iterator, but type of SkipPHIsAndLabels argument is (iterator I). How to convert const_iterator to iterator and pass to SkipPHIsAndLabels? Could I write the MachineVerifier as below code?

Ah, yeah, SkipPHIsAndLabels expects to produce a non-const iterator, and you're calling it from somewhere where everything is const. I suspect (although my C++ fu is poor) that, just like the "begin" and "end" calls in MachineBasicBlock, duplicate methods would be needed, which would seem wasteful. It might be easier to just implement this manually in the verifier.


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

https://reviews.llvm.org/D70597





More information about the llvm-commits mailing list