Skip to content

Commit baca2f2

Browse files
committed
Add SCCs to Profile PlutusTx Plugin Steps
1 parent 49de239 commit baca2f2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

plutus-tx-plugin/src/PlutusTx/Plugin.hs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -555,26 +555,30 @@ runCompiler moduleName opts expr = do
555555
(opts ^. posInlineConstants)
556556

557557
-- GHC.Core -> Pir translation.
558-
pirT <- original <$> (PIR.runDefT annMayInline $ compileExprWithDefs expr)
558+
pirT <- {-# SCC "plinth-plugin-core-to-pir-step" #-}
559+
original <$> (PIR.runDefT annMayInline $ compileExprWithDefs expr)
559560
let pirP = PIR.Program noProvenance plcVersion pirT
560561
when (opts ^. posDumpPir) . liftIO $
561562
dumpFlat (void pirP) "initial PIR program" (moduleName ++ "_initial.pir-flat")
562563

563564
-- Pir -> (Simplified) Pir pass. We can then dump/store a more legible PIR program.
564-
spirP <- flip runReaderT pirCtx $ PIR.compileToReadable pirP
565+
spirP <- {-# SCC "plinth-plugin-pir-to-simp-step" #-}
566+
flip runReaderT pirCtx $ PIR.compileToReadable pirP
565567
when (opts ^. posDumpPir) . liftIO $
566568
dumpFlat (void spirP) "simplified PIR program" (moduleName ++ "_simplified.pir-flat")
567569

568570
-- (Simplified) Pir -> Plc translation.
569-
plcP <- flip runReaderT pirCtx $ PIR.compileReadableToPlc spirP
571+
plcP <- {-# SCC "plinth-plugin-simp-to-plc-step" #-}
572+
flip runReaderT pirCtx $ PIR.compileReadableToPlc spirP
570573
when (opts ^. posDumpPlc) . liftIO $
571574
dumpFlat (void plcP) "typed PLC program" (moduleName ++ ".tplc-flat")
572575

573576
-- We do this after dumping the programs so that if we fail typechecking we still get the dump.
574577
when (opts ^. posDoTypecheck) . void $
575578
liftExcept $ PLC.inferTypeOfProgram plcTcConfig (plcP $> annMayInline)
576579

577-
uplcP <- flip runReaderT plcOpts $ PLC.compileProgram plcP
580+
uplcP <- {-# SCC "plinth-plugin-plc-to-uplc-step" #-}
581+
flip runReaderT plcOpts $ PLC.compileProgram plcP
578582
dbP <- liftExcept $ traverseOf UPLC.progTerm UPLC.deBruijnTerm uplcP
579583
when (opts ^. posDumpUPlc) . liftIO $
580584
dumpFlat

0 commit comments

Comments
 (0)