Make -fcpr-off a dynamic flag
ClosedPublic

Authored by christiaanb on Jul 29 2015, 7:32 AM.

Details

Summary

Make -fcpr-off, turning off CPR analysis in the demand analyser, a dynamic flag instead of a static flag.

Test Plan

validate

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
christiaanb updated this revision to Diff 3700.Jul 29 2015, 7:32 AM
christiaanb retitled this revision from to Make -fcpr-off a dynamic flag.
christiaanb updated this object.
christiaanb edited the test plan for this revision. (Show Details)
christiaanb added reviewers: austin, simonpj.
christiaanb updated the Trac tickets for this revision.
christiaanb updated this object.Jul 29 2015, 7:41 AM
christiaanb edited edge metadata.
simonpj requested changes to this revision.Jul 29 2015, 11:10 AM
simonpj edited edge metadata.

Not much thought was given to how -fcpr-off works.

Currently its works by not *generating* CPR info.

But an alternative would be not to *exploit* CPR info, specifically during worker/wrapper generation. The advantage is that this is done in ONE place, namely mkWWcpr, in WwLib. That in turn is called only from mkWwBodies which already gets DynFlags. Easy!

So that would mean that CPR analysis still happens, but GHC generates no w/w split.

I think this would be a better plan. OK?

This revision now requires changes to proceed.Jul 29 2015, 11:10 AM

See also D1104. Shall I land it, and then you can update this patch accordingly?

Yes, D1104 is orthorgonal and good regardless. Do land it

Not much thought was given to how -fcpr-off works.

Currently its works by not *generating* CPR info.

But an alternative would be not to *exploit* CPR info, specifically during worker/wrapper generation. The advantage is that this is done in ONE place, namely mkWWcpr, in WwLib. That in turn is called only from mkWwBodies which already gets DynFlags. Easy!

So that would mean that CPR analysis still happens, but GHC generates no w/w split.

I think this would be a better plan. OK?

Yes, that sounds like a much better plan. I will update my patch accordingly.

christiaanb updated this object.Jul 30 2015, 4:32 AM
christiaanb edited edge metadata.
christiaanb updated this revision to Diff 3708.Jul 30 2015, 4:33 AM
christiaanb edited edge metadata.
  • Revert "Make -fcpr-off a dynamic flag"
  • Second try: Make -fcpr-off a dynamic flag
bgamari accepted this revision.Jul 30 2015, 12:19 PM
bgamari edited edge metadata.

Looks good to me!

christiaanb updated this revision to Diff 3718.Jul 31 2015, 4:34 AM
christiaanb edited edge metadata.

Rebase against latest master so that harbormaster will hopefully build

  • Revert "Make -fcpr-off a dynamic flag"
  • Second try: Make -fcpr-off a dynamic flag

That's good, thanks. But let's make it a positive flag, like -fstrictness (on by default in -O, -O2). Maybe -fcpr-anal?

That's good, thanks. But let's make it a positive flag, like -fstrictness (on by default in -O, -O2). Maybe -fcpr-anal?

I'm fine with that. Do I remove the cpr-off flag completely? Or add cpr-anal and mark cpr-off as deprecated in favor of no-cpr-anal?

I'd just remove it. It's a ghc-hackers-only flag and fairly recent

christiaanb updated this revision to Diff 3720.Jul 31 2015, 6:59 AM
  • Replace negative -fcpr-off by positive -fcpr-anal
bgamari accepted this revision.Aug 2 2015, 7:14 AM
bgamari edited edge metadata.

Looks great. Thanks!

This revision was automatically updated to reflect the committed changes.