-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Use line numbers relative to the function in mir-opt tests #99780
Conversation
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
r? rust-lang/mir-opt |
This comment has been minimized.
This comment has been minimized.
bcd07bc
to
a948491
Compare
Maybe reuse already existing style like rust/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff Line 18 in c11207e
|
a948491
to
f795f79
Compare
Maybe we could make this info relative to the function start? That should avoid most of the noise, right? |
This should avoid most noise, yes. It would probably be a bit tricky to implement with the current code structure, but I could do it. What do you think would be the best way to solve this? Rename |
that sounds reasonable to me |
f795f79
to
b1640a3
Compare
b1640a3
to
cec398f
Compare
☔ The latest upstream changes (presumably #99816) made this pull request unmergeable. Please resolve the merge conflicts. |
cec398f
to
c2cb876
Compare
This comment has been minimized.
This comment has been minimized.
3709c2a
to
ba0af95
Compare
@bors r+ p=1 bitrotty |
📌 Commit ba0af9561870ee2ba942f48a31ed0260f3cb3469 has been approved by It is now in the queue for this repository. |
⌛ Testing commit ba0af9561870ee2ba942f48a31ed0260f3cb3469 with merge 2cba4390459755873c122e7fe462bcc216572595... |
I figured it out. Maybe it works now. |
abebba5
to
11c0280
Compare
@bors r=oli-obk |
This comment has been minimized.
This comment has been minimized.
@bors r- |
I think you're a bit late my friend, but thank you for your log analysis anyways :) |
@bors r=oli-obk |
This comment has been minimized.
This comment has been minimized.
☀️ Test successful - checks-actions |
Finished benchmarking commit (36f4f4a): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
Remove comments from mir-opt MIR dumps See https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Line.20numbers.20in.20mir-opt.20tests/near/363849874 In rust-lang#99780 there is mention that "there has been a zulip conversation about disabling line numbers with mixed opinions" which to me means that some people opposed this. I can't find the referenced conversation so... here we go. The current situation is quite chaotic. It's not hard to find MIR diffs which contain * Absolute line numbers * Relative line numbers * Substituted line numbers (LL) For example: https://github.com/rust-lang/rust/blob/408bbd040613f6776e0a7d05d582c81f4ddc189a/tests/mir-opt/inline/inline_shims.drop.Inline.diff#L10-L17 And sometimes adding a comment at the top of a mir-opt test generates a diff in the test because a line number changed: https://github.com/rust-lang/rust/pull/98112/files#diff-b8cf4bcce95078e6a3faf075e9abf6864872fb28a64d95c04f04513b9e3bbd81 And irrelevant changes to the standard library can generate diffs in mir-opt tests: https://github.com/rust-lang/rust/pull/110694/files#diff-bf96b0e7c67b8b272814536888fd9428c314991e155beae1f0a2a67f0ac47b2c rust-lang@769886c I think we should, specifically in mir-opt tests, completely remove the comments, or insert placeholders for all line and column numbers.
Remove comments from mir-opt MIR dumps See https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Line.20numbers.20in.20mir-opt.20tests/near/363849874 In rust-lang/rust#99780 there is mention that "there has been a zulip conversation about disabling line numbers with mixed opinions" which to me means that some people opposed this. I can't find the referenced conversation so... here we go. The current situation is quite chaotic. It's not hard to find MIR diffs which contain * Absolute line numbers * Relative line numbers * Substituted line numbers (LL) For example: https://github.com/rust-lang/rust/blob/408bbd040613f6776e0a7d05d582c81f4ddc189a/tests/mir-opt/inline/inline_shims.drop.Inline.diff#L10-L17 And sometimes adding a comment at the top of a mir-opt test generates a diff in the test because a line number changed: https://github.com/rust-lang/rust/pull/98112/files#diff-b8cf4bcce95078e6a3faf075e9abf6864872fb28a64d95c04f04513b9e3bbd81 And irrelevant changes to the standard library can generate diffs in mir-opt tests: https://github.com/rust-lang/rust/pull/110694/files#diff-bf96b0e7c67b8b272814536888fd9428c314991e155beae1f0a2a67f0ac47b2c rust-lang/rust@769886c I think we should, specifically in mir-opt tests, completely remove the comments, or insert placeholders for all line and column numbers.
As shown in #99770, the line numbers can be a big source of needless and confusing diffs. This PR adds a new flag
-Zmir-pretty-relative-line-numbers
to make them relative to the function declaration, which avoids most needless diffs from attribute changes.@JakobDegen told me that there has been a zulip conversation about disabling line numbers with mixed opinions, so I'd like to get some feedback here, for this hopefully better solution.
r? rust-lang/wg-mir-opt