summaryrefslogtreecommitdiff
path: root/compiler/ghc.cabal.in
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-09-15 13:09:17 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-09-17 09:44:53 -0400
commit53dc8e41a424909c8c3eccc43695fee0cdcc1555 (patch)
tree6d96a223f8a7f76053d15de09fc1e0eff0e3689b /compiler/ghc.cabal.in
parentb041ea7784f036dd7cfc5fae6380db4f3c392ab4 (diff)
downloadhaskell-53dc8e41a424909c8c3eccc43695fee0cdcc1555.tar.gz
Code Gen: Use more efficient block merging algorithm
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
Diffstat (limited to 'compiler/ghc.cabal.in')
-rw-r--r--compiler/ghc.cabal.in1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in
index 2023fbe3da..b1acf005da 100644
--- a/compiler/ghc.cabal.in
+++ b/compiler/ghc.cabal.in
@@ -407,6 +407,7 @@ Library
GHC.Data.Strict
GHC.Data.StringBuffer
GHC.Data.TrieMap
+ GHC.Data.UnionFind
GHC.Driver.Backend
GHC.Driver.Backpack
GHC.Driver.Backpack.Syntax