-
Notifications
You must be signed in to change notification settings - Fork 0
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
New IR #20
Draft
Jakobeha
wants to merge
54
commits into
main
Choose a base branch
from
new-ir
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
probably still no optimizations
- Improve type system; add reference counting. - Add `ConsumesNonEnvArg` effect for type system (TODO: know specifically what argument(s) it consumes, also probably move out of effects). - Scope resolution progress. - Make `InstrData` take `@Nullable` instead of `Optional` except in collections. - Add built-in parsing and printing support for maps and improve it for collections.
Now I have to copy over the generic `StaticAnalysis` class. Hopefully we can improve the IR so it's more understandable and has less special cases.
Still some TODOs
+ context analysis
also remove `LdEnclosEnv` because we can just reference the enclosing env, and make `MaterializeEnv` not return anything because it seems it doesn't need to, so we can remove aliases from `AbstractEnv`. I'm looking if there are other places we can remove complexity.
implement copying abstract values and logging, fix copying in `ScopeAnalysisState`.
- rework parsing and printing code objects - start adding parameter nodes
- Added general Java types - Clarified some things
TODO `BBCompoundMutate`, `CFGCursor`, `CFGParsePrint`, and a lot more Also, will probably get rid of `CFGPirSerialize`, because our IR is a lot different than PIR, so it's becoming cruft. We do need a lot more tests though, especially for the record/replay/rewind that `CFGParsePrint` handled.
`InstrData#fun`, `InstrData#inputs`, `InstrData#setInputs`, and `InstrData#checkInputNodeTypes` Also some refactoring
Try to refactor out `UNBOUND` because it makes the types much harder, and I think we can just represent it using `@Nullable SEXP`/`null` or `Optional<SEXP>`/`Optional.empty()` in the places it can exist. One issue is that we sometimes add unbound bindings to environments. However, it looks like `Rf_findVar` skips over unbound, so they would be equivalent to unset. I'm going to try removing them, and if tests fail, I'll re-add them and change the environment's `bindings` from `HashMap<String, SEXP>` to `HashMap<String, Optional<SEXP>>`.
- Don't prefix constants with `\` - Escape symbols with `'` - Put `NULL`, `TRUE`, `FALSE`, and `NA`s in `<` and `>`, so we don't parse Java identifiers as SEXPs - Fix some undiscovered parsing and printing bugs
I probably have to rewrite most of this, too many casts and too much boilerplate...
Well, `org.prlprg.ir.type.sexp` compiles...
`RType` = enhanced, fine-grained `Class` (added documentation on the "fine-grained" part). Also refactored and fixed `InstrData`, need to do finish `StmtData` and `JumpData` but we really need an idea of how this IR works before then. I'm probably now going to work on getting this into a merge-able state, even disabling the IR tests and commenting unfinished code.
Some of the tests for non-IR parts of the compiler don't pass, but I have to investigate, because it's the compiler inlining things that GNU-R doesn't. The IR is very unfinished, I had to disable the tests becase they wouldn't complete. `LatticeTests` also don't work, though they fail fast on relations that aren't yet fully implemented.
For seven functions: - xor (base) - isTRUE (base) - append (base) - mode (base) - anyDots (compiler) - missingArgs (compiler) - patchLabels (compiler) With both the potential annotations, and notes when I was manually reasoning about the optimizations.
they weren't actually tracked...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.