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

Aliasing hints are based on AST types, but should be based on monormorphized ty::t #7260

Closed
nikomatsakis opened this issue Jun 20, 2013 · 3 comments
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.

Comments

@nikomatsakis
Copy link
Contributor

We have some simple hints to detect when ~T pointers are passed and tell LLVM they are unique. These hints should be based on the monomorphized ty::t, but they are currently based on the AST. This isn't wrong, it just misses optimization opportunities.

See FIXME.

@msullivan
Copy link
Contributor

What optimization opportunities does this miss?

@thestinger
Copy link
Contributor

If you have a generic function where T expands to ~int. It would be easy to fix.

@msullivan
Copy link
Contributor

Yeah, I realized that just as I pressed comment. This should be super easy to fix. I can do it.

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 3, 2021
Add lint `manual_str_repeat`

fixes: rust-lang#7260

There's a similar function for slices. Should this be renamed to include it, or should that be a separate lint? If we are going to have them as one lint a better name will be needed. `manual_repeat` isn't exactly clear as it's replacing a call to `iter::repeat`.

changelog: Add new lint `manual_str_repeat`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
Projects
None yet
Development

No branches or pull requests

3 participants