-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
add #[cold] attribute to abort intrinsic for optimization hints #150703
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
|
Does this attribute even work when applied to an intrinsic (which is not a regular function)? |
|
I have no idea, But even if that is the case couldn't we wrap it in another function and make it cold for optimization reason? |
|
This might cause branch weight metadata to be produced in more cases because of this logic:
But also this intrinsic lowers to There is no reason to add a wrapper. |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
add #[cold] attribute to abort intrinsic for optimization hints
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (5d0861d): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary -0.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.5%, secondary 3.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.0%, secondary 0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 474.563s -> 472.66s (-0.40%) |
Hey,
as
std::process::abortalready has#[cold]attribute, and large part of rust core(no-std) is relying onintrinsics::abortinstead, I believe marking it as cold will help the compiler generate more optimized code.