Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add improvements to the PIR compiler #3655

Merged
merged 1 commit into from
Aug 5, 2021
Merged

Conversation

jakzale
Copy link
Contributor

@jakzale jakzale commented Jul 30, 2021

  • pedantic typechecking will typecheck between simplifier passes,
  • add option for being verbose about simplifier passes,
  • add option for dumping PIR to stdout before and after a pass,
  • add option for specifying max number of iterations,
  • add option for controlling each simplifier pass,
  • run the simplifier 8 times by default.

Pre-submit checklist:

  • Branch
    • Commit sequence broadly makes sense
    • Key commits have useful messages
    • Relevant tickets are mentioned in commit messages
    • Formatting, materialized Nix files, PNG optimization, etc. are updated
  • PR
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

@@ -44,6 +44,8 @@ import Data.Proxy
import Data.Text.Prettyprint.Doc
import qualified Data.Typeable as GHC

type PrettyPrintable uni fun = ( PLC.GShow uni, PLC.Closed uni, uni `PLC.Everywhere` PrettyConst, Pretty fun)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@effectfully I was thinking about adding such constraint somewhere, do you thing it is sufficient?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe from PlutusCore.Core?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michaelpj, I think I will leave this to a subsequent PR.

plutus-core/plutus-ir/src/PlutusIR/Compiler.hs Outdated Show resolved Hide resolved
plutus-core/plutus-ir/src/PlutusIR/Compiler.hs Outdated Show resolved Hide resolved
plutus-core/plutus-ir/src/PlutusIR/Compiler.hs Outdated Show resolved Hide resolved
plutus-core/plutus-ir/src/PlutusIR/Compiler.hs Outdated Show resolved Hide resolved
plutus-core/plutus-ir/src/PlutusIR/Compiler/Types.hs Outdated Show resolved Hide resolved
plutus-tx-plugin/plutus-tx-plugin.cabal Outdated Show resolved Hide resolved
plutus-tx-plugin/plutus-tx-plugin.cabal Outdated Show resolved Hide resolved
plutus-tx-plugin/src/PlutusTx/Plugin.hs Outdated Show resolved Hide resolved
@jakzale jakzale force-pushed the jakzale/pir-compiler branch 3 times, most recently from 597960b to ddc169d Compare August 4, 2021 21:07
@jakzale jakzale marked this pull request as ready for review August 4, 2021 21:08
@jakzale jakzale requested a review from michaelpj August 4, 2021 21:08
- pedantic typechecking will typecheck between simplifier passes,
- add option for being verbose about simplifier passes,
- add option for dumping PIR to stdout before and after a pass,
- add option for specifying max number of iterations,
- add option for controlling each simplifier pass,
- run the simplifier 8 times by default.
)
=> a -> m (UPLC.Term UPLC.NamedDeBruijn uni fun ())
safeLift x = do
lifted <- liftQuote $ runDefT () $ Lift.lift x
tcConfig <- PLC.getDefTypeCheckConfig $ Original ()
compiled <- flip runReaderT (toDefaultCompilationCtx tcConfig) $ compileTerm lifted
-- NOTE: Disabling simplifier, as it takes a lot of time during runtime
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this true? Or is this only true when we inline types? I think we should turn this back on again, but I want to merge this so let's do it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants