typecheck: Load unfoldings lazily
Changes PlannedPublic

Authored by bgamari on Oct 17 2016, 10:00 PM.

Details

Reviewers
simonpj
austin
Trac Issues
#9370
Summary

This carries out the refactoring proposed in Trac #9370, comment 28.
Previously -fignore-interface-pragmas would disable typechecking of unfoldings
loaded from interface files during deserialization. This would mean that
changes in the state of this flag would not take effect after a module's
interface file has been loaded, leading to unpredictable behavior when
compiling programs which set this flag on a per-module basis.

Here we rework interface file loading such that unfoldings are always loaded,
but type-checked lazily. We then disable inlining in the simplifier when
-fignore-interface-pragmas is set.

Test Plan

Validate

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Branch
master
Lint
Lint WarningsExcuse: bah
SeverityLocationCodeMessage
Warningcompiler/basicTypes/IdInfo.hs:215TXT3Line Too Long
Unit
No Unit Test Coverage
Build Status
Buildable 11453
Build 14193: [GHC] Linux/amd64: Patch building
Build 14192: [GHC] Windows/amd64: Continuous Integration
Build 14191: arc lint + arc unit
bgamari updated this revision to Diff 9050.Oct 17 2016, 10:00 PM
bgamari retitled this revision from to typecheck: Load unfoldings lazily.
bgamari updated this object.
bgamari edited the test plan for this revision. (Show Details)
bgamari added a reviewer: simonpj.
bgamari updated the Trac tickets for this revision.
bgamari updated this revision to Diff 9051.Oct 17 2016, 10:02 PM
bgamari edited edge metadata.

Fix long lines

simonpj accepted this revision.Oct 18 2016, 6:35 AM
simonpj edited edge metadata.

I like that this patch mainly deletes code!

But the ticket has a long discussion, laziness is important, so it all needs a proper Note to explain.

Have you checked that without -O those unfoldings really are not typechecked? In practice.

Is there any perf impace in the no -O case?

Simon

compiler/simplCore/SimplCore.hs
147

This needs a major Note to explain!!! So small, so elegant (if that's really it!), but needs attention drawn to it.

This revision is now accepted and ready to land.Oct 18 2016, 6:35 AM
bgamari added inline comments.Oct 19 2016, 8:34 AM
compiler/simplCore/SimplCore.hs
147

Agreed; I really just wanted to see whether this validated on Harbormaster. There's quite a bit of documentation that needs to be done.

bgamari planned changes to this revision.Oct 26 2016, 10:17 AM

This needs more work.

austin resigned from this revision.Nov 9 2017, 9:45 AM