@@ -127,7 +127,7 @@ class PreloadKernelArgInfo {
127127 // will also be preloaded even if that data is unused.
128128 Function *cloneFunctionWithPreloadImplicitArgs (unsigned LastPreloadIndex) {
129129 FunctionType *FT = F.getFunctionType ();
130- LLVMContext &Ctx = F.getParent ()-> getContext ();
130+ LLVMContext &Ctx = F.getContext ();
131131 SmallVector<Type *, 16 > FTypes (FT->param_begin (), FT->param_end ());
132132 for (unsigned I = 0 ; I <= LastPreloadIndex; ++I)
133133 FTypes.push_back (getHiddenArgType (Ctx, HiddenArg (I)));
@@ -196,7 +196,7 @@ class PreloadKernelArgInfo {
196196 SmallVector<std::pair<LoadInst *, unsigned >, 4 > ImplicitArgLoads;
197197 for (auto *U : ImplicitArgPtr->users ()) {
198198 Instruction *CI = dyn_cast<Instruction>(U);
199- if (!CI || CI->getParent ()-> getParent () != &F)
199+ if (!CI || CI->getFunction () != &F)
200200 continue ;
201201
202202 for (auto *U : CI->users ()) {
@@ -213,7 +213,7 @@ class PreloadKernelArgInfo {
213213 continue ;
214214
215215 // FIXME: Expand handle merged loads.
216- LLVMContext &Ctx = F.getParent ()-> getContext ();
216+ LLVMContext &Ctx = F.getContext ();
217217 Type *LoadTy = Load->getType ();
218218 HiddenArg HA = getHiddenArgFromOffset (Offset);
219219 if (HA == END_HIDDEN_ARGS || LoadTy != getHiddenArgType (Ctx, HA))
0 commit comments