-
13a52ca3
by sheaf at 2026-07-20T13:12:14+05:30
Avoid mkTick in Core Prep breaking ANF
As discovered in #27182, mkTick can break ANF. This patch introduces a
variant of mkTick that skips the single optimisation that could break
ANF. This is preferrable over switching to the raw Tick constructor,
as the latter may introduce spurious cost centres in profiling reports.
This is a temporary measure until we more thoroughly refactor how
mkTick works (see #27141).
See Note [mkTick breaks ANF] in GHC.CoreToStg.Prep.
Fixes #27182
(cherry picked from commit f9bcfac2e92457128f5c82dea181edcd0baf7eef)
-
289f1eb1
by sheaf at 2026-07-20T13:12:14+05:30
Don't drop ticks around variables of type `IO ()`
GHC.Core.Utils.mkTick is responsible for placing a tick on a Core
expression. It contains logic for dropping SCCs (non-counting profiling
ticks) around non-function variables, as such variables cannot
meaningfully contribute to profiles. However, the logic for what counts
as a function was incorrect: it used `isFunTy` which returns 'False' for
types such as 'IO ()' where the function arrow is hidden under a
newtype.
We now use 'mightBeFunTy' instead of 'isFunTy'. This ensures we don't
drop ticks in cases we aren't sure.
On the way, we improve the documentation of 'isFunTy', 'isPiTy' and
'mightBeFunTy', and update the latter's implementation to consistently
handle unary classes.
Fixes #27225
-------------------------
Metric Decrease:
T5642
-------------------------
(cherry picked from commit ce01ccb625514a09e76aded549691da4dfe87de7)
-
d1ad134c
by sheaf at 2026-07-20T13:12:14+05:30
Avoid mkTick in Core Prep breaking ANF (part II)
Hotfix for 2f9579765f55b3920ceb2e04995ff41a9d0e2d4e fixing a small
oversight in the call to tickTickedExpr from mkTick, in which we
improperly recursively called mkTick without passing on the preserve_anf
flag.
Fixes #27386
(cherry picked from commit 473b97ebc742305f56e30d5b1bbf95b7681312f0)
-
df973ff7
by Ian-Woo Kim at 2026-07-20T13:12:14+05:30
Make the order of usages deterministic
It has been observed that the ordering of usages can be non-determinstic
in parallel builds. Therefore, this contribution introduces sorting of
usages based on a platform- and race-independent sorting criterion.
Resolves #26877.
Co-authored-by: Wolfgang Jeltsch <wolfgang@well-typed.com>
(cherry picked from commit d216412babfd5b5746365f0686ec370fb0892ec7)
-
72d595e5
by Wolfgang Jeltsch at 2026-07-20T13:12:14+05:30
Change the descriptions of two existing changelog entries
The descriptions now describe the changes in a user-friendly manner, as
opposed to describing the contributions that led to these changes in a
developer-friendly manner.
(cherry picked from commit 8e1cc105acae69b1fabd1a9b89e2d1823861f518)
-
8d5a1f45
by Andrea Vezzosi at 2026-07-20T13:12:14+05:30
[Fix #27287] preserve ModBreaks in ModIface
(cherry picked from commit 4396a6f2a4c7799908e1e0b88a218a51d063fdca)