Skip to content

SSA CFG: Add printer#16709

Merged
clonker merged 1 commit into
developfrom
ssa-cfg-printer
May 18, 2026
Merged

SSA CFG: Add printer#16709
clonker merged 1 commit into
developfrom
ssa-cfg-printer

Conversation

@clonker

@clonker clonker commented May 12, 2026

Copy link
Copy Markdown
Member

Adds a textual representation of the SSACFGs

@clonker clonker requested a review from rodiazet May 12, 2026 14:22
@clonker clonker marked this pull request as ready for review May 12, 2026 14:23

@rodiazet rodiazet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like it. Some comments regarding the syntax. Haven’e checked the code itself. I would like to agree on syntax first.

Comment thread test/libyul/ssa/printer/for_loop.yul Outdated
// upsilon v0 -> ^v4
// jump #1
// #1:
// preds = #0, #3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would move to the line above together with the label:
#1: #0, #3 or #1: preds: #0, #3

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah that's nicer

Comment thread test/libyul/ssa/printer/function_call.yul
// jump #2
// #2:
// preds = #0, #1
// v6 = phi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In dot graph we have here a notation which shows what are possible block the value comes from. So maybe similar to upsilon we can have phi #0: v1, #1: v5.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hmmm. the whole point of the Pizlo form is that we don't have to have that :) I think as visualization it's fine, as textual IR I don't think we should add this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree, but on the other hand we already added a notation which allows us to easily see what are the connection in graph. It's pure visualization think but I'm not gonna die for this :)

Comment thread test/libyul/ssa/printer/for_loop.yul
@clonker clonker force-pushed the ssa-cfg-printer branch from cd212c0 to 5e433f6 Compare May 13, 2026 14:22
@rodiazet

Copy link
Copy Markdown
Contributor

Did you try to translate existing SSASFG tests expectations to this format?

@rodiazet rodiazet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice. LGTM. I think it would be good to at least make a test and try to translate existing SSACFG tests expectations to this format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants