diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-03-05 20:44:57 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-03-11 20:33:37 -0400 |
commit | a6989971379c26d8c288551d536149675e009e34 (patch) | |
tree | 3cf1f5db8494cb6408461679dc9bcd9f4d5a938d /compiler/GHC/CoreToStg.hs | |
parent | bc41e47123b205a45385a3aa69de97ce22686423 (diff) | |
download | haskell-a6989971379c26d8c288551d536149675e009e34.tar.gz |
Use a Set to represent Ways
Should make `member` queries faster and avoid messing up with missing
`nubSort`.
Metric Increase:
hie002
Diffstat (limited to 'compiler/GHC/CoreToStg.hs')
-rw-r--r-- | compiler/GHC/CoreToStg.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/GHC/CoreToStg.hs b/compiler/GHC/CoreToStg.hs index bfda490b85..55771b30a9 100644 --- a/compiler/GHC/CoreToStg.hs +++ b/compiler/GHC/CoreToStg.hs @@ -42,6 +42,7 @@ import MonadUtils import FastString import Util import GHC.Driver.Session +import GHC.Driver.Ways import ForeignCall import Demand ( isUsedOnce ) import PrimOp ( PrimCall(..), primOpWrapperId ) @@ -51,6 +52,7 @@ import PrelNames ( unsafeEqualityProofName ) import Data.List.NonEmpty (nonEmpty, toList) import Data.Maybe (fromMaybe) import Control.Monad (ap) +import qualified Data.Set as Set -- Note [Live vs free] -- ~~~~~~~~~~~~~~~~~~~ @@ -230,7 +232,7 @@ coreToStg dflags this_mod pgm (_, (local_ccs, local_cc_stacks), pgm') = coreTopBindsToStg dflags this_mod emptyVarEnv emptyCollectedCCs pgm - prof = WayProf `elem` ways dflags + prof = WayProf `Set.member` ways dflags final_ccs | prof && gopt Opt_AutoSccsOnIndividualCafs dflags |