Show number of transformations per function.
authorMatthijs Kooijman <matthijs@stdin.nl>
Wed, 31 Mar 2010 12:22:29 +0000 (14:22 +0200)
committerMatthijs Kooijman <matthijs@stdin.nl>
Wed, 31 Mar 2010 12:22:29 +0000 (14:22 +0200)
cλash/CLasH/Normalize.hs

index 180ac3191868a836cacab096fbed1258cb39a4ae..2b5c8999147c03662ff5bf806cab27af9e992ff3 100644 (file)
@@ -850,11 +850,14 @@ normalizeExpr ::
   -> TranslatorSession CoreSyn.CoreExpr -- ^ The normalized expression
 
 normalizeExpr what expr = do
   -> TranslatorSession CoreSyn.CoreExpr -- ^ The normalized expression
 
 normalizeExpr what expr = do
+      startcount <- MonadState.get tsTransformCounter 
       expr_uniqued <- genUniques expr
       -- Normalize this expression
       trace (what ++ " before normalization:\n\n" ++ showSDoc ( ppr expr_uniqued ) ++ "\n") $ return ()
       expr' <- dotransforms transforms expr_uniqued
       expr_uniqued <- genUniques expr
       -- Normalize this expression
       trace (what ++ " before normalization:\n\n" ++ showSDoc ( ppr expr_uniqued ) ++ "\n") $ return ()
       expr' <- dotransforms transforms expr_uniqued
+      endcount <- MonadState.get tsTransformCounter 
       trace ("\n" ++ what ++ " after normalization:\n\n" ++ showSDoc ( ppr expr')) $ return ()
       trace ("\n" ++ what ++ " after normalization:\n\n" ++ showSDoc ( ppr expr')) $ return ()
+      trace ("\nNeeded " ++ show (endcount - startcount) ++ " transformations to normalize " ++ what) $ return ()
       return expr'
 
 -- | Split a normalized expression into the argument binders, top level
       return expr'
 
 -- | Split a normalized expression into the argument binders, top level