llvm-project
d269c36b - [WebAssembly] Optimize `WebAssemblyCFGSort`'s post sort verifications. (#182458)

Commit
63 days ago
[WebAssembly] Optimize `WebAssemblyCFGSort`'s post sort verifications. (#182458) Currently, the post-sort verifications `WebAssemblyCFGSort` does in assertion builds is quite expensive. Given the example of [usagi-coffee/tree-sitter-abl](https://github.com/usagi-coffee/tree-sitter-abl), we have one MASSIVE function with nearly 120K blocks. Sorting this is fast, but the verifications after take some 40+ seconds (on my machine). The culprit was the manipulation of the region `OnStack`. I've tried to replace that with interval based verifications to make sure the regions are well formed, well nested, and that the numbers of the blocks within a region are within the interval of the numbers of the header and bottom of the region. This brings the aforementioned example down to well under a second spent in the pass in an assertions build.
Parents
Loading