-
Notifications
You must be signed in to change notification settings - Fork 323
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
Migrate some passes to Mini passes #11191
Merged
Merged
Changes from 1 commit
Commits
Show all changes
90 commits
Select commit
Hold shift + click to select a range
c9ef2c3
Implement skeleton of mini pass framework
Akirathan 43eafae
Rename MiniPassManager to MiniPassChainer
Akirathan 4a0fd85
Implement default IR.withNewChildren
Akirathan 1bbf991
Add MiniPassTester and MiniPassTraverser
Akirathan 70f0a1a
Add tests for OperatorToFunction mini pass
Akirathan 808dbd8
Add necessary withNewChildren implementations
Akirathan 1abc70d
Add necessary withNewChildren implementations
Akirathan cdf1d87
MiniIRPass has metadata type argument
Akirathan d7b6016
Add mini pass version of LambdaShorthandToLambda
Akirathan 1bd2b40
Add tests of mini pass version of LambdaShorthandToLambda
Akirathan 61fed92
Implement Prefix.withNewChildren
Akirathan 40252a2
Add IRTest to test children and withNewChildren API
Akirathan 76dbc23
Update default IR.withNewChildren
Akirathan 4a66460
Copy of children of DefinitionArgument.Specified is handled specifica…
Akirathan be2724d
Add necessary withNewChildren implementations
Akirathan fd3a727
LambdaToShorthandMini ignores blank fn
Akirathan 8a5c435
Tests that have different internal naming are handled in different te…
Akirathan 995dea5
DefinitionArgument.Specified implements withNewChildren
Akirathan 985b8c2
Change prepare API
Akirathan 28edccb
MiniIRPass is not parametrized based on metadata type
Akirathan 6121750
Dummy implementation of minipass chaining
Akirathan 54e5bd0
Add test for BinaryOperator.newChildren
Akirathan 6b4c6b3
IR.withNewChildren must be called with the same length as children
Akirathan 01561a1
MiniIRPass.prepare has parent parameter
Akirathan dd42554
Remove parent parameter from MiniIRPass.prepare
Akirathan f85f017
Remove MiniIRPass.runsAfter - it will not be necessary for this PR
Akirathan a4aaf8e
Add docs to MiniIRPass
Akirathan 836c4c2
Add skeleton of TailCallMini pass
Akirathan 079543a
runtime-compiler depends on org.graalvm.sdk:collections
Akirathan 5d19be4
Implement withNewChildren on Expression via mapExpressions
Akirathan a369ed8
Fix MatchError in TailCallMini
Akirathan 487003f
Revert "Implement withNewChildren on Expression via mapExpressions"
Akirathan b2f7053
Revert "runtime-compiler depends on org.graalvm.sdk:collections"
Akirathan edec03b
Replace org.graalvm.collections.EconomicSet with java.util.IdentityHa…
Akirathan 67ff454
Revert tests that depend on InlineContext config
Akirathan 547e9e6
Add more tests that test consistency with old pass version
Akirathan 925a2de
Add logging to MiniPassTraverser
Akirathan dc6e7f3
Implement more withNewChildren methods
Akirathan c56c2be
Add another tail call mini pass test
Akirathan ea1462a
TailCallMini respect initial isInTailPosition flag
Akirathan 18f4cea
Implement TailCallMini.toString
Akirathan e2fc538
Using IR.mapExpressions in MiniPassTraverser
JaroslavTulach a58ecc8
Detect and use MiniPassFactory in PassFactory
JaroslavTulach 1aaa589
Move OperatorToFunction mega pass to test
Akirathan 8604acb
Move LambdaShorthandToLambda mega pass to test
Akirathan 0ddb96b
Use pattern match instead of isInstanceOf check in PassManager
Akirathan a85679d
Move TailCall mega pass to test
Akirathan 80c4545
Implement MiniPass trait for testing mini and mega passes
Akirathan 9a5dfea
TailCallMegaPass uses metadata from TailCall, not this
Akirathan d5c6983
Change API of MiniIRPass to accept only Expression
Akirathan 89cde89
OperatorToFunctionMini checks post condition
Akirathan 7c9f370
Add failing test to OperatorToFunctionTest
Akirathan 92ae4fe
Implement IRDumper.dumpWithSvg
Akirathan 65560c4
Ensure MiniPassTraverser returns transformed Module
Akirathan dfc54db
IRDumper handles SugaredType
Akirathan 8771d58
MiniPassTraverser logs IRs with hash code.
Akirathan bdff605
Refactor TailCallMini to the new API
Akirathan ce56abb
typo
Akirathan d42d3e9
Must preprocess the module even for miniPass
JaroslavTulach ba7ab9d
Using analyseModuleBinding from TailCallMegaPass
JaroslavTulach 90139e7
Allow for comparing mega and mini IR trees
JaroslavTulach 8558d5b
Merging with develop. 47 failing tests. Mostly because of advanturous…
JaroslavTulach 05fd38a
Making the TailCall pass closer to original mega pass code
JaroslavTulach 367fc9a
Properly annotate withClue sections
JaroslavTulach 36ebf2b
Associate TailCall pass metadata
JaroslavTulach 0a02563
Rewrite using tailCandidates
JaroslavTulach 83f4a57
Removal of notTailMeta
JaroslavTulach 69b3274
Execute megaPass.runExpression at the end of the test
JaroslavTulach dea6dd6
One TailCallTest failure down to six
JaroslavTulach 6c2b51d
Down to five failing tests in TailCallTest
JaroslavTulach f27ce6f
Down to three failures
JaroslavTulach f4077de
Reordering the test and down to two failures
JaroslavTulach 1b021c2
Making all TailCallTest pass on mega as well as mini pass
JaroslavTulach 8ce42e0
No need for TailCallMini
JaroslavTulach 64b013f
Cleaning dead code up
JaroslavTulach f54ba6d
SectionsToBinOp is mini IR pass
JaroslavTulach 40ef345
Introducing MiniIRPass.combine
JaroslavTulach 8124e1e
Hiding traversal behind MiniIRPass.compile
JaroslavTulach 668fdfd
Not including IRDumper changes in this PR
JaroslavTulach 2af068f
No need for MetadataStorage.size
JaroslavTulach 95b1756
Properly clone ChainedMiniPass when first or second delegates changes
JaroslavTulach c84e881
Removing duplicated test - mini pass testing is already inside of ass…
JaroslavTulach 0964711
Rewriting MiniIRPass processing to queue - much easier for profiling …
JaroslavTulach ffd27df
MiniIRPass.prepare(parent, child)
JaroslavTulach 924e404
Keep all IRs in local variables for easier debugging
JaroslavTulach 2736a76
Combining subsequent mini passes
JaroslavTulach 762045a
Both MiniPassFactory and IRPass are on par by extending IRProcessingPass
JaroslavTulach ef3450c
Only update IR metadata in transform methods
JaroslavTulach 248c0f4
Removing dead code
JaroslavTulach befef0c
TailCall rewritten to Java
JaroslavTulach File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 2736a76 commit changes the
PassManager
to combine subsequent mini passes unless the already collected passes prevent such combining by declaring newly collected pass to be invalidated by their changes. Imagine there ism.enso
file:then the processing of the
m.enso
file logs following info:e.g. three mini passes are collected in this
PassGroup
. Two of them are "flushed" together by a single IR traversal. The 3rd one is "flushed" separately before a subsequent mega pass is executed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
LambdaShorthandToLambda
is defined as being invalidated byOperatorToFunction
pass as it is known thatLambdaShorthandToLambda
needs to see result ofOperatorToFunction
in itsprepare
method - that's only possible if the whole tree produced byOperatorToFunction
is fed intoLambdaShorthandToLambda
- e.g. these two mini passes cannot be merged.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imagine there is
m.enso
file:then the
enso --log-level trace --run m.enso
file logs following info (after filtering the relevant parts):