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

Add simple IR printer for the verifier. #54973

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add simple IR printer for the verifier. #54973

wants to merge 2 commits into from

Conversation

gbaraldi
Copy link
Member

This is useful for debugging during bootstrapping.
image

@gbaraldi gbaraldi requested review from Keno and topolarity June 28, 2024 16:48
Comment on lines +15 to +20
print(Core.stderr, "Block ")
print(Core.stderr, block_for_inst(ir, i))
print(Core.stderr, " ")
print(Core.stderr, "%")
print(Core.stderr, i)
print(Core.stderr, " = ")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
print(Core.stderr, "Block ")
print(Core.stderr, block_for_inst(ir, i))
print(Core.stderr, " ")
print(Core.stderr, "%")
print(Core.stderr, i)
print(Core.stderr, " = ")
print(Core.stderr, "[", block_for_inst(ir, i), "] %", i, " = ")

Comment on lines +22 to +24
print(Core.stderr, " :: ")
print(Core.stderr, ir.stmts[i][:type])
println(Core.stderr, "")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
print(Core.stderr, " :: ")
print(Core.stderr, ir.stmts[i][:type])
println(Core.stderr, "")
println(Core.stderr, "::", ir.stmts[i][:type])

Comment on lines +12 to +13
print(Core.stderr, " sptypes ")
println(Core.stderr, ir.sptypes)
Copy link
Member

Choose a reason for hiding this comment

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

I think we can exclude these sptypes after all (esp. since their array prints poorly)

print(Core.stderr, "Verification error in IR for function ")
print(Core.stderr, ir.argtypes[1])
print(Core.stderr, " with args ")
println(Core.stderr, ir.argtypes[2:end])
Copy link
Member

Choose a reason for hiding this comment

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

This should probably either do its own array printing like you do below, or we should go ahead and finally fix how Array is printed in Core

@vtjnash
Copy link
Sponsor Member

vtjnash commented Jun 28, 2024

Sounds fine, though I sort of think the full way to do this is to write a parser for the precise output that we do now (for using in a functional julia session) which converts that content back into Expr, then use the standard IR printer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants