summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-01-04 13:09:54 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2017-01-05 08:51:23 +0000
commit266464186cfd1c575dd3ffa188589eceb12dc66b (patch)
tree092d5f4b1f587d25136c0bdd07c6dc5f200e1574
parentdf723689c415573fa6c7d83663758154fa7dc46f (diff)
downloadhaskell-266464186cfd1c575dd3ffa188589eceb12dc66b.tar.gz
Remove a redundant test
postInlineUnconditionally was testing for isExportedId, but it was /also/ testing for top-level-ness, which is redundant. This patch just removes the redundant test, and documents it.
-rw-r--r--compiler/simplCore/SimplUtils.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/simplCore/SimplUtils.hs b/compiler/simplCore/SimplUtils.hs
index 03adfe00fa..5f600420ad 100644
--- a/compiler/simplCore/SimplUtils.hs
+++ b/compiler/simplCore/SimplUtils.hs
@@ -1155,7 +1155,6 @@ postInlineUnconditionally dflags env top_lvl bndr occ_info rhs unfolding
| not active = False
| isWeakLoopBreaker occ_info = False -- If it's a loop-breaker of any kind, don't inline
-- because it might be referred to "earlier"
- | isExportedId bndr = False
| isStableUnfolding unfolding = False -- Note [Stable unfoldings and postInlineUnconditionally]
| isTopLevel top_lvl = False -- Note [Top level and postInlineUnconditionally]
| exprIsTrivial rhs = True
@@ -1249,6 +1248,10 @@ ones that are trivial):
* The inliner should inline trivial things at call sites anyway.
+ * The Id might be exported. We could check for that separately,
+ but since we aren't going to postInlineUnconditinoally /any/
+ top-level bindings, we don't need to test.
+
Note [Stable unfoldings and postInlineUnconditionally]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do not do postInlineUnconditionally if the Id has an stable unfolding,