[PATCH] D79454: [IR] `byval` arguments cause reads at call sites

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 6 15:55:35 PDT 2020


jdoerfert added a comment.

In D79454#2023686 <https://reviews.llvm.org/D79454#2023686>, @efriedma wrote:

> > Now that I wrote this I am concerned we already have this problem without byval
>
> If you do an inbounds GEP on a deallocated pointer, I think the "inbounds"-ness should apply to what the allocation looked like during its lifetime.  (The only alternative is that gep effectively reads memory, and that's obviously a lot more problematic.)


We drift off here: The trick here is that there is no memory dependence but one on the implicit `dereferenceable` state which we need to obey as it could cause poison. It seems we are doing the right thing here even if `readnone` is present.

---

To the issue at hand, @efriedma what are your thoughts on https://reviews.llvm.org/D79454#2021902 and https://reviews.llvm.org/D79454#2023133 ? What we have now is arguably broken.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79454





More information about the llvm-commits mailing list