[LLVMdev] GVN incorrectly handling readnone parameter attribute?

Robert Lougher rob.lougher at gmail.com
Wed May 21 14:52:31 PDT 2014


On 21 May 2014 21:40, Robert Lougher <rob.lougher at gmail.com> wrote:
>
> define i32* @get_pntr(i32* readnone %p) {
> entry:
>   ret i32* %p
> }
>
> define void @store(i32* nocapture readnone %p) {
> entry:
>   store i32 10, i32* %p, align 4, !tbaa !1
>   ret void
> }
>

Further to my first post, based on the definition of readnone on an
argument, this is also incorrect.  After get_pntr() has been inlined
into store(), we are dereferencing %p, but it is still marked
readnone.

So we seem to have a couple of issues.  First GVN seems to be making
incorrect assumptions based on argument attributes, and secondly
inlining can invalidate existing attributes?

Thanks,
Rob.

--

Robert Lougher
SN Systems - Sony Computer Entertainment Group



More information about the llvm-dev mailing list