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

Run simplifier in topological order. #6013

Merged
merged 2 commits into from
May 19, 2020
Merged

Run simplifier in topological order. #6013

merged 2 commits into from
May 19, 2020

Conversation

sofiafaro-da
Copy link
Contributor

This PR makes the simplifier go through each value definition in topological order, instead of running all at once. This way optimizations can build on previous optimizations.

changelog_begin
changelog_end

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags
  • Normal production system change, include purpose of change in description

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

Copy link
Contributor

@cocreature cocreature left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you!

compiler/daml-lf-tools/src/DA/Daml/LF/Simplifier.hs Outdated Show resolved Hide resolved
w' = extendWorldSelf m' world
d' = simplifyDefValue w' dval
in NM.insert d' accum
in m { moduleValues = foldl' step NM.empty (topoSortDefValues m) }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like you are reordering the values. I guess this doesn’t matter for anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's ok to reorder.

@sofiafaro-da sofiafaro-da force-pushed the toposort-simplifier branch from bd70836 to 9fdc3e7 Compare May 19, 2020 10:19
@mergify mergify bot merged commit 73d58f3 into master May 19, 2020
@mergify mergify bot deleted the toposort-simplifier branch May 19, 2020 14:16
Copy link
Contributor

@hurryabit hurryabit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants