[PATCH] D79213: [hip] Add noalias on restrict qualified coerced hip pointers

Austin Kerbow via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 30 18:35:17 PDT 2020


kerbowa added inline comments.


================
Comment at: clang/lib/CodeGen/CGCall.cpp:2270
+         CGF.ConvertType(Ty)->getPointerAddressSpace() == 0 &&
+         ArgI.getCoerceToType()->getPointerElementType() ==
+             CGF.ConvertType(Ty)->getPointerElementType();
----------------
yaxunl wrote:
> kerbowa wrote:
> > yaxunl wrote:
> > > For struct containing pointers, we do recursive coercing 
> > > 
> > > https://github.com/llvm/llvm-project/blob/master/clang/lib/CodeGen/TargetInfo.cpp#L8224
> > > 
> > > So solely compare element type will fail. We need to add a test case for struct containing pointer, and we need to have a recursive comparison in a similar way as above code.
> > I can add it, but are we sure it's what we want? I think OpenCL/hcc wont have the same behavior because of https://github.com/llvm/llvm-project/blob/master/clang/lib/CodeGen/CGCall.cpp#L2435.
> Michael said without that there were extra flat load/stores. That's why he did that intentionally.
Okay. What I mean is that OpenCL/hcc don't add noalias recursively to struct members that are restrict qualified. Is there any reason not to do it?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79213





More information about the cfe-commits mailing list