This is an archive of the discontinued LLVM Phabricator instance.

[MachineVerifier] Speed-up verification (up to 10x)
ClosedPublic

Authored by evgeny777 on Jul 18 2020, 9:29 AM.

Details

Summary

Patch lowers verification time for me from 35 seconds to less than 3 seconds

Diff Detail

Event Timeline

evgeny777 created this revision.Jul 18 2020, 9:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2020, 9:29 AM
Herald added a subscriber: hiraditya. · View Herald Transcript

Can anyone look at this, please? Thanks

arsenm added a subscriber: arsenm.Jul 24 2020, 11:40 AM
arsenm added inline comments.
llvm/lib/CodeGen/MachineVerifier.cpp
2236–2237

This LGTM, but why is the verifier figuring out how to do its own RPO? Why isn't this using ReversePostOrderTraversal<MachineFunction*> which has its own set?

evgeny777 updated this revision to Diff 282184.Jul 31 2020, 4:08 AM
evgeny777 added a reviewer: arsenm.

@arsenm

This LGTM, but why is the verifier figuring out how to do its own RPO?

It isn't. Instead it's doing BFS in some twisted way when RPO is used to assign indexes in two level map of MachineBasicBlock -> FilteringVRegSet. I've rewritten it with something more compact (tests pass and no performance problems so far)

arsenm accepted this revision.Jul 31 2020, 6:18 AM
This revision is now accepted and ready to land.Jul 31 2020, 6:18 AM
This revision was automatically updated to reflect the committed changes.