diff options
author | Bartosz Nitka <niteria@gmail.com> | 2016-06-14 03:28:30 -0700 |
---|---|---|
committer | Bartosz Nitka <niteria@gmail.com> | 2016-06-23 07:53:12 -0700 |
commit | 35d1564cea2e611a4fecf24f09eff83f8a55af1c (patch) | |
tree | 5d46f89500052d356bf68e2befd6bf854550193a /compiler/codeGen | |
parent | 7fc20b02b20c97209b97f0e36d34a4ef40f537a4 (diff) | |
download | haskell-35d1564cea2e611a4fecf24f09eff83f8a55af1c.tar.gz |
Provide Uniquable version of SCC
We want to remove the `Ord Unique` instance because there's
no way to implement it in deterministic way and it's too
easy to use by accident.
We sometimes compute SCC for datatypes whose Ord instance
is implemented in terms of Unique. The Ord constraint on
SCC is just an artifact of some internal data structures.
We can have an alternative implementation with a data
structure that uses Uniquable instead.
This does exactly that and I'm pleased that I didn't have
to introduce any duplication to do that.
Test Plan:
./validate
I looked at performance tests and it's a tiny bit better.
Reviewers: bgamari, simonmar, ezyang, austin, goldfire
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2359
GHC Trac Issues: #4012
Diffstat (limited to 'compiler/codeGen')
-rw-r--r-- | compiler/codeGen/StgCmmUtils.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/codeGen/StgCmmUtils.hs b/compiler/codeGen/StgCmmUtils.hs index 86c03ac2c4..5d6710197b 100644 --- a/compiler/codeGen/StgCmmUtils.hs +++ b/compiler/codeGen/StgCmmUtils.hs @@ -411,7 +411,7 @@ unscramble dflags vertices = mapM_ do_component components stmt1 `mustFollow` stmt2 ] components :: [SCC Vrtx] - components = stronglyConnCompFromEdgedVertices edges + components = stronglyConnCompFromEdgedVerticesUniq edges -- do_components deal with one strongly-connected component -- Not cyclic, or singleton? Just do it |