Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve precision of resume analysis on let binders #75

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/Core/AnalysisResume.hs
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,21 @@ arExpr' appResume expr
Let [DefNonRec def] expr
| defName def == getName resumeName -- TODO: too weak a check!! improve it!! we just need to skip the first definition..
-> arExpr' appResume expr
Let defGroups body -- TODO: be more sophisticated here?
-> if (isResumingElem (bv defGroups `S.union` fv defGroups))
then ResumeNormal else arExpr' appResume body
Let defs body
-> rand (arDefs defs) $ arExpr' appResume body
Case exprs branches
-> arExprsAnd exprs `rand` arBranches appResume branches

arDefs :: [DefGroup] -> ResumeKind
arDefs defs
= rands (map arDef defs)

arDef :: DefGroup -> ResumeKind
arDef (DefRec defs)
= arExprsAnd (map defExpr defs)
arDef (DefNonRec def)
= arExpr (defExpr def)

arBranches :: ResumeKind -> [Branch] -> ResumeKind
arBranches appResume branches
= rors (map (arBranch appResume) branches)
Expand Down