diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-02-11 18:07:28 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-02-26 02:06:51 -0500 |
commit | 2be7446089de644048466ab8e9c71c596fa82d09 (patch) | |
tree | 97a0a67f8abc5f023aad79cb3addd5f18a8f2341 /testsuite/tests | |
parent | 61a203ba2e942b39c5f26a7ad01017841937fd0a (diff) | |
download | haskell-2be7446089de644048466ab8e9c71c596fa82d09.tar.gz |
Use a more up-to-date snapshot of the current rules in the simplifier
As the prescient (now deleted) note warns in simplifyPgmIO we have to be a bit careful
about when we gather rules from the EPS so that we get the rules for
imported bindings.
```
-- Get any new rules, and extend the rule base
-- See Note [Overall plumbing for rules] in GHC.Core.Rules
-- We need to do this regularly, because simplification can
-- poke on IdInfo thunks, which in turn brings in new rules
-- behind the scenes. Otherwise there's a danger we'll simply
-- miss the rules for Ids hidden inside imported inlinings
```
Given the previous commit, the loading of unfoldings is now even more
delayed so we need to be more careful to read the EPS rule base closer to the point
where we decide to try rules.
Without this fix GHC performance regressed by a noticeably amount
because the `zip` rule was not brought into scope eagerly enough which
led to a further series of unfortunate events in the simplifer which
tipped `substTyWithCoVars` over the edge of the size threshold, stopped
it being inlined and increased allocations by 10% in some cases.
Furthermore, this change is noticeably in the testsuite as it changes
T19790 so that the `length` rules from GHC.List fires earlier.
-------------------------
Metric Increase:
T9961
-------------------------
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/simplCore/should_compile/T19790.stderr | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T19790.stderr b/testsuite/tests/simplCore/should_compile/T19790.stderr index 71632231f7..2108b82afe 100644 --- a/testsuite/tests/simplCore/should_compile/T19790.stderr +++ b/testsuite/tests/simplCore/should_compile/T19790.stderr @@ -1,7 +1,7 @@ Rule fired: Class op + (BUILTIN) Rule fired: Class op length (BUILTIN) +Rule fired: length (GHC.List) Rule fired: map (GHC.Base) Rule fired: fold/build (GHC.Base) Rule fired: This rule should fire! (T19790) -Rule fired: length (GHC.List) Rule fired: lengthList (GHC.List) |