-> 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
- trace ("\n" ++ what ++ " after normalization:\n\n" ++ showSDoc ( ppr expr')) $ return ()
- return expr'
+ endcount <- MonadState.get tsTransformCounter
+ trace ("\n" ++ what ++ " after normalization:\n\n" ++ showSDoc ( ppr expr')
+ ++ "\nNeeded " ++ show (endcount - startcount) ++ " transformations to normalize " ++ what) $
+ return expr'
-- | Split a normalized expression into the argument binders, top level
-- bindings and the result binder.