Skip to content
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

expose a way to mark cold/hot branches with llvm.expect #10137

Closed
thestinger opened this issue Oct 29, 2013 · 3 comments
Closed

expose a way to mark cold/hot branches with llvm.expect #10137

thestinger opened this issue Oct 29, 2013 · 3 comments
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code.

Comments

@thestinger
Copy link
Contributor

There are places where this would be very useful like the slow path in a vector push method. Sadly, there's not an obvious way to expose llvm.expect because a regular Rust intrinsic becomes a function and lower-expect runs in the function pass stage.

@jdm
Copy link
Contributor

jdm commented Oct 29, 2013

See #8291 where llvm.expect was turned down.

@thestinger
Copy link
Contributor Author

@jdm: I've seen it, but I still think this is a useful feature. It's true that there are only rare use cases where it's a good idea, and I already covered most failure cases by marking the fail_ lang item as a cold.

@thestinger
Copy link
Contributor Author

This can actually already be done with #[link_name].

flip1995 pushed a commit to flip1995/rust that referenced this issue Jan 12, 2023
reword dbg_macro labels

---

This change rewords the `dbg_macro` lint labels to be clearer.

changelog: none
<!-- changelog_checked -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

No branches or pull requests

2 participants