-
Notifications
You must be signed in to change notification settings - Fork 10.5k
SIL: don't print operand types in textual SIL #77763
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
@swift-ci test |
@rjmccall I'm replying in this PR to your comment in #77714
It would not call this a dialect. It just makes printing the type annotations optional.
Yes, that's exactly how it works. |
22a8bc5
to
a2e0c6f
Compare
@swift-ci test |
The original intention of those REQUIRE lines where to limit the tests to run on 64 bit architectures.
Type annotations for instruction operands are omitted, e.g. ``` %3 = struct $S(%1, %2) ``` Operand types are redundant anyway and were only used for sanity checking in the SIL parser. But: operand types _are_ printed if the definition of the operand value was not printed yet. This happens: * if the block with the definition appears after the block where the operand's instruction is located * if a block or instruction is printed in isolation, e.g. in a debugger The old behavior can be restored with `-Xllvm -sil-print-types`. This option is added to many existing test files which check for operand types in their check-lines.
a2e0c6f
to
d59d357
Compare
@swift-ci test |
Ah, yes, if that was the existing behavior of your patch, then (1) I definitely misunderstood what you were proposing and (2) I agree that this not a dialect. "Pure" SIL sounded much more like a dialect. |
|
||
llvm::cl::opt<bool> | ||
SILPrintNoUses("sil-print-no-uses", llvm::cl::init(false), | ||
llvm::cl::desc("omit use comments in SIL output")); |
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.
I know we have a bunch of this already, but we really need to kick the habit of using global llvm::cl::opt
s instead of breaking down the command line into a context and threading that context into passes. This stuff all turns into global constructors that have to run in every process that even links this code in. The Carbon folks are finding that the uses in the LLVM passes alone are a significant contributor to their compile times; admittedly, they have a much faster compiler overall, but still.
Anyway, just feedback for a later PR.
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.
Yeah, we should clean up our command line options
This was missing from swiftlang#77763
Type annotations for instruction operands are omitted, e.g.
Operand types are redundant anyway and were only used for sanity checking in the SIL parser.
But: operand types are printed if the definition of the operand value was not printed yet.
This happens:
if the block with the definition appears after the block where the operand's instruction is located
if a block or instruction is printed in isolation, e.g. in a debugger
The old behavior can be restored with
-Xllvm -sil-print-types
.This option is added to many existing test files which check for operand types in their check-lines.
Also add
-Xllvm -sil-print-no-uses
to not print use-list comments in textual SIL.(This PR was originally part of #77714)