Skip to content

Commit 280a87e

Browse files
committed
Add SCCs to Profile PlutusTx Plugin Steps
1 parent 021b068 commit 280a87e

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
@@ -550,26 +550,30 @@ runCompiler moduleName opts expr = do
550550
(opts ^. posInlineConstants)
551551

552552
-- GHC.Core -> Pir translation.
553-
pirT <- original <$> (PIR.runDefT annMayInline $ compileExprWithDefs expr)
553+
pirT <- {-# SCC "plinth-plugin-core-to-pir-step" #-}
554+
original <$> (PIR.runDefT annMayInline $ compileExprWithDefs expr)
554555
let pirP = PIR.Program noProvenance plcVersion pirT
555556
when (opts ^. posDumpPir) . liftIO $
556557
dumpFlat (void pirP) "initial PIR program" (moduleName ++ "_initial.pir-flat")
557558

558559
-- Pir -> (Simplified) Pir pass. We can then dump/store a more legible PIR program.
559-
spirP <- flip runReaderT pirCtx $ PIR.compileToReadable pirP
560+
spirP <- {-# SCC "plinth-plugin-pir-to-simp-step" #-}
561+
flip runReaderT pirCtx $ PIR.compileToReadable pirP
560562
when (opts ^. posDumpPir) . liftIO $
561563
dumpFlat (void spirP) "simplified PIR program" (moduleName ++ "_simplified.pir-flat")
562564

563565
-- (Simplified) Pir -> Plc translation.
564-
plcP <- flip runReaderT pirCtx $ PIR.compileReadableToPlc spirP
566+
plcP <- {-# SCC "plinth-plugin-simp-to-plc-step" #-}
567+
flip runReaderT pirCtx $ PIR.compileReadableToPlc spirP
565568
when (opts ^. posDumpPlc) . liftIO $
566569
dumpFlat (void plcP) "typed PLC program" (moduleName ++ ".tplc-flat")
567570

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

572-
uplcP <- flip runReaderT plcOpts $ PLC.compileProgram plcP
575+
uplcP <- {-# SCC "plinth-plugin-plc-to-uplc-step" #-}
576+
flip runReaderT plcOpts $ PLC.compileProgram plcP
573577
dbP <- liftExcept $ traverseOf UPLC.progTerm UPLC.deBruijnTerm uplcP
574578
when (opts ^. posDumpUPlc) . liftIO $
575579
dumpFlat

0 commit comments

Comments
 (0)