diff --git a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp --- a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp +++ b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp @@ -83,6 +83,11 @@ const FuncInfoTy &FuncInfo) const { auto &Flags = Arg.Flags[0]; const AttributeList &Attrs = FuncInfo.getAttributes(); + if (Arg.Ty->isPointerTy()) { + Flags.setPointer(); + Flags.setPointerAddrSpace( + cast(Arg.Ty)->getAddressSpace()); + } if (Attrs.hasAttribute(OpIdx, Attribute::ZExt)) Flags.setZExt(); if (Attrs.hasAttribute(OpIdx, Attribute::SExt))