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

interactive: add rewrite functionality to gui tool 3/3 #2155

Merged
merged 18 commits into from
Feb 19, 2024

Conversation

dshaaban01
Copy link
Collaborator

attempt to split this PR into smaller ones.

PR 3

  • adjust compute_available_pass_list to compute all_possible_rewrites for given module and wrap them in an "individual rewrite pass" i.e. rewrites now passes
  • adjust get_pass_arguments function accordingly
  • add a test that makes sure rewrite functionality in gui tool works

Copy link

codecov bot commented Feb 13, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (889f3f8) 89.37% compared to head (2a7ed0f) 89.37%.
Report is 4 commits behind head on main.

Files Patch % Lines
xdsl/interactive/app.py 77.77% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #2155    +/-   ##
========================================
  Coverage   89.37%   89.37%            
========================================
  Files         310      310            
  Lines       37982    38101   +119     
  Branches     5607     5626    +19     
========================================
+ Hits        33945    34053   +108     
- Misses       3256     3261     +5     
- Partials      781      787     +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from cleanup2 to main February 13, 2024 15:13
rewrite_spec = list(
parse_pipeline(f"{rewrite_pass.name}{{{rewrite_spec_arg_str}}}")
)[0]
op = list(self.current_module.walk())[op_idx]
Copy link
Member

Choose a reason for hiding this comment

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

it looks like we only use the op to get its description, maybe we'd be better off getting that as part of the available rewrites? It also feels wasteful to get the nth op for every op if we already had this information in the past

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I add the op to what "get_all_possible_rewrites" returns. what do u think? does this make sense?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I considered removing the operation index, but I think we should leave it for now as it could be useful for future plans we have for functionalities (line numbers etc.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@superlopuh I realize now that maybe it is better to leave it the way that it is.

returning the str(Operation) from get_all_possible_rewrites():

When the rewrite is displayed in the gui, we now get

%0 = arith.addi %1, %2
instead of
Addi(%res = arith.addi %two, %n : i32)

returning the Operation from get_all_possible_rewrites() - (This wont work either way due to issues with testing and equality checking of an Operation):

When the rewrite is displayed in the gui, we now get

Addi(%0 = arith.addi %1, %2)
instead of
Addi(%res = arith.addi %two, %n : i32)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

#2162
@superlopuh told me to file an issue. we will address this later. will merge as is.

@dshaaban01 dshaaban01 merged commit 7665965 into main Feb 19, 2024
10 checks passed
@dshaaban01 dshaaban01 deleted the dalia/interactive/cleanupround2 branch February 19, 2024 13:51
superlopuh pushed a commit that referenced this pull request Feb 22, 2024
attempt to split t[his
PR](https://github.com/xdslproject/xdsl/pull/2131/files#diff-6c0fd122274ca87c3f88d46a4abe86a2d09289633359f7c9830925aeb2137178L56)
into smaller ones.

PR 3

- adjust compute_available_pass_list to compute all_possible_rewrites
for given module and wrap them in an "individual rewrite pass" i.e.
rewrites now passes
- adjust get_pass_arguments function accordingly
- add a test that makes sure rewrite functionality in gui tool works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interactive xdsl-gui things tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants