LLVM: include/llvm/CodeGen/MachineJumpTableInfo.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19#ifndef LLVM_CODEGEN_MACHINEJUMPTABLEINFO_H

20#define LLVM_CODEGEN_MACHINEJUMPTABLEINFO_H

21

24#include

25#include

26

27namespace llvm {

28

33

34

35

37

38 std::vector<MachineBasicBlock*> MBBs;

39

40

41

43

45 const std::vector<MachineBasicBlock *> &M);

46};

47

49public:

50

51

53

54

56

57

58

59

61

62

63

64

66

67

68

69

70

71

72

73

75

76

77

78

79

81

82

83

85

86

87

89 };

90

91private:

92 JTEntryKind EntryKind;

93 std::vector JumpTables;

94public:

96

98

99

101

103

104

105

108

109

110

111 bool isEmpty() const { return JumpTables.empty(); }

112

113 const std::vector &getJumpTables() const {

114 return JumpTables;

115 }

116

117

118

121

122

123

125 JumpTables[Idx].MBBs.clear();

126 }

127

128

130

131

132

135

136

137

140

141

142

143

145

146

147

149};

150

151

152

153

154

155

156

157

159

160}

161

162#endif

A parsed version of the target data layout string in and methods for querying it.

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...

LLVM_ABI void print(raw_ostream &OS) const

print - Used by the MachineFunction printer to print information about jump tables.

void RemoveJumpTable(unsigned Idx)

RemoveJumpTable - Mark the specific index as being dead.

Definition MachineJumpTableInfo.h:124

LLVM_ABI unsigned getEntrySize(const DataLayout &TD) const

getEntrySize - Return the size of each entry in the jump table.

bool isEmpty() const

isEmpty - Return true if there are no jump tables.

Definition MachineJumpTableInfo.h:111

LLVM_ABI unsigned createJumpTableIndex(const std::vector< MachineBasicBlock * > &DestBBs)

createJumpTableIndex - Create a new jump table.

LLVM_ABI void dump() const

dump - Call to stderr.

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...

LLVM_ABI bool updateJumpTableEntryHotness(size_t JTI, MachineFunctionDataHotness Hotness)

MachineJumpTableInfo(JTEntryKind Kind)

Definition MachineJumpTableInfo.h:95

JTEntryKind

JTEntryKind - This enum indicates how each entry of the jump table is represented and emitted.

Definition MachineJumpTableInfo.h:52

@ EK_GPRel32BlockAddress

EK_GPRel32BlockAddress - Each entry is an address of block, encoded with a relocation as gp-relative,...

Definition MachineJumpTableInfo.h:65

@ EK_Inline

EK_Inline - Jump table entries are emitted inline at their point of use.

Definition MachineJumpTableInfo.h:84

@ EK_LabelDifference32

EK_LabelDifference32 - Each entry is the address of the block minus the address of the jump table.

Definition MachineJumpTableInfo.h:74

@ EK_Custom32

EK_Custom32 - Each entry is a 32-bit value that is custom lowered by the TargetLowering::LowerCustomJ...

Definition MachineJumpTableInfo.h:88

@ EK_LabelDifference64

EK_LabelDifference64 - Each entry is the address of the block minus the address of the jump table.

Definition MachineJumpTableInfo.h:80

@ EK_BlockAddress

EK_BlockAddress - Each entry is a plain address of block, e.g.: .word LBB123.

Definition MachineJumpTableInfo.h:55

@ EK_GPRel64BlockAddress

EK_GPRel64BlockAddress - Each entry is an address of block, encoded with a relocation as gp-relative,...

Definition MachineJumpTableInfo.h:60

LLVM_ABI unsigned getEntryAlignment(const DataLayout &TD) const

getEntryAlignment - Return the alignment of each entry in the jump table.

JTEntryKind getEntryKind() const

Definition MachineJumpTableInfo.h:97

const std::vector< MachineJumpTableEntry > & getJumpTables() const

Definition MachineJumpTableInfo.h:113

This class implements an extremely fast bulk output stream that can only output to a stream.

This is an optimization pass for GlobalISel generic memory operations.

LLVM_ABI Printable printJumpTableEntryReference(unsigned Idx)

Prints a jump table entry reference.

MachineFunctionDataHotness

LLVM_ABI MachineJumpTableEntry(const std::vector< MachineBasicBlock * > &M)

std::vector< MachineBasicBlock * > MBBs

MBBs - The vector of basic blocks from which to create the jump table.

Definition MachineJumpTableInfo.h:38

MachineFunctionDataHotness Hotness

The hotness of MJTE is inferred from the hotness of the source basic block(s) that reference it.

Definition MachineJumpTableInfo.h:42