From 35d1564cea2e611a4fecf24f09eff83f8a55af1c Mon Sep 17 00:00:00 2001 From: Bartosz Nitka Date: Tue, 14 Jun 2016 03:28:30 -0700 Subject: 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 --- compiler/nativeGen/RegAlloc/Linear/JoinToTargets.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/nativeGen/RegAlloc/Linear') diff --git a/compiler/nativeGen/RegAlloc/Linear/JoinToTargets.hs b/compiler/nativeGen/RegAlloc/Linear/JoinToTargets.hs index 07ff1ca887..ac38e2b450 100644 --- a/compiler/nativeGen/RegAlloc/Linear/JoinToTargets.hs +++ b/compiler/nativeGen/RegAlloc/Linear/JoinToTargets.hs @@ -169,7 +169,7 @@ joinToTargets_again -- -- We need to do the R2 -> R3 move before R1 -> R2. -- - let sccs = stronglyConnCompFromEdgedVerticesR graph + let sccs = stronglyConnCompFromEdgedVerticesOrdR graph {- -- debugging pprTrace @@ -313,7 +313,7 @@ handleComponent delta instr instrLoad <- loadR (RegReal dreg) slot remainingFixUps <- mapM (handleComponent delta instr) - (stronglyConnCompFromEdgedVerticesR rest) + (stronglyConnCompFromEdgedVerticesOrdR rest) -- make sure to do all the reloads after all the spills, -- so we don't end up clobbering the source values. -- cgit v1.2.1