When -early-live-intervals is used, TwoAddressInstruction runs some
extra ad hoc machine verification, but it does this even for targets
that are marked as "not machine verifier clean". Fix this so that we
don't get spurious failures that are not related to live intervals.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This is the only way I could think of to test it. Without the change to TwoAddressInstructionPass, enabling -early-live-intervals on Lanai (an unclean target) would throw up known errors like:
*** Bad machine code: MBB exits via conditional branch/fall-through but ends with a barrier instruction! *** - function: clz32 - basic block: %bb.0 (0x73a5a68) [0B;64B)
llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | ||
---|---|---|
1659–1665 | Could we just remove this code? Doesn't seem like we miss much since this is the last step of the pass before we would have a verifier pass scheduled anyway... |
llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | ||
---|---|---|
1659–1665 | There is actually a subtle difference: if this pass is the last user of an analysis like LiveVariables, then calling MF->verify() here will verify that analysis, but scheduling a MachineVerifier pass afterwards will not, because the pass manager frees analyses immediately after their last user. Because of that, this call to MF->verify() catches more problems than -verify-machineinstrs (or enabling LLVM_ENABLE_EXPENSIVE_CHECKS) does. But I'd still be happy to remove it. I'll prepare a patch... |
Could we just remove this code? Doesn't seem like we miss much since this is the last step of the pass before we would have a verifier pass scheduled anyway...