[PATCH] D150043: [InferAddressSpaces] Handle vector of pointers type & Support intrinsic masked gather/scatter

CaprYang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 15 23:46:28 PDT 2023


CaprYang added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp:289
+
+static bool hasSameElementOfPtrOrVecPtrs(Type *Ty1, Type *Ty2) {
+  assert(isPtrOrVecOfPtrsType(Ty1) && isPtrOrVecOfPtrsType(Ty2));
----------------
CaprYang wrote:
> arsenm wrote:
> > arsenm wrote:
> > > Ditto, only opaque pointers matter now
> > You don't need to bother using getWithSamePointeeType. You can use Type::getWithNewType
> Does it mean this? do't check non-opaque types.
> 
> ```
> static Type *getPtrOrVecOfPtrsWithNewAS(Type *Ty, unsigned NewAddrSpace) {
>   assert(Ty->isPtrOrPtrVectorTy());
>   PointerType *NPT = PointerType::get(Ty->getContext(), NewAddrSpace);
>   return Ty->getWithNewType(NPT);
> }
> ```
@arsenm Excuse me... can you help me review again?


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

https://reviews.llvm.org/D150043



More information about the cfe-commits mailing list