[PATCH] D158081: [IR] Add writable attribute

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 18 11:14:42 PDT 2023


nikic added inline comments.


================
Comment at: llvm/test/Transforms/LICM/scalar-promote.ll:889
+define void @writable_cond_store(ptr sret(i32) noalias writable %ptr) {
+; CHECK-LABEL: @writable_cond_store(
 ; CHECK-NEXT:    [[PTR_PROMOTED:%.*]] = load i32, ptr [[PTR:%.*]], align 4
----------------
efriedma wrote:
> I'm not sure this transform is actually legal without `dereferenceable(4)`?  The way "writable" is specified, no "deferenceable" means no phantom store, so this is introducing a race.
`sret(%T)` implies `dereferenceable(sizeof(%T))`. I should probably tweak the wording to not talk about `dereferenceable(N)` specifically but attributes implying dereferenceability in general.

(And we should really drop the type argument from `sret` and make people specify `align` and `dereferenceable` instead...)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158081/new/

https://reviews.llvm.org/D158081



More information about the llvm-commits mailing list