LLVM 22.0.0git
|
#include "llvm/CodeGen/MachineJumpTableInfo.h"
Public Types | |
enum | JTEntryKind { EK_BlockAddress , EK_GPRel64BlockAddress , EK_GPRel32BlockAddress , EK_LabelDifference32 , EK_LabelDifference64 , EK_Inline , EK_Custom32 } |
JTEntryKind - This enum indicates how each entry of the jump table is represented and emitted. More... |
Public Member Functions | |
MachineJumpTableInfo (JTEntryKind Kind) | |
JTEntryKind | getEntryKind () const |
LLVM_ABI unsigned | getEntrySize (const DataLayout &TD) const |
getEntrySize - Return the size of each entry in the jump table. | |
LLVM_ABI unsigned | getEntryAlignment (const DataLayout &TD) const |
getEntryAlignment - Return the alignment of each entry in the jump table. | |
LLVM_ABI unsigned | createJumpTableIndex (const std::vector< MachineBasicBlock * > &DestBBs) |
createJumpTableIndex - Create a new jump table. | |
bool | isEmpty () const |
isEmpty - Return true if there are no jump tables. | |
const std::vector< MachineJumpTableEntry > & | getJumpTables () const |
LLVM_ABI bool | updateJumpTableEntryHotness (size_t JTI, MachineFunctionDataHotness Hotness) |
void | RemoveJumpTable (unsigned Idx) |
RemoveJumpTable - Mark the specific index as being dead. | |
LLVM_ABI bool | RemoveMBBFromJumpTables (MachineBasicBlock *MBB) |
RemoveMBBFromJumpTables - If MBB is present in any jump tables, remove it. | |
LLVM_ABI bool | ReplaceMBBInJumpTables (MachineBasicBlock *Old, MachineBasicBlock *New) |
ReplaceMBBInJumpTables - If Old is the target of any jump tables, update the jump tables to branch to New instead. | |
LLVM_ABI bool | ReplaceMBBInJumpTable (unsigned Idx, MachineBasicBlock *Old, MachineBasicBlock *New) |
ReplaceMBBInJumpTable - If Old is a target of the jump tables, update the jump table to branch to New instead. | |
LLVM_ABI void | print (raw_ostream &OS) const |
print - Used by the MachineFunction printer to print information about jump tables. | |
LLVM_ABI void | dump () const |
dump - Call to stderr. |
Definition at line 48 of file MachineJumpTableInfo.h.
JTEntryKind - This enum indicates how each entry of the jump table is represented and emitted.
Enumerator | |
---|---|
EK_BlockAddress | EK_BlockAddress - Each entry is a plain address of block, e.g.: .word LBB123. |
EK_GPRel64BlockAddress | EK_GPRel64BlockAddress - Each entry is an address of block, encoded with a relocation as gp-relative, e.g.: .gpdword LBB123. |
EK_GPRel32BlockAddress | EK_GPRel32BlockAddress - Each entry is an address of block, encoded with a relocation as gp-relative, e.g.: .gprel32 LBB123. |
EK_LabelDifference32 | EK_LabelDifference32 - Each entry is the address of the block minus the address of the jump table. This is used for PIC jump tables where gprel32 is not supported. e.g.: .word LBB123 - LJTI1_2 If the .set directive is supported, this is emitted as: .set L4_5_set_123, LBB123 - LJTI1_2 .word L4_5_set_123 |
EK_LabelDifference64 | EK_LabelDifference64 - Each entry is the address of the block minus the address of the jump table. This is used for PIC jump tables where gprel64 is not supported. e.g.: .quad LBB123 - LJTI1_2 |
EK_Inline | EK_Inline - Jump table entries are emitted inline at their point of use. It is the responsibility of the target to emit the entries. |
EK_Custom32 | EK_Custom32 - Each entry is a 32-bit value that is custom lowered by the TargetLowering::LowerCustomJumpTableEntry hook. |
Definition at line 52 of file MachineJumpTableInfo.h.
|
inlineexplicit |
Definition at line 95 of file MachineJumpTableInfo.h.
unsigned MachineJumpTableInfo::createJumpTableIndex | ( | const std::vector< MachineBasicBlock * > & | DestBBs | ) |
createJumpTableIndex - Create a new jump table.
Create a new jump table entry in the jump table info.
Definition at line 1379 of file MachineFunction.cpp.
References assert().
Referenced by llvm::SwitchCG::SwitchLowering::buildJumpTable(), llvm::VETargetLowering::emitSjLjDispatchBlock(), and llvm::MIRParserImpl::initializeJumpTableInfo().
LLVM_DUMP_METHOD void MachineJumpTableInfo::dump | ( | ) | const |
dump - Call to stderr.
Definition at line 1452 of file MachineFunction.cpp.
References llvm::dbgs(), LLVM_DUMP_METHOD, and print().
unsigned MachineJumpTableInfo::getEntryAlignment | ( | const DataLayout & | TD | ) | const |
getEntryAlignment - Return the alignment of each entry in the jump table.
Return the alignment of each entry in the jump table.
Definition at line 1358 of file MachineFunction.cpp.
References EK_BlockAddress, EK_Custom32, EK_GPRel32BlockAddress, EK_GPRel64BlockAddress, EK_Inline, EK_LabelDifference32, EK_LabelDifference64, llvm::DataLayout::getABIIntegerTypeAlignment(), getEntryKind(), llvm::DataLayout::getPointerABIAlignment(), llvm_unreachable, and llvm::Align::value().
|
inline |
Definition at line 97 of file MachineJumpTableInfo.h.
Referenced by convertMJTI(), llvm::AsmPrinter::emitJumpTableEntry(), llvm::BPFAsmPrinter::emitJumpTableInfo(), getEntryAlignment(), and getEntrySize().
unsigned MachineJumpTableInfo::getEntrySize | ( | const DataLayout & | TD | ) | const |
getEntrySize - Return the size of each entry in the jump table.
Return the size of each entry in the jump table.
Definition at line 1338 of file MachineFunction.cpp.
References EK_BlockAddress, EK_Custom32, EK_GPRel32BlockAddress, EK_GPRel64BlockAddress, EK_Inline, EK_LabelDifference32, EK_LabelDifference64, getEntryKind(), llvm::DataLayout::getPointerSize(), and llvm_unreachable.
Referenced by llvm::AsmPrinter::emitJumpTableEntry(), and llvm::BPFAsmPrinter::emitJumpTableInfo().
|
inline |
Definition at line 113 of file MachineJumpTableInfo.h.
Referenced by convertMJTI(), llvm::ARMAsmPrinter::emitJumpTableAddrs(), llvm::AsmPrinter::emitJumpTableInfo(), llvm::BPFAsmPrinter::emitJumpTableInfo(), llvm::ARMAsmPrinter::emitJumpTableInsts(), llvm::ARMAsmPrinter::emitJumpTableTBInst(), EstimateFunctionSizeInBytes(), jumpTableHasOtherUses(), and llvm::BranchFolder::OptimizeFunction().
|
inline |
isEmpty - Return true if there are no jump tables.
Definition at line 111 of file MachineJumpTableInfo.h.
void MachineJumpTableInfo::print | ( | raw_ostream & | OS | ) | const |
print - Used by the MachineFunction printer to print information about jump tables.
Implemented in MachineFunction.cpp
Definition at line 1435 of file MachineFunction.cpp.
References MBB, llvm::printJumpTableEntryReference(), and llvm::printMBBReference().
Referenced by dump().
|
inline |
RemoveJumpTable - Mark the specific index as being dead.
This will prevent it from being emitted.
Definition at line 124 of file MachineJumpTableInfo.h.
Referenced by llvm::BranchFolder::OptimizeFunction().
bool MachineJumpTableInfo::RemoveMBBFromJumpTables | ( | MachineBasicBlock * | MBB | ) |
RemoveMBBFromJumpTables - If MBB is present in any jump tables, remove it.
If MBB is present in any jump tables, remove it.
Definition at line 1409 of file MachineFunction.cpp.
References MBB.
bool MachineJumpTableInfo::ReplaceMBBInJumpTable | ( | unsigned | Idx, |
MachineBasicBlock * | Old, | ||
MachineBasicBlock * | New ) |
ReplaceMBBInJumpTable - If Old is a target of the jump tables, update the jump table to branch to New instead.
If Old is a target of the jump tables, update the jump table to branch to New instead.
Definition at line 1421 of file MachineFunction.cpp.
References assert(), MBB, and llvm::MachineJumpTableEntry::MBBs.
Referenced by ReplaceMBBInJumpTables(), and llvm::MachineBasicBlock::SplitCriticalEdge().
bool MachineJumpTableInfo::ReplaceMBBInJumpTables | ( | MachineBasicBlock * | Old, |
MachineBasicBlock * | New ) |
ReplaceMBBInJumpTables - If Old is the target of any jump tables, update the jump tables to branch to New instead.
If Old is the target of any jump tables, update the jump tables to branch to New instead.
Definition at line 1399 of file MachineFunction.cpp.
References assert(), and ReplaceMBBInJumpTable().
Referenced by GCEmptyBasicBlocks::runOnMachineFunction().
bool MachineJumpTableInfo::updateJumpTableEntryHotness | ( | size_t | JTI, |
MachineFunctionDataHotness | Hotness ) |
Definition at line 1386 of file MachineFunction.cpp.
References assert().