summaryrefslogtreecommitdiff
path: root/compiler/simplStg
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2016-09-20 00:19:15 -0400
committerÖmer Sinan Ağacan <omeragacan@gmail.com>2016-09-20 00:19:27 -0400
commit14c2e8e0c11bb2b95f81303284d1460bb80a9a98 (patch)
treeb9c67117f0e2f7f79037e9a07c20a0256800f5cc /compiler/simplStg
parentea310f9956179f91ca973bc747b0bc7b061bc174 (diff)
downloadhaskell-14c2e8e0c11bb2b95f81303284d1460bb80a9a98.tar.gz
Codegen for case: Remove redundant void id checks
New unarise (714bebf) eliminates void binders in patterns already, so no need to eliminate them here. I leave assertions to make sure this is the case. Assertion failure -> bug in unarise Reviewers: bgamari, simonpj, austin, simonmar, hvr Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2416
Diffstat (limited to 'compiler/simplStg')
-rw-r--r--compiler/simplStg/UnariseStg.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/compiler/simplStg/UnariseStg.hs b/compiler/simplStg/UnariseStg.hs
index 80848793fc..a393e8fae9 100644
--- a/compiler/simplStg/UnariseStg.hs
+++ b/compiler/simplStg/UnariseStg.hs
@@ -174,6 +174,20 @@ table for an Id may be larger than the idArity. Instead we record what we call
the RepArity, which is the Arity taking into account any expanded arguments, and
corresponds to the number of (possibly-void) *registers* arguments will arrive
in.
+
+Note [Post-unarisation invariants]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+STG programs after unarisation have these invariants:
+
+ * No unboxed sums at all.
+
+ * No unboxed tuple binders. Tuples only appear in return position.
+
+ * DataCon applications (StgRhsCon and StgConApp) don't have void arguments.
+ This means that it's safe to wrap `StgArg`s of DataCon applications with
+ `StgCmmEnv.NonVoid`, for example.
+
+ * Alt binders (binders in patterns) are always non-void.
-}
{-# LANGUAGE CPP, TupleSections #-}