Lines Matching refs:AFI
258 static void emitAligningInstructions(MachineFunction &MF, ARMFunctionInfo *AFI, in emitAligningInstructions() argument
270 assert(!AFI->isThumb1OnlyFunction() && "Thumb1 not supported"); in emitAligningInstructions()
271 if (!AFI->isThumbFunction()) { in emitAligningInstructions()
325 static int getMaxFPOffset(const ARMSubtarget &STI, const ARMFunctionInfo &AFI) { in getMaxFPOffset() argument
328 if (AFI.isThumb1OnlyFunction()) in getMaxFPOffset()
329 return -AFI.getArgRegsSaveSize() - (2 * 4); in getMaxFPOffset()
332 int FPCXTSaveSize = (STI.hasV8_1MMainlineOps() && AFI.isCmseNSEntryFunction()) ? 4 : 0; in getMaxFPOffset()
333 return - FPCXTSaveSize - AFI.getArgRegsSaveSize() - (8 * 4); in getMaxFPOffset()
340 ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>(); in emitPrologue() local
347 assert(!AFI->isThumb1OnlyFunction() && in emitPrologue()
349 bool isARM = !AFI->isThumbFunction(); in emitPrologue()
351 unsigned ArgRegsSaveSize = AFI->getArgRegsSaveSize(); in emitPrologue()
383 if (!AFI->hasStackFrame() && in emitPrologue()
430 if (Reg < ARM::D8 || Reg >= ARM::D8 + AFI->getNumAlignedDPRCS2Regs()) in emitPrologue()
461 assert(getMaxFPOffset(STI, *AFI) <= FPOffset && in emitPrologue()
464 AFI->setFramePtrSpillOffset(MFI.getObjectOffset(FramePtrSpillFI) + in emitPrologue()
467 AFI->setGPRCalleeSavedArea1Offset(GPRCS1Offset); in emitPrologue()
468 AFI->setGPRCalleeSavedArea2Offset(GPRCS2Offset); in emitPrologue()
469 AFI->setDPRCalleeSavedAreaOffset(DPRCSOffset); in emitPrologue()
502 if (AFI->getNumAlignedDPRCS2Regs() > 0) { in emitPrologue()
503 MBBI = skipAlignedDPRCS2Spills(MBBI, AFI->getNumAlignedDPRCS2Regs()); in emitPrologue()
561 if (AFI->getNumAlignedDPRCS2Regs() == 0 && in emitPrologue()
579 AFI->setShouldRestoreSPFromFP(true); in emitPrologue()
591 emitRegPlusImmediate(!AFI->isThumbFunction(), MBB, AfterPush, in emitPrologue()
682 (Reg < ARM::D8 || Reg >= ARM::D8 + AFI->getNumAlignedDPRCS2Regs())) { in emitPrologue()
702 AFI->getFramePtrSpillOffset()); in emitPrologue()
704 AFI->setFPCXTSaveAreaSize(FPCXTSaveSize); in emitPrologue()
705 AFI->setGPRCalleeSavedArea1Size(GPRCS1Size); in emitPrologue()
706 AFI->setGPRCalleeSavedArea2Size(GPRCS2Size); in emitPrologue()
707 AFI->setDPRCalleeSavedGapSize(DPRGapSize); in emitPrologue()
708 AFI->setDPRCalleeSavedAreaSize(DPRCSSize); in emitPrologue()
714 if (!AFI->getNumAlignedDPRCS2Regs() && RegInfo->needsStackRealignment(MF)) { in emitPrologue()
716 assert(!AFI->isThumb1OnlyFunction()); in emitPrologue()
717 if (!AFI->isThumbFunction()) { in emitPrologue()
718 emitAligningInstructions(MF, AFI, TII, MBB, MBBI, dl, ARM::SP, MaxAlign, in emitPrologue()
731 emitAligningInstructions(MF, AFI, TII, MBB, MBBI, dl, ARM::R4, MaxAlign, in emitPrologue()
738 AFI->setShouldRestoreSPFromFP(true); in emitPrologue()
762 AFI->setShouldRestoreSPFromFP(true); in emitPrologue()
768 ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>(); in emitEpilogue() local
772 assert(!AFI->isThumb1OnlyFunction() && in emitEpilogue()
774 bool isARM = !AFI->isThumbFunction(); in emitEpilogue()
776 unsigned ArgRegsSaveSize = AFI->getArgRegsSaveSize(); in emitEpilogue()
789 if (!AFI->hasStackFrame()) { in emitEpilogue()
806 AFI->getFPCXTSaveAreaSize() + in emitEpilogue()
807 AFI->getGPRCalleeSavedArea1Size() + in emitEpilogue()
808 AFI->getGPRCalleeSavedArea2Size() + in emitEpilogue()
809 AFI->getDPRCalleeSavedGapSize() + in emitEpilogue()
810 AFI->getDPRCalleeSavedAreaSize()); in emitEpilogue()
814 if (AFI->shouldRestoreSPFromFP()) { in emitEpilogue()
815 NumBytes = AFI->getFramePtrSpillOffset() - NumBytes; in emitEpilogue()
858 if (MBBI != MBB.end() && AFI->getDPRCalleeSavedAreaSize()) { in emitEpilogue()
865 if (AFI->getDPRCalleeSavedGapSize()) { in emitEpilogue()
866 assert(AFI->getDPRCalleeSavedGapSize() == 4 && in emitEpilogue()
868 emitSPUpdate(isARM, MBB, MBBI, dl, TII, AFI->getDPRCalleeSavedGapSize(), in emitEpilogue()
872 if (AFI->getGPRCalleeSavedArea2Size()) MBBI++; in emitEpilogue()
873 if (AFI->getGPRCalleeSavedArea1Size()) MBBI++; in emitEpilogue()
874 if (AFI->getFPCXTSaveAreaSize()) MBBI++; in emitEpilogue()
898 const ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>(); in ResolveFrameIndexReference() local
900 int FPOffset = Offset - AFI->getFramePtrSpillOffset(); in ResolveFrameIndexReference()
927 if (hasFP(MF) && AFI->hasStackFrame()) { in ResolveFrameIndexReference()
935 if (AFI->isThumb2Function()) { in ResolveFrameIndexReference()
944 } else if (AFI->isThumbFunction()) { in ResolveFrameIndexReference()
954 if (AFI->isThumb2Function() && FPOffset >= -255 && FPOffset < 0) { in ResolveFrameIndexReference()
1061 ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>(); in emitPopInst() local
1099 LdmOpc = AFI->isThumbFunction() ? ARM::t2LDMIA_RET : ARM::LDMIA_RET; in emitPopInst()
1104 LdmOpc = AFI->isThumbFunction() ? ARM::t2LDMIA_UPD : ARM::LDMIA_UPD; in emitPopInst()
1175 ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>(); in emitAlignedDPRCS2Spills() local
1209 bool isThumb = AFI->isThumbFunction(); in emitAlignedDPRCS2Spills()
1210 assert(!AFI->isThumb1OnlyFunction() && "Can't realign stack for thumb1"); in emitAlignedDPRCS2Spills()
1211 AFI->setShouldRestoreSPFromFP(true); in emitAlignedDPRCS2Spills()
1228 emitAligningInstructions(MF, AFI, TII, MBB, MI, DL, ARM::R4, MaxAlign, true); in emitAlignedDPRCS2Spills()
1348 ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>(); in emitAlignedDPRCS2Restores() local
1365 bool isThumb = AFI->isThumbFunction(); in emitAlignedDPRCS2Restores()
1366 assert(!AFI->isThumb1OnlyFunction() && "Can't realign stack for thumb1"); in emitAlignedDPRCS2Restores()
1439 ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>(); in spillCalleeSavedRegisters() local
1441 unsigned PushOpc = AFI->isThumbFunction() ? ARM::t2STMDB_UPD : ARM::STMDB_UPD; in spillCalleeSavedRegisters()
1442 unsigned PushOneOpc = AFI->isThumbFunction() ? in spillCalleeSavedRegisters()
1445 unsigned NumAlignedDPRCS2Regs = AFI->getNumAlignedDPRCS2Regs(); in spillCalleeSavedRegisters()
1479 ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>(); in restoreCalleeSavedRegisters() local
1480 bool isVarArg = AFI->getArgRegsSaveSize() > 0; in restoreCalleeSavedRegisters()
1481 unsigned NumAlignedDPRCS2Regs = AFI->getNumAlignedDPRCS2Regs(); in restoreCalleeSavedRegisters()
1488 unsigned PopOpc = AFI->isThumbFunction() ? ARM::t2LDMIA_UPD : ARM::LDMIA_UPD; in restoreCalleeSavedRegisters()
1489 unsigned LdrOpc = AFI->isThumbFunction() ? ARM::t2LDR_POST :ARM::LDR_POST_IMM; in restoreCalleeSavedRegisters()
1523 const ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>(); in estimateRSStackSizeLimit() local
1573 if (TFI->hasFP(MF) && AFI->hasStackFrame()) in estimateRSStackSizeLimit()
1677 ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>(); in determineCalleeSaves() local
1689 if (AFI->isThumb2Function() && in determineCalleeSaves()
1704 if (AFI->isThumb1OnlyFunction()) { in determineCalleeSaves()
1706 if (AFI->getArgRegsSaveSize() > 0) in determineCalleeSaves()
1728 if (STI.hasV8_1MMainlineOps() && AFI->isCmseNSEntryFunction()) in determineCalleeSaves()
1800 if (!LRSpilled && AFI->isThumb1OnlyFunction()) { in determineCalleeSaves()
1836 if (AFI->hasStackFrame()) in determineCalleeSaves()
1847 if (AFI->isThumb1OnlyFunction()) { in determineCalleeSaves()
1889 int MaxFPOffset = getMaxFPOffset(STI, *AFI); in determineCalleeSaves()
1901 AFI->setHasStackFrame(true); in determineCalleeSaves()
1936 if (AFI->isThumb1OnlyFunction()) { in determineCalleeSaves()
1963 int ExitRegDeficit = AFI->getReturnRegsCount() - 4; in determineCalleeSaves()
1964 LLVM_DEBUG(dbgs() << AFI->getReturnRegsCount() in determineCalleeSaves()
2054 bool ExpensiveLRRestore = AFI->isThumb1OnlyFunction() && MFI.hasTailCall(); in determineCalleeSaves()
2068 !AFI->isThumb1OnlyFunction()) in determineCalleeSaves()
2083 if (!AFI->isThumbFunction() || in determineCalleeSaves()
2091 !(Reg == ARM::LR && AFI->isThumb1OnlyFunction())) in determineCalleeSaves()
2096 } else if (!UnspilledCS2GPRs.empty() && !AFI->isThumb1OnlyFunction()) { in determineCalleeSaves()
2120 (!AFI->isThumb1OnlyFunction() || isARMLowRegister(Reg))) { in determineCalleeSaves()
2126 if (!AFI->isThumb1OnlyFunction()) { in determineCalleeSaves()
2157 AFI->setLRIsSpilled(SavedRegs.test(ARM::LR)); in determineCalleeSaves()
2167 const ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>(); in getCalleeSaves() local
2168 if (AFI->getPreservesR0()) in getCalleeSaves()
2211 ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>(); in eliminateCallFramePseudoInstr() local
2212 assert(!AFI->isThumb1OnlyFunction() && in eliminateCallFramePseudoInstr()
2214 bool isARM = !AFI->isThumbFunction(); in eliminateCallFramePseudoInstr()