From d7758da490db3cc662dbebdac4397b4b2c38d0f0 Mon Sep 17 00:00:00 2001 From: Sebastian Graf Date: Tue, 22 Jun 2021 14:02:49 +0200 Subject: Simplifier: Do Cast W/W for INLINE strong loop-breakers Strong loop-breakers never inline, INLINE pragma or not. Hence they should be treated as if there was no INLINE pragma on them. Also not doing Cast W/W for INLINE strong loop-breakers will trip up Strictness W/W, because it treats them as if there was no INLINE pragma. Subsequently, that will lead to a panic once Strictness W/W will no longer do eta-expansion, as we discovered while implementing !5814. I also renamed to `unfoldingInfo` to `realUnfoldingInfo` and redefined `unfoldingInfo` to zap the unfolding it returns in case of a strong loop-breaker. Now the naming and semantics is symmetrical to `idUnfolding`/`realIdUnfolding`. Now there was no more reason for `hasInlineUnfolding` to operate on `Id`, because the zapping of strong loop-breaker unfoldings moved from `idUnfolding` to `unfoldingInfo`, so I refactored it to take `IdInfo` and call it both from the Simplifier and WorkWrap, making it utterly clear that both checks are equivalent. --- compiler/GHC/Core/Subst.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/GHC/Core/Subst.hs') diff --git a/compiler/GHC/Core/Subst.hs b/compiler/GHC/Core/Subst.hs index 3d93084fc4..36f3bad0d4 100644 --- a/compiler/GHC/Core/Subst.hs +++ b/compiler/GHC/Core/Subst.hs @@ -626,7 +626,7 @@ substIdInfo subst new_id info `setUnfoldingInfo` substUnfolding subst old_unf) where old_rules = ruleInfo info - old_unf = unfoldingInfo info + old_unf = realUnfoldingInfo info nothing_to_do = isEmptyRuleInfo old_rules && not (hasCoreUnfolding old_unf) ------------------ -- cgit v1.2.1