[PATCH] D64258: [InferFuncAttributes] extend 'dereferenceable' attribute based on loads

JF Bastien via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 10 12:35:20 PDT 2019


jfb added a comment.

Are there ever cases where you know something is always dereferenceable based on where the memory lives? For example, globals can always be dereferenced, so can the stack (but I don't think the stack exists here). Are there other locations?

How do you deal with address spaces? Should you only infer this attribute for address space 0?

Also, would it make sense to separate readable from writable? We currently have this bug where LLVM will promote all const static globals to rodata, and sometimes generate atomic cmpxchg to them (e.g. because we're trying to load a 128-bit value). Similarly, we might want to honor R / W memory protection in general. Right now dereferenceable just means "you can load from this", because we can't speculate most stores.


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

https://reviews.llvm.org/D64258





More information about the llvm-commits mailing list