Lines Matching refs:F
115 static FPParamVariant whichFPParamVariantNeeded(Function &F) { in whichFPParamVariantNeeded() argument
116 switch (F.arg_size()) { in whichFPParamVariantNeeded()
120 TypeID ArgTypeID = F.getFunctionType()->getParamType(0)->getTypeID(); in whichFPParamVariantNeeded()
131 TypeID ArgTypeID0 = F.getFunctionType()->getParamType(0)->getTypeID(); in whichFPParamVariantNeeded()
132 TypeID ArgTypeID1 = F.getFunctionType()->getParamType(1)->getTypeID(); in whichFPParamVariantNeeded()
166 static bool needsFPStubFromParams(Function &F) { in needsFPStubFromParams() argument
167 if (F.arg_size() >=1) { in needsFPStubFromParams()
168 Type *ArgType = F.getFunctionType()->getParamType(0); in needsFPStubFromParams()
180 static bool needsFPReturnHelper(Function &F) { in needsFPReturnHelper() argument
181 Type* RetType = F.getReturnType(); in needsFPReturnHelper()
190 static bool needsFPHelperFromSig(Function &F) { in needsFPHelperFromSig() argument
191 return needsFPStubFromParams(F) || needsFPReturnHelper(F); in needsFPHelperFromSig()
261 static void assureFPCallStub(Function &F, Module *M, in assureFPCallStub() argument
268 std::string Name = F.getName(); in assureFPCallStub()
276 FStub = Function::Create(F.getFunctionType(), in assureFPCallStub()
288 FPParamVariant PV = whichFPParamVariantNeeded(F); in assureFPCallStub()
368 static bool isIntrinsicInline(Function *F) { in isIntrinsicInline() argument
370 std::end(IntrinsicInline), F->getName()); in isIntrinsicInline()
376 static bool fixupFPReturnAndCall(Function &F, Module *M, in fixupFPReturnAndCall() argument
381 for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) in fixupFPReturnAndCall()
418 Value *F = (M->getOrInsertFunction(Name, A, MyVoid, T, nullptr)); in fixupFPReturnAndCall() local
419 CallInst::Create(F, Params, "", &Inst ); in fixupFPReturnAndCall()
432 F.addFnAttr("saveS2"); in fixupFPReturnAndCall()
439 F.addFnAttr("saveS2"); in fixupFPReturnAndCall()
453 static void createFPFnStub(Function *F, Module *M, FPParamVariant PV, in createFPFnStub() argument
458 std::string Name = F->getName(); in createFPFnStub()
463 (F->getFunctionType(), in createFPFnStub()
492 static void removeUseSoftFloat(Function &F) { in removeUseSoftFloat() argument
495 A = A.addAttribute(F.getContext(), AttributeSet::FunctionIndex, in removeUseSoftFloat()
497 F.removeAttributes(AttributeSet::FunctionIndex, A); in removeUseSoftFloat()
498 if (F.hasFnAttribute("use-soft-float")) { in removeUseSoftFloat()
501 F.addAttributes(AttributeSet::FunctionIndex, A); in removeUseSoftFloat()
526 for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) { in runOnModule() local
527 if (F->hasFnAttribute("nomips16") && in runOnModule()
528 F->hasFnAttribute("use-soft-float")) { in runOnModule()
529 removeUseSoftFloat(*F); in runOnModule()
532 if (F->isDeclaration() || F->hasFnAttribute("mips16_fp_stub") || in runOnModule()
533 F->hasFnAttribute("nomips16")) continue; in runOnModule()
534 Modified |= fixupFPReturnAndCall(*F, &M, TM); in runOnModule()
535 FPParamVariant V = whichFPParamVariantNeeded(*F); in runOnModule()
538 createFPFnStub(F, &M, V, TM); in runOnModule()