Emit llvm dereferenceable in more cases on newer LLVM versions#158863
Emit llvm dereferenceable in more cases on newer LLVM versions#158863WaffleLapkin wants to merge 1 commit into
Conversation
|
With LLVM 23 we can also put |
Specifically on llvm >= 23.0.0 emit llvm `dereferenceable` attribute even without `nofree`, since new semantics allow that. Co-authored-by: Nikita Popov <github@npopov.com>
|
@RalfJung yes. What currently stops rust/compiler/rustc_ty_utils/src/abi.rs Lines 406 to 424 in f10db29 With I suppose another way to put this is that rustc already uses dereferenceable-at-a-point semantics since #156281, and applies dereferenceable-at-a-point everywhere it's valid. The only check that prevents llvm |
|
Nice, that's what I was hoping for. :) This will be much easier to review once we actually have LLVM 23 and can look at the codegen test diff. |
On llvm >= 23 emit
dereferenceableeven withoutnofree, since llvm/llvm-project#204795 makesdereferenceableact "at a point" / not implynofree.r? nikic
I thought this will be a bit harder change, but since your refactoring in #156281 it's actually trivial ^^'
Draft because I don't think this can be tested prior to LLVM update. I'm also not sure if the version check I did is the appropriate one...
cc @RalfJung