[PATCH] D121157: [AMDGPU] always use underlying object in the pointsToConstantMemory

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 7 15:09:14 PST 2022


rampitec added a comment.

In D121157#3365638 <https://reviews.llvm.org/D121157#3365638>, @rampitec wrote:

> In D121157#3365629 <https://reviews.llvm.org/D121157#3365629>, @rampitec wrote:
>
>> 
>
> Sorry, it is actually LoadStoreVectorizer.cpp.

@arsenm believe it or not, this is actually your commit 42ad17059acc677b5d759cb02bd008e73ffacd4b from 2016! This:

  +    if (LoadTy->isPtrOrPtrVectorTy()) {
  +      LoadTy = Type::getIntNTy(F.getParent()->getContext(),
  +                               DL.getTypeSizeInBits(LoadTy));
  +      break;
  +    }

Try to compile this:

  define amdgpu_kernel void @const_arg_does_not_alias_global(i32 addrspace(1)* %arg, i32 addrspace(4)* %arg.const) {
  entry:
    %id = tail call i32 @llvm.amdgcn.workitem.id.x()
    %ptr = getelementptr inbounds i32, i32 addrspace(1)* %arg, i32 %id
    %ptr.const = getelementptr inbounds i32, i32 addrspace(4)* %arg.const, i32 %id
    store i32 42, i32 addrspace(1)* %ptr
    %v = load i32, i32 addrspace(4)* %ptr.const
    store i32 %v, i32* undef
    ret void
  }


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

https://reviews.llvm.org/D121157



More information about the llvm-commits mailing list