LLVM: include/llvm/Analysis/InstructionPrecedenceTracking.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20#ifndef LLVM_ANALYSIS_INSTRUCTIONPRECEDENCETRACKING_H

21#define LLVM_ANALYSIS_INSTRUCTIONPRECEDENCETRACKING_H

22

25

26namespace llvm {

27

30

32

33

34

36

37#ifndef NDEBUG

38

39

40

41 void validate(const BasicBlock *BB) const;

42

43

44

45

46 void validateAll() const;

47#endif

48

49protected:

50

51

53

54

55

57

58

59

61

62

63

64

65

66

68

70

71public:

72

73

74

77

78

79

81

82

83

84

86

87

89};

90

91

92

93

94

95

96

97

100public:

101

102

106

107

108

112

113

117

118 bool isSpecialInstruction(const Instruction *Insn) const override;

119};

120

122public:

123

124

128

129

130

134

135

136

140

141 bool isSpecialInstruction(const Instruction *Insn) const override;

142};

143

144}

145

146#endif

This file defines the DenseMap class.

LLVM Basic Block Representation.

This class allows to keep track on instructions with implicit control flow.

Definition InstructionPrecedenceTracking.h:99

const Instruction * getFirstICFI(const BasicBlock *BB)

Returns the topmost instruction with implicit control flow from the given basic block.

Definition InstructionPrecedenceTracking.h:103

bool isDominatedByICFIFromSameBlock(const Instruction *Insn)

Returns true if the first ICFI of Insn's block exists and dominates Insn.

Definition InstructionPrecedenceTracking.h:114

bool hasICF(const BasicBlock *BB)

Returns true if at least one instruction from the given basic block has implicit control flow.

Definition InstructionPrecedenceTracking.h:109

LLVM_ABI void clear()

Invalidates all information from this tracking.

LLVM_ABI void removeUsersOf(const Instruction *Inst)

Notifies this tracking that we are going to replace all uses of Inst.

virtual ~InstructionPrecedenceTracking()=default

LLVM_ABI void insertInstructionTo(const Instruction *Inst, const BasicBlock *BB)

Notifies this tracking that we are going to insert a new instruction Inst to the basic block BB.

LLVM_ABI void removeInstruction(const Instruction *Inst)

Notifies this tracking that we are going to remove the instruction Inst It makes all necessary update...

LLVM_ABI const Instruction * getFirstSpecialInstruction(const BasicBlock *BB)

Returns the topmost special instruction from the block BB.

virtual bool isSpecialInstruction(const Instruction *Insn) const =0

A predicate that defines whether or not the instruction Insn is considered special and needs to be tr...

LLVM_ABI bool hasSpecialInstructions(const BasicBlock *BB)

Returns true iff at least one instruction from the basic block BB is special.

LLVM_ABI bool isPreceededBySpecialInstruction(const Instruction *Insn)

Returns true iff the first special instruction of Insn's block exists and dominates Insn.

bool mayWriteToMemory(const BasicBlock *BB)

Returns true if at least one instruction from the given basic block may write memory.

Definition InstructionPrecedenceTracking.h:131

bool isDominatedByMemoryWriteFromSameBlock(const Instruction *Insn)

Returns true if the first memory writing instruction of Insn's block exists and dominates Insn.

Definition InstructionPrecedenceTracking.h:137

const Instruction * getFirstMemoryWrite(const BasicBlock *BB)

Returns the topmost instruction that may write memory from the given basic block.

Definition InstructionPrecedenceTracking.h:125

This is an optimization pass for GlobalISel generic memory operations.