summaryrefslogtreecommitdiff
path: root/compiler/GHC/StgToByteCode.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2021-04-15 15:20:26 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-04-26 23:56:53 -0400
commit6c7fff0b6f9514d6572cbe6bbfa4aafc259caebe (patch)
treebefd67e0d63bef6c6aee6b318e4ef6e287a62797 /compiler/GHC/StgToByteCode.hs
parent06654a6e0e4c1f9eb58947439092ae27b00d8c10 (diff)
downloadhaskell-6c7fff0b6f9514d6572cbe6bbfa4aafc259caebe.tar.gz
Eliminate unsafeEqualityProof in CorePrep
The main idea here is to avoid treating * case e of {} * case unsafeEqualityProof of UnsafeRefl co -> blah specially in CoreToStg. Instead, nail them in CorePrep, by converting case e of {} ==> e |> unsafe-co case unsafeEqualityProof of UnsafeRefl cv -> blah ==> blah[unsafe-co/cv] in GHC.Core.Prep. Now expressions that we want to treat as trivial really are trivial. We can get rid of cpExprIsTrivial. And we fix #19700. A downside is that, at least under unsafeEqualityProof, we substitute in types and coercions, which is more work. But a big advantage is that it's all very simple and principled: CorePrep really gets rid of the unsafeCoerce stuff, as it does empty case, runRW#, lazyId etc. I've updated the overview in GHC.Core.Prep, and added Note [Unsafe coercions] in GHC.Core.Prep Note [Implementing unsafeCoerce] in base:Unsafe.Coerce We get 3% fewer bytes allocated when compiling perf/compiler/T5631, which uses a lot of unsafeCoerces. (It's a happy-generated parser.) Metric Decrease: T5631
Diffstat (limited to 'compiler/GHC/StgToByteCode.hs')
-rw-r--r--compiler/GHC/StgToByteCode.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/StgToByteCode.hs b/compiler/GHC/StgToByteCode.hs
index cf4f9c7f3c..04eb52d7c0 100644
--- a/compiler/GHC/StgToByteCode.hs
+++ b/compiler/GHC/StgToByteCode.hs
@@ -466,7 +466,7 @@ schemeR :: [Id] -- Free vars of the RHS, ordered as they
schemeR fvs (nm, rhs)
= schemeR_wrk fvs nm rhs (collect rhs)
--- If an expression is a lambda (after apply bcView), return the
+-- If an expression is a lambda, return the
-- list of arguments to the lambda (in R-to-L order) and the
-- underlying expression