Fix the occurrence analyser
Ticket #18603 demonstrated that the occurrence analyser's handling of local RULES for imported Ids (which I now call IMP-RULES) was inadequate. It led the simplifier into an infnite loop by failing to label a binder as a loop breaker. The main change in this commit is to treat IMP-RULES in a simple and uniform way: as extra rules for the local binder. See Note [IMP-RULES: local rules for imported functions] This led to quite a bit of refactoring. The result is still tricky, but it's much better than before, and better documented I think. Oh, and it fixes the bug.
Showing
- compiler/GHC/Core/FVs.hs 8 additions, 9 deletionscompiler/GHC/Core/FVs.hs
- compiler/GHC/Core/Opt/OccurAnal.hs 590 additions, 488 deletionscompiler/GHC/Core/Opt/OccurAnal.hs
- testsuite/tests/simplCore/should_compile/T18603.hs 29 additions, 0 deletionstestsuite/tests/simplCore/should_compile/T18603.hs
- testsuite/tests/simplCore/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/simplCore/should_compile/all.T
Loading
Please register or sign in to comment