-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 -Z instrument-xray
flag
#102963
Add -Z instrument-xray
flag
#102963
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @compiler-errors (or someone else) soon. Please see the contribution instructions for more information. |
|
This comment has been minimized.
This comment has been minimized.
I'm not exactly qualified to review this, re-rolling! r? compiler |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Whew, that's surely a bunch of test that I was not aware of. Now should be all green. I gotta read more about |
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki |
I did a preliminary review, this looks fine, but I'll mark this as waiting on compiler team since the MCP is still open. |
☔ The latest upstream changes (presumably #103344) made this pull request unmergeable. Please resolve the merge conflicts. |
Hi, I've seen you changed some diagnostic structs in your PR. After #103345, the way we refer to fluent messages changed. They are now in a flat namespace with the same identifier as in the fluent file. For example, |
These commits modify compiler targets. |
☔ The latest upstream changes (presumably #104215) made this pull request unmergeable. Please resolve the merge conflicts. |
Is the PR review status updated? Is it waiting for its MCP to be seconded (as per comment cc @petrochenkov )? Thanks for an update. |
@apiraino, MCP is indeed still waiting to be seconded. Recent updates to PR were only resolving merge conflicts. No substantial changes since @petrochenkov's review. |
Rebased once again to resolve conflicts. MCP has been accepted, unblocking this PR. |
☔ The latest upstream changes (presumably #107679) made this pull request unmergeable. Please resolve the merge conflicts. |
r=me after rebasing once more |
Recognize all bells and whistles that LLVM's XRay pass is capable of. The always/never settings are a bit dumb without attributes but they're still there. The default instruction count is chosen by the compiler, not LLVM pass. We'll do it later.
I'm tired of testing it manually, just codify my expectations in tests. They're pretty low-maintenance.
Four because that's the new reasonable maximum for XRay instrumentation attributes in the following commit.
Add the attributes to functions according to the settings. "xray-always" overrides "xray-never", and they both override "xray-ignore-loops" and "xray-instruction-threshold", but we'll let lints deal with warnings about silly attribute combinations.
Let's add at least some tests to verify that this option is accepted and produces expected LLVM attributes. More tests can be added later with attribute support.
Specify where XRay is supported. I only test ARM64 and x86_64, but hey those others should work too, right? LLVM documentation says that MIPS and PPC are also supported, but I don't have the hardware, so I won't pretend. Naturally, more targets can be added later with more testing.
This is somewhat important because LLVM enables the pass based on target architecture, but support by the target OS also matters. For example, XRay attributes are processed by codegen for macOS targets, but Apple linker fails to process relocations in XRay data sections, so the feature as a whole is not supported there for the time being.
Now that the compiler accepts "-Z instrument-xray" option only when targeting one of the supported targets, make sure to not run the codegen tests where the compiler will fail. Like with other compiletests, we don't have access to internals, so simply hardcode a list of supported architectures here.
Once again, resolved merge conflicts. |
@bors r=estebank |
☀️ Test successful - checks-actions |
Finished benchmarking commit (a12d31d): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. |
Implement MCP rust-lang/compiler-team#561, adding
-Z instrument-xray
flag which enables XRay instrumentation in LLVM.