Lines Matching defs:F

107 static FPParamVariant whichFPParamVariantNeeded(Function &F) {
108 switch (F.arg_size()) {
112 TypeID ArgTypeID = F.getFunctionType()->getParamType(0)->getTypeID();
123 TypeID ArgTypeID0 = F.getFunctionType()->getParamType(0)->getTypeID();
124 TypeID ArgTypeID1 = F.getFunctionType()->getParamType(1)->getTypeID();
157 static bool needsFPStubFromParams(Function &F) {
158 if (F.arg_size() >=1) {
159 Type *ArgType = F.getFunctionType()->getParamType(0);
171 static bool needsFPReturnHelper(Function &F) {
172 Type* RetType = F.getReturnType();
181 static bool needsFPHelperFromSig(Function &F) {
182 return needsFPStubFromParams(F) || needsFPReturnHelper(F);
257 static void assureFPCallStub(Function &F, Module *M,
264 std::string Name(F.getName());
272 FStub = Function::Create(F.getFunctionType(),
282 FPParamVariant PV = whichFPParamVariantNeeded(F);
371 static bool isIntrinsicInline(Function *F) {
373 std::end(IntrinsicInline), F->getName());
378 static bool fixupFPReturnAndCall(Function &F, Module *M,
383 for (auto &BB: F)
416 FunctionCallee F = (M->getOrInsertFunction(Name, A, MyVoid, T));
417 CallInst::Create(F, Params, "", I.getIterator());
424 F.addFnAttr("saveS2");
431 F.addFnAttr("saveS2");
445 static void createFPFnStub(Function *F, Module *M, FPParamVariant PV,
450 std::string Name(F->getName());
455 (F->getFunctionType(),
483 static void removeUseSoftFloat(Function &F) {
485 F.removeFnAttr("use-soft-float");
486 if (F.hasFnAttribute("use-soft-float")) {
489 F.addFnAttr("use-soft-float", "false");
513 for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) {
514 if (F->hasFnAttribute("nomips16") &&
515 F->hasFnAttribute("use-soft-float")) {
516 removeUseSoftFloat(*F);
519 if (F->isDeclaration() || F->hasFnAttribute("mips16_fp_stub") ||
520 F->hasFnAttribute("nomips16")) continue;
521 Modified |= fixupFPReturnAndCall(*F, &M, TM);
522 FPParamVariant V = whichFPParamVariantNeeded(*F);
525 createFPFnStub(&*F, &M, V, TM);