[commit: ghc] master: Remove a redundant test (2664641)

git at git.haskell.org git at git.haskell.org
Thu Jan 5 08:52:33 UTC 2017


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/266464186cfd1c575dd3ffa188589eceb12dc66b/ghc

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

commit 266464186cfd1c575dd3ffa188589eceb12dc66b
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Jan 4 13:09:54 2017 +0000

    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.


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

266464186cfd1c575dd3ffa188589eceb12dc66b
 compiler/simplCore/SimplUtils.hs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/compiler/simplCore/SimplUtils.hs b/compiler/simplCore/SimplUtils.hs
index 03adfe0..5f60042 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,



More information about the ghc-commits mailing list