Lines Matching refs:F
43 bool substituteIntrinsicCalls(Function *F);
44 Function *removeAggregateTypesFromSignature(Function *F);
81 Function *F = M->getFunction(Name); in getOrCreateFunction() local
82 if (F && F->getFunctionType() == FT) in getOrCreateFunction()
83 return F; in getOrCreateFunction()
85 if (F) in getOrCreateFunction()
86 NewF->setDSOLocal(F->isDSOLocal()); in getOrCreateFunction()
105 Function *F = M->getFunction(FuncName); in lowerIntrinsicToFunction() local
106 if (F) { in lowerIntrinsicToFunction()
107 Intrinsic->setCalledFunction(F); in lowerIntrinsicToFunction()
116 F = dyn_cast<Function>(FC.getCallee()); in lowerIntrinsicToFunction()
117 assert(F && "Callee must be a function"); in lowerIntrinsicToFunction()
122 Argument *Dest = F->getArg(0); in lowerIntrinsicToFunction()
123 Argument *Val = F->getArg(1); in lowerIntrinsicToFunction()
124 Argument *Len = F->getArg(2); in lowerIntrinsicToFunction()
125 Argument *IsVolatile = F->getArg(3); in lowerIntrinsicToFunction()
130 BasicBlock *EntryBB = BasicBlock::Create(M->getContext(), "entry", F); in lowerIntrinsicToFunction()
140 BasicBlock *EntryBB = BasicBlock::Create(M->getContext(), "entry", F); in lowerIntrinsicToFunction()
143 F->getArg(0)); in lowerIntrinsicToFunction()
251 Function *F = Intrinsic::getDeclaration( in lowerExpectAssume() local
253 II->setCalledFunction(F); in lowerExpectAssume()
255 Function *F = Intrinsic::getDeclaration( in lowerExpectAssume() local
258 II->setCalledFunction(F); in lowerExpectAssume()
282 bool SPIRVPrepareFunctions::substituteIntrinsicCalls(Function *F) { in substituteIntrinsicCalls() argument
284 for (BasicBlock &BB : *F) { in substituteIntrinsicCalls()
305 const SPIRVSubtarget &STI = TM.getSubtarget<SPIRVSubtarget>(*F); in substituteIntrinsicCalls()
319 SPIRVPrepareFunctions::removeAggregateTypesFromSignature(Function *F) { in removeAggregateTypesFromSignature() argument
320 IRBuilder<> B(F->getContext()); in removeAggregateTypesFromSignature()
322 bool IsRetAggr = F->getReturnType()->isAggregateType(); in removeAggregateTypesFromSignature()
324 std::any_of(F->arg_begin(), F->arg_end(), [](Argument &Arg) { in removeAggregateTypesFromSignature()
329 return F; in removeAggregateTypesFromSignature()
331 Type *RetType = IsRetAggr ? B.getInt32Ty() : F->getReturnType(); in removeAggregateTypesFromSignature()
333 ChangedTypes.push_back(std::pair<int, Type *>(-1, F->getReturnType())); in removeAggregateTypesFromSignature()
335 for (const auto &Arg : F->args()) { in removeAggregateTypesFromSignature()
344 FunctionType::get(RetType, ArgTypes, F->getFunctionType()->isVarArg()); in removeAggregateTypesFromSignature()
346 Function::Create(NewFTy, F->getLinkage(), F->getName(), *F->getParent()); in removeAggregateTypesFromSignature()
350 for (auto &Arg : F->args()) { in removeAggregateTypesFromSignature()
357 CloneFunctionInto(NewF, F, VMap, CloneFunctionChangeType::LocalChangesOnly, in removeAggregateTypesFromSignature()
359 NewF->takeName(F); in removeAggregateTypesFromSignature()
362 F->getParent()->getOrInsertNamedMetadata("spv.cloned_funcs"); in removeAggregateTypesFromSignature()
373 for (auto *U : make_early_inc_range(F->users())) { in removeAggregateTypesFromSignature()
376 U->replaceUsesOfWith(F, NewF); in removeAggregateTypesFromSignature()
383 for (Function &F : M) in runOnModule()
384 Changed |= substituteIntrinsicCalls(&F); in runOnModule()
387 for (auto &F : M) in runOnModule() local
388 FuncsWorklist.push_back(&F); in runOnModule()
390 for (auto *F : FuncsWorklist) { in runOnModule() local
391 Function *NewF = removeAggregateTypesFromSignature(F); in runOnModule()
393 if (NewF != F) { in runOnModule()
394 F->eraseFromParent(); in runOnModule()