summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-stack.cpp
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-09-04 15:39:04 -0700
committerGitHub <noreply@github.com>2024-09-04 15:39:04 -0700
commit852baadb27c68a56080ca88769d7e272c4e90235 (patch)
treee830d75d96ba91000b445a2b9459cd3afa6639d8 /src/wasm/wasm-stack.cpp
parent0812ad3564ab802db5c2df7f0fe9fdb22709a535 (diff)
downloadbinaryen-852baadb27c68a56080ca88769d7e272c4e90235.tar.gz
binaryen-852baadb27c68a56080ca88769d7e272c4e90235.tar.bz2
binaryen-852baadb27c68a56080ca88769d7e272c4e90235.zip
[NFC] Take custom comparator in TopologicalSort::minSort (#6890)
Rather than finding the minimum sort with respect to the original order of vertices, find the minimum sort with respect to an arbitrary user-provided comparator. Users of the minSort utility previously had to sort their input graphs according to their desired ordering, but now they can simply provide their comparator instead. Take advantage of the new functionality in ReorderGlobals and also standardize on a single data type for representing dependence graphs to avoid unnecessary conversions. Together, these changes slightly speed up ReorderGlobals. Move the topological sort code previously in a .cpp file into the header so the comparator can be provided as a lambda template parameter instead of as a `std::function`. This makes ReorderGlobals about 5% faster.
Diffstat (limited to 'src/wasm/wasm-stack.cpp')
0 files changed, 0 insertions, 0 deletions