Skip to content

Commit

Permalink
Turn back on sm_pre_inline.
Browse files Browse the repository at this point in the history
  • Loading branch information
thealmarty committed May 2, 2023
1 parent c09ba19 commit 3d707d0
Show file tree
Hide file tree
Showing 9 changed files with 407 additions and 481 deletions.
4 changes: 2 additions & 2 deletions plutus-tx-plugin/src/PlutusTx/Plugin.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ViewPatterns #-}
-- For some reason this module is very slow to compile otherwise
{-# OPTIONS_GHC -O0 #-}
{-# OPTIONS_GHC -fforce-recomp -O0 #-}
module PlutusTx.Plugin (plugin, plc) where

import Data.Bifunctor
Expand Down Expand Up @@ -165,7 +165,7 @@ mkSimplPass flags logger =
, GHC.sm_rules = False
, GHC.sm_cast_swizzle = True
-- See Note [GHC.sm_pre_inline]
, GHC.sm_pre_inline = False
, GHC.sm_pre_inline = True
, GHC.sm_logger = logger
-- You might think you would need this, but apparently not
, GHC.sm_inline = False
Expand Down
8 changes: 1 addition & 7 deletions plutus-tx-plugin/test/Optimization/trueOrError.plc.golden
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
(program
1.1.0
[
(lam ds_i0 (delay (lam case_True_i0 (lam case_False_i0 case_True_i2))))
(error )
]
)
(program 1.1.0 [ (lam ds_i0 (constr 0)) (error ) ])
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
(program
1.1.0
[
(lam ds_i0 (delay (lam case_True_i0 (lam case_False_i0 case_True_i2))))
(error )
]
)
(program 1.1.0 [ (lam ds_i0 (constr 0)) (error ) ])
345 changes: 161 additions & 184 deletions plutus-tx-plugin/test/Plugin/Coverage/coverageCode.plc.golden

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
1.1.0
(let
(nonrec)
(termbind (strict) (vardecl z (con integer)) (con integer 2))
(termbind (strict) (vardecl y (con integer)) (con integer 1))
(datatypebind
(datatype
(tyvardecl Tuple2 (fun (type) (fun (type) (type))))
Expand Down Expand Up @@ -40,6 +38,12 @@
(vardecl mkT (fun [ [ Tuple2 (con integer) ] (con integer) ] T))
(lam ds [ [ Tuple2 (con integer) ] (con integer) ] [ WMkT ds ])
)
[ mkT [ [ { { Tuple2 (con integer) } (con integer) } z ] y ] ]
[
mkT
[
[ { { Tuple2 (con integer) } (con integer) } (con integer 2) ]
(con integer 1)
]
]
)
)
174 changes: 70 additions & 104 deletions plutus-tx-plugin/test/Plugin/Data/recursive/sameEmptyRose.plc.golden
Original file line number Diff line number Diff line change
Expand Up @@ -24,62 +24,15 @@
EmptyRose_match_i0
[
(lam
f_i0
tup_i0
[
(lam
g_i0
map_i0
[
(lam
tup_i0
[
(lam
map_i0
[
(lam
tup_i0
[
(lam go_i0 go_i1)
[
(force tup_i1)
(lam
arg_0_i0 arg_0_i1
)
]
]
)
(delay
(lam
f_i0
[
f_i1
[
(force
(force fix1_i11)
)
(lam
go_i0
(lam
x_i0
[
g_i6
[
[
map_i4
go_i2
]
[
f_i7 x_i1
]
]
]
)
)
]
]
)
)
]
)
(lam go_i0 go_i1)
[
(force tup_i1)
(lam arg_0_i0 arg_0_i1)
Expand All @@ -94,57 +47,24 @@
[
(force (force fix1_i9))
(lam
map_i0
go_i0
(lam
ds_i0
(lam
ds_i0
(force
x_i0
[
EmptyRose_i7
[
[ map_i4 go_i2 ]
[
[
(force
[
(force
Nil_match_i9
)
ds_i1
]
)
(delay
(force
Nil_i11
)
)
]
(lam
x_i0
(lam
xs_i0
(delay
[
[
(force
Cons_i12
)
[
ds_i4
x_i2
]
]
[
[
map_i5
ds_i4
]
xs_i1
]
]
)
)
(force
[
EmptyRose_match_i6
x_i1
]
)
(lam x_i0 x_i1)
]
)
)
]
]
)
)
]
Expand All @@ -153,15 +73,61 @@
)
]
)
(lam ds_i0 [ EmptyRose_i4 ds_i1 ])
[
(force tup_i1) (lam arg_0_i0 arg_0_i1)
]
]
)
(lam
ds_i0
[
(force [ EmptyRose_match_i2 ds_i1 ])
(lam x_i0 x_i1)
]
(delay
(lam
f_i0
[
f_i1
[
(force (force fix1_i7))
(lam
map_i0
(lam
ds_i0
(lam
ds_i0
(force
[
[
(force
[
(force Nil_match_i7)
ds_i1
]
)
(delay (force Nil_i9))
]
(lam
x_i0
(lam
xs_i0
(delay
[
[
(force Cons_i10)
[ ds_i4 x_i2 ]
]
[
[ map_i5 ds_i4 ]
xs_i1
]
]
)
)
)
]
)
)
)
)
]
]
)
)
]
)
Expand Down
75 changes: 39 additions & 36 deletions plutus-tx-plugin/test/Plugin/Functions/recursive/even.plc.golden
Original file line number Diff line number Diff line change
Expand Up @@ -49,50 +49,53 @@
)
(let
(rec)
(termbind
(strict)
(vardecl odd (fun (con integer) Bool))
(lam
n
(con integer)
{
[
[
{
[ Bool_match [ [ equalsInteger n ] (con integer 0) ] ]
(all dead (type) Bool)
}
(abs dead (type) False)
]
(abs
dead (type) [ even [ [ subtractInteger n ] (con integer 1) ] ]
)
]
(all dead (type) dead)
}
)
)
(termbind
(strict)
(vardecl even (fun (con integer) Bool))
(lam
n
(con integer)
{
[
(let
(nonrec)
(termbind
(nonstrict)
(vardecl n (con integer))
[ [ subtractInteger n ] (con integer 1) ]
)
{
[
{
[ Bool_match [ [ equalsInteger n ] (con integer 0) ] ]
(all dead (type) Bool)
}
(abs dead (type) True)
[
{
[ Bool_match [ [ equalsInteger n ] (con integer 0) ] ]
(all dead (type) Bool)
}
(abs dead (type) True)
]
(abs
dead
(type)
{
[
[
{
[ Bool_match [ [ equalsInteger n ] (con integer 0) ] ]
(all dead (type) Bool)
}
(abs dead (type) False)
]
(abs
dead
(type)
[ even [ [ subtractInteger n ] (con integer 1) ] ]
)
]
(all dead (type) dead)
}
)
]
(abs
dead (type) [ odd [ [ subtractInteger n ] (con integer 1) ] ]
)
]
(all dead (type) dead)
}
(all dead (type) dead)
}
)
)
)
even
Expand Down
Loading

0 comments on commit 3d707d0

Please sign in to comment.