-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C++/C#: generate IR for funcs excluded in PrintIR #2975
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
Conversation
Previously, functions excluded from PrintIR would not have IR generated. This sometimes affected escacpe analysis of functions that were printed.
We could still have the exclusion in place for |
@jbj We could, but I'm not sure it's worth making the PrintIR queries diverge depending on the IR flavor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I'll wait to merge until later today to allow for further discussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait a minute. @rdmarsh2, can you compare PrintIR performance before and after on Wireshark, printing a single function? One of the original motivations for skipping IR construction was to reduce the cost of computing toString()
for every instruction, opera day, etc.
I can. I'm sure it will be much slower, but my personal preference would be to speed it up explicitly rather than have implicit differences between the printed IR and the IR that queries are using. |
Looks like it still tries to generate strings for everything... I let it run for 2 hours and it stalled out in a toString predicate. |
@rdmarsh2 Maybe some manual magic on the relevant string predicates would help? We really only need those strings for the IR that we're actually printing. I'm certainly willing to pay the price of constructing all of the IR itself, even if that's significant. |
I'd hoped to get buy-in for evaluating the whole IR during yesterday's meeting but we didn't get to it. I'll go ahead and experiment with manual magic. |
Timings on Wireshark to dump IR for a single function with the new changes, after IR evaluation:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I fixed the formatting failure, and everything else looks good, including the perf numbers.
@@ -307,13 +310,20 @@ class Instruction extends Construction::TInstruction { | |||
result = getResultString() + " = " + getOperationString() + " " + getOperandsString() | |||
} | |||
|
|||
predicate shouldGenerateDumpStrings() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
predicate shouldGenerateDumpStrings() { | |
private predicate shouldGenerateDumpStrings() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, missed this before I merged. I'll fix in another PR immediately.
Previously, functions excluded from PrintIR would not have IR
generated. This sometimes affected escape analysis of functions that
were printed.