Anonymous View
LLVM 23.0.0git
CFIFixup.cpp File Reference

Go to the source code of this file.

Classes

struct  BlockFlags
struct  InsertionPoint

Macros

#define DEBUG_TYPE   "cfi-fixup"

Typedefs

using BlockFlagsVector = SmallVector<BlockFlags, 32>

Functions

 INITIALIZE_PASS (CFIFixupLegacy, "cfi-fixup", "Insert CFI remember/restore state instructions", false, false) FunctionPass *llvm
static bool isPrologueCFIInstruction (const MachineInstr &MI)
static bool containsEpilogue (const MachineBasicBlock &MBB)
static MachineBasicBlockfindPrologueEnd (MachineFunction &MF, MachineBasicBlock::iterator &PrologueEnd)
static BlockFlagsVector computeBlockInfo (const MachineFunction &MF, const MachineBasicBlock *PrologueBlock)
static InsertionPoint insertRememberRestorePair (const InsertionPoint &RememberInsertPt, const InsertionPoint &RestoreInsertPt)
static InsertionPoint cloneCfiPrologue (const InsertionPoint &PrologueEnd, const InsertionPoint &DstInsertPt)
static bool fixupBlock (MachineBasicBlock &CurrBB, const BlockFlagsVector &BlockInfo, SmallDenseMap< MBBSectionID, InsertionPoint > &InsertionPts, const InsertionPoint &Prologue)
static bool runImpl (MachineFunction &MF)

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "cfi-fixup"

Definition at line 89 of file CFIFixup.cpp.

Typedef Documentation

◆ BlockFlagsVector

Definition at line 140 of file CFIFixup.cpp.

Function Documentation

◆ cloneCfiPrologue()

◆ computeBlockInfo()

◆ containsEpilogue()

bool containsEpilogue ( const MachineBasicBlock & MBB)
static

Definition at line 102 of file CFIFixup.cpp.

References llvm::any_of(), llvm::MachineInstr::FrameDestroy, MBB, MI, and llvm::reverse().

Referenced by computeBlockInfo().

◆ findPrologueEnd()

MachineBasicBlock * findPrologueEnd ( MachineFunction & MF,
MachineBasicBlock::iterator & PrologueEnd )
static

Definition at line 110 of file CFIFixup.cpp.

References isPrologueCFIInstruction(), MBB, MI, and llvm::reverse().

Referenced by runImpl().

◆ fixupBlock()

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( CFIFixupLegacy ,
"cfi-fixup" ,
"Insert CFI remember/restore state instructions" ,
false ,
false  )

Definition at line 93 of file CFIFixup.cpp.

References llvm::createCFIFixupLegacy().

◆ insertRememberRestorePair()

◆ isPrologueCFIInstruction()

bool isPrologueCFIInstruction ( const MachineInstr & MI)
static

Definition at line 97 of file CFIFixup.cpp.

References llvm::MachineInstr::FrameSetup, and MI.

Referenced by cloneCfiPrologue(), and findPrologueEnd().

◆ runImpl()

bool runImpl ( MachineFunction & MF)
static

Definition at line 304 of file CFIFixup.cpp.

References assert(), llvm::MachineBasicBlock::begin(), computeBlockInfo(), llvm::TargetFrameLowering::enableCFIFixup(), llvm::MachineFunction::end(), findPrologueEnd(), fixupBlock(), llvm::TargetSubtargetInfo::getFrameLowering(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineFunction::getNumBlockIDs(), llvm::MachineBasicBlock::getSectionID(), llvm::MachineFunction::getSubtarget(), llvm::make_range(), and MBB.

Referenced by INITIALIZE_PASS(), INITIALIZE_PASS(), llvm::AggressiveInstCombinePass::run(), llvm::AMDGPUAttributorCGSCCPass::run(), llvm::AMDGPUAttributorPass::run(), llvm::AnnotationRemarksPass::run(), llvm::CFIFixupPass::run(), llvm::ConstantHoistingPass::run(), llvm::CorrelatedValuePropagationPass::run(), llvm::DataFlowSanitizerPass::run(), llvm::DeadMachineInstructionElimPass::run(), llvm::ExpandIRInstsPass::run(), llvm::ExpandMemCmpPass::run(), llvm::FinalizeISelPass::run(), llvm::IndirectBrExpandPass::run(), llvm::InjectTLIMappings::run(), llvm::InlineAsmPreparePass::run(), llvm::InstSimplifyPass::run(), llvm::JMCInstrumenterPass::run(), llvm::LibCallsShrinkWrapPass::run(), llvm::LoopDistributePass::run(), llvm::LoopVersioningPass::run(), llvm::LowerGlobalDtorsPass::run(), llvm::LowerInvokePass::run(), llvm::MemCpyOptPass::run(), llvm::MergeICmpsPass::run(), llvm::NaryReassociatePass::run(), llvm::ObjCARCExpandPass::run(), llvm::ReplaceWithVeclib::run(), llvm::RewriteSymbolPass::run(), llvm::ScalarizeMaskedMemIntrinPass::run(), llvm::SLPVectorizerPass::run(), llvm::SPIRVMergeRegionExitTargets::run(), llvm::SPIRVRegularizer::run(), llvm::UnifyLoopExitsPass::run(), llvm::ReplaceWithVeclibLegacy::runOnFunction(), and llvm::CFIFixupLegacy::runOnMachineFunction().