Lines Matching refs:F
107 static FPParamVariant whichFPParamVariantNeeded(Function &F) { in whichFPParamVariantNeeded() argument
108 switch (F.arg_size()) { in whichFPParamVariantNeeded()
112 TypeID ArgTypeID = F.getFunctionType()->getParamType(0)->getTypeID(); in whichFPParamVariantNeeded()
123 TypeID ArgTypeID0 = F.getFunctionType()->getParamType(0)->getTypeID(); in whichFPParamVariantNeeded()
124 TypeID ArgTypeID1 = F.getFunctionType()->getParamType(1)->getTypeID(); in whichFPParamVariantNeeded()
157 static bool needsFPStubFromParams(Function &F) { in needsFPStubFromParams() argument
158 if (F.arg_size() >=1) { in needsFPStubFromParams()
159 Type *ArgType = F.getFunctionType()->getParamType(0); in needsFPStubFromParams()
171 static bool needsFPReturnHelper(Function &F) { in needsFPReturnHelper() argument
172 Type* RetType = F.getReturnType(); in needsFPReturnHelper()
181 static bool needsFPHelperFromSig(Function &F) { in needsFPHelperFromSig() argument
182 return needsFPStubFromParams(F) || needsFPReturnHelper(F); in needsFPHelperFromSig()
257 static void assureFPCallStub(Function &F, Module *M, in assureFPCallStub() argument
264 std::string Name = F.getName(); in assureFPCallStub()
272 FStub = Function::Create(F.getFunctionType(), in assureFPCallStub()
282 FPParamVariant PV = whichFPParamVariantNeeded(F); in assureFPCallStub()
371 static bool isIntrinsicInline(Function *F) { in isIntrinsicInline() argument
373 std::end(IntrinsicInline), F->getName()); in isIntrinsicInline()
378 static bool fixupFPReturnAndCall(Function &F, Module *M, in fixupFPReturnAndCall() argument
383 for (auto &BB: F) in fixupFPReturnAndCall()
418 Value *F = (M->getOrInsertFunction(Name, A, MyVoid, T)); in fixupFPReturnAndCall() local
419 CallInst::Create(F, Params, "", &I); in fixupFPReturnAndCall()
426 F.addFnAttr("saveS2"); in fixupFPReturnAndCall()
433 F.addFnAttr("saveS2"); in fixupFPReturnAndCall()
447 static void createFPFnStub(Function *F, Module *M, FPParamVariant PV, in createFPFnStub() argument
452 std::string Name = F->getName(); in createFPFnStub()
457 (F->getFunctionType(), in createFPFnStub()
485 static void removeUseSoftFloat(Function &F) { in removeUseSoftFloat() argument
489 F.removeAttributes(AttributeList::FunctionIndex, B); in removeUseSoftFloat()
490 if (F.hasFnAttribute("use-soft-float")) { in removeUseSoftFloat()
493 F.addAttributes(AttributeList::FunctionIndex, B); in removeUseSoftFloat()
517 for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) { in runOnModule() local
518 if (F->hasFnAttribute("nomips16") && in runOnModule()
519 F->hasFnAttribute("use-soft-float")) { in runOnModule()
520 removeUseSoftFloat(*F); in runOnModule()
523 if (F->isDeclaration() || F->hasFnAttribute("mips16_fp_stub") || in runOnModule()
524 F->hasFnAttribute("nomips16")) continue; in runOnModule()
525 Modified |= fixupFPReturnAndCall(*F, &M, TM); in runOnModule()
526 FPParamVariant V = whichFPParamVariantNeeded(*F); in runOnModule()
529 createFPFnStub(&*F, &M, V, TM); in runOnModule()