From 266464186cfd1c575dd3ffa188589eceb12dc66b Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Wed, 4 Jan 2017 13:09:54 +0000 Subject: 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. --- 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 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, -- cgit v1.2.1