Skip to content

isPure + Match Arm Elimination#161

Open
EmilySillars wants to merge 13 commits intomainfrom
inliner-nits
Open

isPure + Match Arm Elimination#161
EmilySillars wants to merge 13 commits intomainfrom
inliner-nits

Conversation

@EmilySillars
Copy link
Copy Markdown
Contributor

@EmilySillars EmilySillars commented May 12, 2023

  • adds a an isPure predicate to the preinline phase to account for side effects when inlining
  • fixes a bug related to unintentional inlining of scrutinees, + added intentional inlining of scrutinees
  • adds match arm elimination
  • adds regression tests for each of the above 3 features

efric and others added 11 commits April 19, 2023 12:03
…ch statements. however, adding just never case causes some test cases to fail
A Just Never Case was added for when we don't want to ever inline a
binder. The change made some unit tests fail. This commit fixes that
problem by allowing inlining RHS of binder. (This can probably be made
cleaner later).

Also add missing test cases and delete accidentally commited files
Comment thread regression-tests/tests/inlining-ex-3.ssl
Comment thread regression-tests/tests/inlining-ex-14.ssl.failing Outdated
Comment thread regression-tests/tests/inlining-ex-9.ssl Outdated
Comment thread src/IR/Simplify.hs Outdated
Comment thread src/IR/Simplify.hs Outdated
Comment thread src/IR/Simplify.hs Outdated
Comment thread src/IR/Simplify.hs
@EmilySillars
Copy link
Copy Markdown
Contributor Author

This PR is ready to merge!

  • adds a checkPure condition to the preinline phase to account for side effects when inlining
  • fixes a bug related to unintentional inlining of scrutinees, + added intentional inlining of scrutinees
  • adds match arm elimination
  • adds regression tests for each of the above 3 features
  • since the simplifier does not currently support mutual recursion, I added a check for recursive let bindings. Upon finding a let expression with a list of more than one binding, the simplifier passes along the program unmodified. I did this because I thought ignoring programs that potentially have mutually recursive bindings seemed like the easiest/simplest patch. @j-hui If you'd prefer I rename the mutual recursion regression tests to .failing instead, or some other solution, LMK.

@EmilySillars EmilySillars requested a review from j-hui May 20, 2023 20:44
@EmilySillars EmilySillars marked this pull request as ready for review May 20, 2023 20:44
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.

2 participants