LLVM 22.0.0git
|
#include "llvm/CodeGen/SwiftErrorValueTracking.h"
Public Member Functions | |
void | setFunction (MachineFunction &MF) |
Initialize data structures for specified new function. | |
const Value * | getFunctionArg () const |
Get the (unique) function argument that was marked swifterror, or nullptr if this function has no swifterror args. | |
Register | getOrCreateVReg (const MachineBasicBlock *, const Value *) |
Get or create the swifterror value virtual register in VRegDefMap for this basic block. | |
void | setCurrentVReg (const MachineBasicBlock *MBB, const Value *, Register) |
Set the swifterror virtual register in the VRegDefMap for this basic block. | |
Register | getOrCreateVRegDefAt (const Instruction *, const MachineBasicBlock *, const Value *) |
Get or create the swifterror value virtual register for a def of a swifterror by an instruction. | |
Register | getOrCreateVRegUseAt (const Instruction *, const MachineBasicBlock *, const Value *) |
Get or create the swifterror value virtual register for a use of a swifterror by an instruction. | |
bool | createEntriesInEntryBlock (DebugLoc DbgLoc) |
Create initial definitions of swifterror values in the entry block of the current function. | |
void | propagateVRegs () |
Propagate assigned swifterror vregs through a function, synthesizing PHI nodes when needed to maintain consistency. | |
void | preassignVRegs (MachineBasicBlock *MBB, BasicBlock::const_iterator Begin, BasicBlock::const_iterator End) |
Definition at line 34 of file SwiftErrorValueTracking.h.
Create initial definitions of swifterror values in the entry block of the current function.
Definition at line 114 of file SwiftErrorValueTracking.cpp.
References llvm::BuildMI(), DL, llvm::MDNode::get(), MBB, and setCurrentVReg().
Get the (unique) function argument that was marked swifterror, or nullptr if this function has no swifterror args.
Definition at line 72 of file SwiftErrorValueTracking.h.
Register SwiftErrorValueTracking::getOrCreateVReg | ( | const MachineBasicBlock * | MBB, |
const Value * | Val ) |
Get or create the swifterror value virtual register in VRegDefMap for this basic block.
Definition at line 25 of file SwiftErrorValueTracking.cpp.
References DL, llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key, and MBB.
Referenced by getOrCreateVRegUseAt(), and propagateVRegs().
Register SwiftErrorValueTracking::getOrCreateVRegDefAt | ( | const Instruction * | I, |
const MachineBasicBlock * | MBB, | ||
const Value * | Val ) |
Get or create the swifterror value virtual register for a def of a swifterror by an instruction.
Definition at line 49 of file SwiftErrorValueTracking.cpp.
References DL, I, llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key, MBB, and setCurrentVReg().
Referenced by preassignVRegs().
Register SwiftErrorValueTracking::getOrCreateVRegUseAt | ( | const Instruction * | I, |
const MachineBasicBlock * | MBB, | ||
const Value * | Val ) |
Get or create the swifterror value virtual register for a use of a swifterror by an instruction.
Definition at line 64 of file SwiftErrorValueTracking.cpp.
References getOrCreateVReg(), I, llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key, and MBB.
Referenced by preassignVRegs().
void SwiftErrorValueTracking::preassignVRegs | ( | MachineBasicBlock * | MBB, |
BasicBlock::const_iterator | Begin, | ||
BasicBlock::const_iterator | End ) |
Definition at line 276 of file SwiftErrorValueTracking.cpp.
References assert(), llvm::dyn_cast(), F, getOrCreateVRegDefAt(), getOrCreateVRegUseAt(), llvm::Value::isSwiftError(), and MBB.
void SwiftErrorValueTracking::propagateVRegs | ( | ) |
Propagate assigned swifterror vregs through a function, synthesizing PHI nodes when needed to maintain consistency.
Propagate swifterror values through the machine function CFG.
Definition at line 146 of file SwiftErrorValueTracking.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::any_of(), assert(), llvm::ReversePostOrderTraversal< GraphT, GT >::begin(), llvm::BuildMI(), llvm::cast(), llvm::dwarf_linker::DebugLoc, DL, llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::ReversePostOrderTraversal< GraphT, GT >::end(), llvm::MDNode::get(), llvm::MachineBasicBlock::getFirstNonPHI(), llvm::MachineBasicBlock::getNumber(), getOrCreateVReg(), llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::isa(), MBB, MRI, PHI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), Register, setCurrentVReg(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
void SwiftErrorValueTracking::setCurrentVReg | ( | const MachineBasicBlock * | MBB, |
const Value * | Val, | ||
Register | VReg ) |
Set the swifterror virtual register in the VRegDefMap for this basic block.
Definition at line 44 of file SwiftErrorValueTracking.cpp.
References MBB.
Referenced by createEntriesInEntryBlock(), getOrCreateVRegDefAt(), and propagateVRegs().
void SwiftErrorValueTracking::setFunction | ( | MachineFunction & | mf | ) |
Initialize data structures for specified new function.
Set up SwiftErrorVals by going through the function.
If the function has swifterror argument, it will be the first entry.
Definition at line 78 of file SwiftErrorValueTracking.cpp.
References assert(), llvm::dyn_cast(), and llvm::MachineFunction::getFunction().