-
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
Update to LLVM head and mark various ptrs as nonnull. #14306
Conversation
These also need to be marked in trans/callee.rs for indirect calls. It seems marking the out pointer as |
Does this help with #11751 at all? (I'd guess not, since the pointers are all nested there.) |
I think it might help if LLVM learned to leveraged the |
(actually it's not going to help either way) |
I do think that there are many more venues of optimization possible here, but this should hopefully be a clear win in at least some situations. For example, this doesn't look like this handles structs which contain non-null pointers. Things like trait objects, tuples, slices, etc, will all benefit from that, but just attaching to a parameter may not be sufficient. This is merged upstream, however, and this definitely isn't detrimental, so let's push forward and see how far we can get with these optimizations! |
cc #9546 |
ty::ty_rptr(_, mt) if mt.mutbl == ast::MutMutable => { | ||
attrs.push((idx, lib::llvm::NoAliasAttribute as u64)); | ||
attrs.push((idx, lib::llvm::NonNullAttribute as u64)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case doesn't get nocapture, but sometimes it may be able to?
Nice cleanup! |
r=me with a squash of the last three commits (they all seem very closely related) |
…uments and returns.
We can now mark arguments and returns as `nonnull` in LLVM. It's still somewhat limited by the fact that LLVM loses this information after inlining but it might help in certain cases.
fix block with no termination in or patterns fix rust-lang#14298
We can now mark arguments and returns as
nonnull
in LLVM. It's still somewhat limited by the fact that LLVM loses this information after inlining but it might help in certain cases.