[PATCH] D84432: [IPSCCP] Drop argmemonly after replacing pointer argument.

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 10:30:27 PDT 2020


jdoerfert accepted this revision.
jdoerfert added a comment.
This revision is now accepted and ready to land.

In D84432#2170003 <https://reviews.llvm.org/D84432#2170003>, @fhahn wrote:

> In D84432#2169949 <https://reviews.llvm.org/D84432#2169949>, @jdoerfert wrote:
>
> > This doesn't "work" for
> >
> >   define internal void @ptrarg.5(i64 %arg, i32 %val) argmemonly inaccessiblemem_or_argmemonly nounwind {
> >     %p = inttoptr i64 %arg to i32* 
> >     store i32 %val, i32* %p
> >     ret void
> >   }
> >
> >
> > Unsure if that is a problem in the real world but I wanted to mention it.
>
>
> Is this valid (as in not UB)? For argmemonly, langref says `... loads and stores from objects pointed to by its pointer-typed arguments, with arbitrary offsets.`, but in the example we access an object not pointed to any pointer argument.


I think you're right.

> BTW, I think it would be good to have something like an attribute verifier. Catching all violations  is impossible, but at least some things could be checked :)

100% Agreed, patches welcome ;)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84432





More information about the llvm-commits mailing list