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

core: Make printer scoped. #2614

Merged
merged 21 commits into from
May 24, 2024
Merged

core: Make printer scoped. #2614

merged 21 commits into from
May 24, 2024

Conversation

PapyChacal
Copy link
Collaborator

@PapyChacal PapyChacal commented May 21, 2024

Fixes #2609
See https://xdsl.zulipchat.com/#narrow/stream/364199-Beginners/topic/SSA.20Value.20name.20re-use.20is.20broken : please, come in and enjoy updating the filechecks 😉

This will indeed make future works less tedious!

On the changes:

  • Switch anonymous ssa_value/basic_block counters to stacks of counters
  • Switch name_hint disambiguation counters to stacks
  • Implement and expose enter_scope and exit_scope, simply pushing and popping on those stacks. So it's usable in different places if somebody wants to have fun in custom syntax? We can make those private first I guess
  • Use those in operation printing (Printer.print_op, after the results are printed!) to scope if the printed op happens to be IsolatedFromAbove

@PapyChacal PapyChacal added enhancement New feature or request core xDSL core (ir, textual format, ...) labels May 21, 2024
@PapyChacal PapyChacal self-assigned this May 21, 2024
@AntonLydike
Copy link
Collaborator

Thank you so much for this 👏 👏 👏

@AntonLydike
Copy link
Collaborator

I'm gonna take a shot at the failing tests that I know about

@PapyChacal PapyChacal marked this pull request as ready for review May 24, 2024 14:55
@PapyChacal PapyChacal requested a review from math-fehr May 24, 2024 14:57
Copy link

codecov bot commented May 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.58%. Comparing base (3b5343a) to head (fbc481e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2614   +/-   ##
=======================================
  Coverage   89.58%   89.58%           
=======================================
  Files         360      360           
  Lines       45959    45974   +15     
  Branches     6954     6960    +6     
=======================================
+ Hits        41171    41186   +15     
  Misses       3717     3717           
  Partials     1071     1071           

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

Copy link
Collaborator

@math-fehr math-fehr left a comment

Choose a reason for hiding this comment

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

Really cool!

@PapyChacal PapyChacal merged commit bec8203 into main May 24, 2024
9 checks passed
@PapyChacal PapyChacal deleted the emilien/printer-scope branch May 24, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core xDSL core (ir, textual format, ...) enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix SSA value name re-use
3 participants