[commit: ghc] wip/T16039: better tracing (8db91a7)

git at git.haskell.org git at git.haskell.org
Sun Mar 31 15:07:41 UTC 2019


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/T16039
Link       : http://ghc.haskell.org/trac/ghc/changeset/8db91a7da4e749427b005346dec6f0554de6ee33/ghc

>---------------------------------------------------------------

commit 8db91a7da4e749427b005346dec6f0554de6ee33
Author: Gabor Greif <ggreif at gmail.com>
Date:   Sun Jan 6 00:13:22 2019 +0100

    better tracing


>---------------------------------------------------------------

8db91a7da4e749427b005346dec6f0554de6ee33
 compiler/coreSyn/CoreUtils.hs  | 6 +++---
 compiler/simplCore/FloatOut.hs | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs
index ea3fe01..87e36b9 100644
--- a/compiler/coreSyn/CoreUtils.hs
+++ b/compiler/coreSyn/CoreUtils.hs
@@ -955,14 +955,14 @@ it off at source.
 
 exprIsTrivial :: CoreExpr -> Bool
 -- If you modify this function, you may also
--- need to modify getIdFromTrivialExpr
+-- need to modify getIdFromTrivialExpr -- TODO
 exprIsTrivial (Var _)          = True        -- See Note [Variables are trivial]
 exprIsTrivial (Type _)         = True
 exprIsTrivial (Coercion _)     = True
 exprIsTrivial (Lit lit)        = litIsTrivial lit
 exprIsTrivial (App e arg)
  | App (Var f) Type {} <- e
- , f `hasKey` noinlineIdKey    = pprTrace "exprIsTrivial" (ppr arg) exprIsTrivial arg
+ , f `hasKey` noinlineIdKey    = pprTrace "exprIsTrivial #%#" (ppr f <+> ppr arg) exprIsTrivial arg
  | not (isRuntimeArg arg)      = exprIsTrivial e
  | otherwise                   = False
 exprIsTrivial (Lam b e)        = not (isRuntimeVar b) && exprIsTrivial e
@@ -1244,7 +1244,7 @@ exprIsCheapX ok_app e
                     | otherwise       = go n e
     go n (App f e)  | App (Var v) Type {} <- f
                     , v `hasKey` noinlineIdKey
-                    , isRuntimeArg e  = pprTrace "exprIsCheapX" (ppr e) go n e
+                    , isRuntimeArg e  = pprTrace "exprIsCheapX $#%#" (ppr v <+> ppr e) go n e
     go n (App f e)  | isRuntimeArg e  = go (n+1) f && ok e
                     | otherwise       = go n f
     go n (Let (NonRec _ r) e)         = go n e && ok r
diff --git a/compiler/simplCore/FloatOut.hs b/compiler/simplCore/FloatOut.hs
index 4a1ab68..660619f 100644
--- a/compiler/simplCore/FloatOut.hs
+++ b/compiler/simplCore/FloatOut.hs
@@ -397,12 +397,12 @@ floatExpr (Var v)   = (zeroStats, emptyFloats, Var v)
 floatExpr (Type ty) = (zeroStats, emptyFloats, Type ty)
 floatExpr (Coercion co) = (zeroStats, emptyFloats, Coercion co)
 floatExpr (Lit lit) = (zeroStats, emptyFloats, Lit lit)
-
+{-
 floatExpr (App (App (Var v) _) e)
                     | v `hasKey` noinlineIdKey
                     , pprTrace "floatExpr" (ppr e) False
                     = undefined
-
+-}
 floatExpr (App e a)
   = case (atJoinCeiling $ floatExpr  e) of { (fse, floats_e, e') ->
     case (atJoinCeiling $ floatExpr  a) of { (fsa, floats_a, a') ->



More information about the ghc-commits mailing list