summaryrefslogtreecommitdiff
path: root/compiler/coreSyn/CoreUtils.hs
diff options
context:
space:
mode:
authorTobias Dammers <tdammers@gmail.com>2018-01-25 20:33:58 +0100
committerTobias Dammers <tdammers@gmail.com>2018-04-20 10:33:00 +0200
commit03ed25a8f228c2f6d56793bc45f5709b9afb02c7 (patch)
treed8c706c85b1cc601215d11b623f35c7592ba7ef0 /compiler/coreSyn/CoreUtils.hs
parent8f4ee8d5a349bc2395eafb4f45fd26e7f547f1d8 (diff)
downloadhaskell-wip/tdammers/D4394-squash.tar.gz
Cache coercion roles in NthCowip/tdammers/D4394-squash
Most callers of mkNthCo know the role of the coercion they are trying to make. So instead of calculating this role, we pass it in, forcing the caller to calculate it when needed. This introduces a performance regression in perf/compiler/T9872d.
Diffstat (limited to 'compiler/coreSyn/CoreUtils.hs')
-rw-r--r--compiler/coreSyn/CoreUtils.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs
index 5608afc334..1e8a7304a1 100644
--- a/compiler/coreSyn/CoreUtils.hs
+++ b/compiler/coreSyn/CoreUtils.hs
@@ -257,7 +257,7 @@ applyTypeToArgs e op_ty args
-- | Wrap the given expression in the coercion safely, dropping
-- identity coercions and coalescing nested coercions
-mkCast :: CoreExpr -> Coercion -> CoreExpr
+mkCast :: CoreExpr -> CoercionR -> CoreExpr
mkCast e co
| ASSERT2( coercionRole co == Representational
, text "coercion" <+> ppr co <+> ptext (sLit "passed to mkCast")