summaryrefslogtreecommitdiff
path: root/compiler/GHC/Data/UnionFind.hs
Commit message (Collapse)AuthorAgeFilesLines
* Code Gen: Use more efficient block merging algorithmMatthew Pickering2021-09-171-0/+91
The previous algorithm scaled poorly when there was a large number of blocks and edges. The algorithm links together block chains which have edges between them in the CFG. The new algorithm uses a union find data structure in order to efficiently merge together blocks and calculate which block chain each block id belonds to. I copied the UnionFind data structure which already existed in Cabal into the GHC library rathert than reimplement it myself. This change results in a very significant reduction in allocations when compiling the mmark package. Ticket: #19471