SAT: Fix hacky name shadowing
AbandonedPublic

Authored by osa1 on Jul 9 2018, 3:50 AM.

Details

Reviewers
simonpj
bgamari
tdammers
Trac Issues
#14231
Summary

Properly (using a fresh unique) create a new Id for the "wrapper"
(previously called "shadow") and rename the original body so that calls
to the pre-SAT function become calls to the wrapper function.

Fixes Trac #14231

Test Plan

Validated with the regression test. I also tried validating with
EXTRA_HC_OPTS="-fstatic-argument-transformation -dcore-lint". Number of
failures reduced from 91 to 75.

osa1 created this revision.Jul 9 2018, 3:50 AM
tdammers accepted this revision.Jul 9 2018, 6:35 AM
This revision is now accepted and ready to land.Jul 9 2018, 6:35 AM
osa1 edited the test plan for this revision. (Show Details)Jul 9 2018, 8:22 AM
osa1 edited the test plan for this revision. (Show Details)Jul 9 2018, 8:49 AM

See comment:13 in the ticket

compiler/simplCore/SAT.hs
407–410

I don't see how this can possibly work. You are binding wrapper_bndr but never using it.

osa1 updated this revision to Diff 17255.Jul 10 2018, 5:11 AM
  • Implement RHS renaming
osa1 marked an inline comment as done.Jul 10 2018, 5:12 AM
osa1 added inline comments.
compiler/simplCore/SAT.hs
407–410

I forgot to actually rename the original binder to the shadow binder. Updated now.

osa1 abandoned this revision.Jul 11 2018, 1:24 PM
osa1 marked an inline comment as done.

We discussed this with @simonpj -- it turns out we can shadow binders using the same unique. Closing this. (see also the ticket)