diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2020-10-08 13:01:47 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-10-14 18:06:48 -0400 |
commit | 15d2340cb9dc833adb87784e6de86dba235290f7 (patch) | |
tree | 38bf0e9e0f88e44e6bce91fb11d4ca7a1997e73d /testsuite/tests/roles | |
parent | e60ae8a38394370fd8818ad004a101466fc7d2dc (diff) | |
download | haskell-15d2340cb9dc833adb87784e6de86dba235290f7.tar.gz |
Fix some missed opportunities for preInlineUnconditionally
There are two signficant changes here:
* Ticket #18815 showed that we were missing some opportunities for
preInlineUnconditionally. The one-line fix is in the code for
GHC.Core.Opt.Simplify.Utils.preInlineUnconditionally, which now
switches off only for INLINE pragmas. I expanded
Note [Stable unfoldings and preInlineUnconditionally] to explain.
* When doing this I discovered a way in which preInlineUnconditionally
was occasionally /too/ eager. It's all explained in
Note [Occurrences in stable unfoldings] in GHC.Core.Opt.OccurAnal,
and the one-line change adding markAllMany to occAnalUnfolding.
I also got confused about what NoUserInline meant, so I've renamed
it to NoUserInlinePrag, and changed its pretty-printing slightly.
That led to soem error messate wibbling, and touches quite a few
files, but there is no change in functionality.
I did a nofib run. As expected, no significant changes.
Program Size Allocs
----------------------------------------
sphere -0.0% -0.4%
----------------------------------------
Min -0.0% -0.4%
Max -0.0% +0.0%
Geometric Mean -0.0% -0.0%
I'm allowing a max-residency increase for T10370, which seems
very irreproducible. (See comments on !4241.) There is always
sampling error for max-residency measurements; and in any case
the change shows up on some platforms but not others.
Metric Increase:
T10370
Diffstat (limited to 'testsuite/tests/roles')
-rw-r--r-- | testsuite/tests/roles/should_compile/Roles1.stderr | 45 | ||||
-rw-r--r-- | testsuite/tests/roles/should_compile/Roles14.stderr | 15 | ||||
-rw-r--r-- | testsuite/tests/roles/should_compile/Roles2.stderr | 16 | ||||
-rw-r--r-- | testsuite/tests/roles/should_compile/Roles3.stderr | 30 | ||||
-rw-r--r-- | testsuite/tests/roles/should_compile/Roles4.stderr | 23 | ||||
-rw-r--r-- | testsuite/tests/roles/should_compile/T8958.stderr | 27 |
6 files changed, 75 insertions, 81 deletions
diff --git a/testsuite/tests/roles/should_compile/Roles1.stderr b/testsuite/tests/roles/should_compile/Roles1.stderr index 548a2c32f2..4305b2f737 100644 --- a/testsuite/tests/roles/should_compile/Roles1.stderr +++ b/testsuite/tests/roles/should_compile/Roles1.stderr @@ -20,7 +20,7 @@ DATA CONSTRUCTORS K2 :: forall a. a -> T2 a K1 :: forall a. a -> T1 a Dependent modules: [] -Dependent packages: [base-4.14.0.0, ghc-bignum-1.0, ghc-prim-0.7.0] +Dependent packages: [base-4.15.0.0, ghc-bignum-1.0, ghc-prim-0.7.0] ==================== Typechecker ==================== Roles1.$tcT7 @@ -79,37 +79,36 @@ Roles1.$tc'K1 = GHC.Types.TyCon 1265606750138351672## 7033043930969109074## Roles1.$trModule (GHC.Types.TrNameS "'K1"#) 1 $krep -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepVar 1 -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepVar 0 -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepVar 0 -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepVar 1 -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepVar 2 -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepApp $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepVar 1 +$krep [InlPrag=[~]] = GHC.Types.KindRepVar 0 +$krep [InlPrag=[~]] = GHC.Types.KindRepVar 0 +$krep [InlPrag=[~]] = GHC.Types.KindRepVar 1 +$krep [InlPrag=[~]] = GHC.Types.KindRepVar 2 +$krep [InlPrag=[~]] = GHC.Types.KindRepApp $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep GHC.Types.krep$*Arr* -$krep [InlPrag=NOUSERINLINE[~]] - = GHC.Types.KindRepFun $krep GHC.Types.krep$* -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep GHC.Types.krep$* +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$*Arr* GHC.Types.krep$*Arr* -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp Roles1.$tcT7 ((:) $krep ((:) $krep ((:) $krep []))) -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp Roles1.$tcT6 ((:) $krep ((:) $krep [])) -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp Roles1.$tcT4 ((:) $krep ((:) $krep [])) -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp Roles1.$tcT3 ((:) $krep ((:) $krep [])) -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp Roles1.$tcT5 ((:) $krep []) -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp Roles1.$tcT2 ((:) $krep []) -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp Roles1.$tcT1 ((:) $krep []) Roles1.$trModule = GHC.Types.Module diff --git a/testsuite/tests/roles/should_compile/Roles14.stderr b/testsuite/tests/roles/should_compile/Roles14.stderr index 569c66a6e2..461f4c1318 100644 --- a/testsuite/tests/roles/should_compile/Roles14.stderr +++ b/testsuite/tests/roles/should_compile/Roles14.stderr @@ -6,7 +6,7 @@ TYPE CONSTRUCTORS COERCION AXIOMS axiom Roles12.N:C2 :: C2 a = a -> a Dependent modules: [] -Dependent packages: [base-4.14.0.0, ghc-bignum-1.0, ghc-prim-0.7.0] +Dependent packages: [base-4.15.0.0, ghc-bignum-1.0, ghc-prim-0.7.0] ==================== Typechecker ==================== Roles12.$tcC2 @@ -17,14 +17,13 @@ Roles12.$tc'C:C2 = GHC.Types.TyCon 7087988437584478859## 11477953550142401435## Roles12.$trModule (GHC.Types.TrNameS "'C:C2"#) 1 $krep -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepVar 0 -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] - = GHC.Types.KindRepFun GHC.Types.krep$* $krep -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepVar 0 +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp GHC.Types.$tcConstraint [] -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp Roles12.$tcC2 ((:) $krep []) Roles12.$trModule = GHC.Types.Module diff --git a/testsuite/tests/roles/should_compile/Roles2.stderr b/testsuite/tests/roles/should_compile/Roles2.stderr index f6edcbd6af..f9a13b3236 100644 --- a/testsuite/tests/roles/should_compile/Roles2.stderr +++ b/testsuite/tests/roles/should_compile/Roles2.stderr @@ -6,7 +6,7 @@ DATA CONSTRUCTORS K2 :: forall a. FunPtr a -> T2 a K1 :: forall a. IO a -> T1 a Dependent modules: [] -Dependent packages: [base-4.14.0.0, ghc-bignum-1.0, ghc-prim-0.7.0] +Dependent packages: [base-4.15.0.0, ghc-bignum-1.0, ghc-prim-0.7.0] ==================== Typechecker ==================== Roles2.$tcT2 @@ -25,16 +25,16 @@ Roles2.$tc'K1 = GHC.Types.TyCon 16530009231990968394## 11761390951471299534## Roles2.$trModule (GHC.Types.TrNameS "'K1"#) 1 $krep -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepVar 0 -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepVar 0 +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp GHC.Ptr.$tcFunPtr ((:) $krep []) -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp Roles2.$tcT2 ((:) $krep []) -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp GHC.Types.$tcIO ((:) $krep []) -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp Roles2.$tcT1 ((:) $krep []) Roles2.$trModule = GHC.Types.Module diff --git a/testsuite/tests/roles/should_compile/Roles3.stderr b/testsuite/tests/roles/should_compile/Roles3.stderr index 0c834cd53b..bfc62cc196 100644 --- a/testsuite/tests/roles/should_compile/Roles3.stderr +++ b/testsuite/tests/roles/should_compile/Roles3.stderr @@ -21,7 +21,7 @@ COERCION AXIOMS axiom Roles3.N:C3 :: C3 a b = a -> F3 b -> F3 b axiom Roles3.N:C4 :: C4 a b = a -> F4 b -> F4 b Dependent modules: [] -Dependent packages: [base-4.14.0.0, ghc-bignum-1.0, ghc-prim-0.7.0] +Dependent packages: [base-4.15.0.0, ghc-bignum-1.0, ghc-prim-0.7.0] ==================== Typechecker ==================== Roles3.$tcC4 @@ -48,25 +48,23 @@ Roles3.$tc'C:C1 = GHC.Types.TyCon 4508088879886988796## 13962145553903222779## Roles3.$trModule (GHC.Types.TrNameS "'C:C1"#) 1 $krep -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepVar 0 -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepVar 1 -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] - = GHC.Types.KindRepFun GHC.Types.krep$* $krep -$krep [InlPrag=NOUSERINLINE[~]] - = GHC.Types.KindRepFun GHC.Types.krep$* $krep -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepVar 0 +$krep [InlPrag=[~]] = GHC.Types.KindRepVar 1 +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp GHC.Types.$tcConstraint [] -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp GHC.Types.$tc~ ((:) GHC.Types.krep$* ((:) $krep ((:) $krep []))) -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp Roles3.$tcC2 ((:) $krep ((:) $krep [])) -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp Roles3.$tcC1 ((:) $krep []) Roles3.$trModule = GHC.Types.Module diff --git a/testsuite/tests/roles/should_compile/Roles4.stderr b/testsuite/tests/roles/should_compile/Roles4.stderr index da6d90df05..bd7baee0c6 100644 --- a/testsuite/tests/roles/should_compile/Roles4.stderr +++ b/testsuite/tests/roles/should_compile/Roles4.stderr @@ -9,7 +9,7 @@ COERCION AXIOMS axiom Roles4.N:C1 :: C1 a = a -> a axiom Roles4.N:C3 :: C3 a = a -> Syn1 a Dependent modules: [] -Dependent packages: [base-4.14.0.0, ghc-bignum-1.0, ghc-prim-0.7.0] +Dependent packages: [base-4.15.0.0, ghc-bignum-1.0, ghc-prim-0.7.0] ==================== Typechecker ==================== Roles4.$tcC3 @@ -28,20 +28,19 @@ Roles4.$tc'C:C1 = GHC.Types.TyCon 3870707671502302648## 10631907186261837450## Roles4.$trModule (GHC.Types.TrNameS "'C:C1"#) 1 $krep -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepVar 0 -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] - = GHC.Types.KindRepFun GHC.Types.krep$* $krep -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepVar 0 +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp GHC.Types.$tc[] ((:) $krep []) -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp GHC.Types.$tcConstraint [] -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp Roles4.$tcC3 ((:) $krep []) -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp Roles4.$tcC1 ((:) $krep []) Roles4.$trModule = GHC.Types.Module diff --git a/testsuite/tests/roles/should_compile/T8958.stderr b/testsuite/tests/roles/should_compile/T8958.stderr index ab2d069774..203f978daa 100644 --- a/testsuite/tests/roles/should_compile/T8958.stderr +++ b/testsuite/tests/roles/should_compile/T8958.stderr @@ -16,7 +16,7 @@ CLASS INSTANCES -- Defined at T8958.hs:10:10 instance [incoherent] Nominal a -- Defined at T8958.hs:7:10 Dependent modules: [] -Dependent packages: [base-4.14.0.0, ghc-bignum-1.0, ghc-prim-0.7.0] +Dependent packages: [base-4.15.0.0, ghc-bignum-1.0, ghc-prim-0.7.0] ==================== Typechecker ==================== T8958.$tcMap @@ -43,33 +43,32 @@ T8958.$tc'C:Nominal = GHC.Types.TyCon 10562260635335201742## 1215478186250709459## T8958.$trModule (GHC.Types.TrNameS "'C:Nominal"#) 1 $krep -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepVar 0 -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepVar 1 -$krep [InlPrag=NOUSERINLINE[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=NOUSERINLINE[~]] - = GHC.Types.KindRepFun GHC.Types.krep$* $krep -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepVar 0 +$krep [InlPrag=[~]] = GHC.Types.KindRepVar 1 +$krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp GHC.Tuple.$tc(,) ((:) @GHC.Types.KindRep $krep ((:) @GHC.Types.KindRep $krep [] @GHC.Types.KindRep)) -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp T8958.$tcMap ((:) @GHC.Types.KindRep $krep ((:) @GHC.Types.KindRep $krep [] @GHC.Types.KindRep)) -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp GHC.Types.$tc[] ((:) @GHC.Types.KindRep $krep [] @GHC.Types.KindRep) -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp GHC.Types.$tcConstraint [] @GHC.Types.KindRep -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp T8958.$tcRepresentational ((:) @GHC.Types.KindRep $krep [] @GHC.Types.KindRep) -$krep [InlPrag=NOUSERINLINE[~]] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp T8958.$tcNominal ((:) @GHC.Types.KindRep $krep [] @GHC.Types.KindRep) @@ -79,7 +78,7 @@ T8958.$trModule AbsBinds [a] [] {Exports: [T8958.$fRepresentationala <= $dRepresentational wrap: <>] - Exported types: T8958.$fRepresentationala [InlPrag=NOUSERINLINE CONLIKE] + Exported types: T8958.$fRepresentationala [InlPrag=CONLIKE] :: forall a. Representational a [LclIdX[DFunId], Unf=DFun: \ (@a) -> T8958.C:Representational TYPE: a] @@ -88,7 +87,7 @@ AbsBinds [a] [] AbsBinds [a] [] {Exports: [T8958.$fNominala <= $dNominal wrap: <>] - Exported types: T8958.$fNominala [InlPrag=NOUSERINLINE CONLIKE] + Exported types: T8958.$fNominala [InlPrag=CONLIKE] :: forall a. Nominal a [LclIdX[DFunId], Unf=DFun: \ (@a) -> T8958.C:Nominal TYPE: a] Binds: $dNominal = T8958.C:Nominal @a |