Skip to content

Commit

Permalink
Experiment with optimization flags
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPenner committed Nov 26, 2024
1 parent e2cf40a commit eec7498
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
3 changes: 2 additions & 1 deletion unison-runtime/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ github: unisonweb/unison
copyright: Copyright (C) 2013-2024 Unison Computing, PBC and contributors

ghc-options: -fmax-worker-args=100 -Wall -funbox-strict-fields -O2
# -fsimpl-tick-factor=300 -fmax-simplifier-iterations=10 -fspecialise-aggressively -fexpose-all-unfoldings

flags:
arraychecks:
Expand All @@ -21,7 +22,7 @@ when:
- condition: flag(stackchecks)
cpp-options: -DSTACK_CHECK
- condition: flag(dumpcore)
ghc-options: -ddump-simpl -ddump-stg-final -ddump-to-file -dsuppress-coercions -dsuppress-idinfo -dsuppress-module-prefixes -ddump-str-signatures # -dsuppress-type-applications -dsuppress-type-signatures
ghc-options: -ddump-simpl -ddump-stg-final -ddump-to-file -dsuppress-coercions -dsuppress-idinfo -dsuppress-module-prefixes -ddump-str-signatures -ddump-simpl-stats # -dsuppress-type-applications -dsuppress-type-signatures

library:
source-dirs: src
Expand Down
19 changes: 9 additions & 10 deletions unison-runtime/src/Unison/Runtime/Machine.hs
Original file line number Diff line number Diff line change
Expand Up @@ -654,16 +654,15 @@ eval !env !denv !activeThreads !stk !k r (NMatch _mr i br) = do
n <- peekOffN stk i

eval env denv activeThreads stk k r $ selectBranch n br
eval !_env !_denv !_activeThreads !_stk !_k _r (RMatch _i _pu _br) = do
pure ()
-- (t, stk) <- dumpDataNoTag Nothing stk =<< peekOff stk i
-- if t == PackedTag 0
-- then eval env denv activeThreads stk k r pu
-- else case ANF.unpackTags t of
-- (ANF.rawTag -> e, ANF.rawTag -> t)
-- | Just ebs <- EC.lookup e br ->
-- eval env denv activeThreads stk k r $ selectBranch t ebs
-- | otherwise -> unhandledErr "eval" env e
eval !env !denv !activeThreads !stk !k r (RMatch i pu br) = do
(t, stk) <- dumpDataNoTag Nothing stk =<< peekOff stk i
if t == PackedTag 0
then eval env denv activeThreads stk k r pu
else case ANF.unpackTags t of
(ANF.rawTag -> e, ANF.rawTag -> t)
| Just ebs <- EC.lookup e br ->
eval env denv activeThreads stk k r $ selectBranch t ebs
| otherwise -> unhandledErr "eval" env e
eval !env !denv !activeThreads !stk !k _ (Yield args)
| asize stk > 0,
VArg1 i <- args =
Expand Down
8 changes: 4 additions & 4 deletions unison-runtime/unison-runtime.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ library
TypeApplications
TypeFamilies
ViewPatterns
ghc-options: -fmax-worker-args=100 -Wall -funbox-strict-fields -O2
ghc-options: -fsimpl-tick-factor=300 -fmax-simplifier-iterations=10 -fmax-worker-args=100 -Wall -funbox-strict-fields -fspecialise-aggressively -fexpose-all-unfoldings -O2
build-depends:
asn1-encoding
, asn1-types
Expand Down Expand Up @@ -147,7 +147,7 @@ library
if flag(stackchecks)
cpp-options: -DSTACK_CHECK
if flag(dumpcore)
ghc-options: -ddump-simpl -ddump-stg-final -ddump-to-file -dsuppress-coercions -dsuppress-idinfo -dsuppress-module-prefixes -ddump-str-signatures
ghc-options: -ddump-simpl -ddump-stg-final -ddump-to-file -dsuppress-coercions -dsuppress-idinfo -dsuppress-module-prefixes -ddump-str-signatures -ddump-simpl-stats

test-suite runtime-tests
type: exitcode-stdio-1.0
Expand Down Expand Up @@ -194,7 +194,7 @@ test-suite runtime-tests
TypeApplications
TypeFamilies
ViewPatterns
ghc-options: -fmax-worker-args=100 -Wall -funbox-strict-fields -O2 -W -threaded -rtsopts "-with-rtsopts=-N -T" -v0
ghc-options: -fsimpl-tick-factor=300 -fmax-simplifier-iterations=10 -fmax-worker-args=100 -Wall -funbox-strict-fields -fspecialise-aggressively -fexpose-all-unfoldings -O2 -W -threaded -rtsopts "-with-rtsopts=-N -T" -v0
build-depends:
base
, bytes
Expand Down Expand Up @@ -228,4 +228,4 @@ test-suite runtime-tests
if flag(stackchecks)
cpp-options: -DSTACK_CHECK
if flag(dumpcore)
ghc-options: -ddump-simpl -ddump-stg-final -ddump-to-file -dsuppress-coercions -dsuppress-idinfo -dsuppress-module-prefixes -ddump-str-signatures
ghc-options: -ddump-simpl -ddump-stg-final -ddump-to-file -dsuppress-coercions -dsuppress-idinfo -dsuppress-module-prefixes -ddump-str-signatures -ddump-simpl-stats

0 comments on commit eec7498

Please sign in to comment.