LLVM: lib/CodeGen/PseudoSourceValue.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

20

21using namespace llvm;

22

23static const char *const PSVNames[] = {

24 "Stack", "GOT", "JumpTable", "ConstantPool", "FixedStack",

25 "GlobalValueCallEntry", "ExternalSymbolCallEntry"};

26

31

33

34void PseudoSourceValue::printCustom(raw_ostream &O) const {

37 else

38 O << "TargetCustom" << Kind;

39}

40

43 return false;

45 return true;

47}

48

54

58

63

65 if (!MFI)

66 return true;

68}

69

71 if (!MFI)

72 return true;

73

75}

76

78 OS << "FixedStack" << FI;

79}

80

84

88

92

96

103

109

111 return &StackPSV;

112}

113

115

117 return &ConstantPoolPSV;

118}

119

121 return &JumpTablePSV;

122}

123

126

127

128 unsigned Idx = (2 * unsigned(FI)) ^ (FI >> (sizeof(FI) * 8 - 1));

129 if (FSValues.size() <= Idx)

130 FSValues.resize(Idx + 1);

131 std::unique_ptr &V = FSValues[Idx];

132 if (!V)

133 V = std::make_unique(FI, TM);

134 return V.get();

135}

136

139 std::unique_ptr &E =

140 GlobalCallEntries[GV];

141 if (!E)

142 E = std::make_unique(GV, TM);

143 return E.get();

144}

145

148 std::unique_ptr &E =

149 ExternalCallEntries[ES];

150 if (!E)

151 E = std::make_unique(ES, TM);

152 return E.get();

153}

static const char *const PSVNames[]

Definition PseudoSourceValue.cpp:23

CallEntryPseudoSourceValue(unsigned Kind, const TargetMachine &TM)

Definition PseudoSourceValue.cpp:81

bool isAliased(const MachineFrameInfo *) const override

Test whether the memory pointed to by this PseudoSourceValue may also be pointed to by an LLVM IR Val...

Definition PseudoSourceValue.cpp:89

bool mayAlias(const MachineFrameInfo *) const override

Return true if the memory pointed to by this PseudoSourceValue can ever alias an LLVM IR Value.

Definition PseudoSourceValue.cpp:93

bool isConstant(const MachineFrameInfo *) const override

Test whether the memory pointed to by this PseudoSourceValue has a constant value.

Definition PseudoSourceValue.cpp:85

LLVM_ABI ExternalSymbolPseudoSourceValue(const char *ES, const TargetMachine &TM)

Definition PseudoSourceValue.cpp:100

void printCustom(raw_ostream &OS) const override

Implement printing for PseudoSourceValue.

Definition PseudoSourceValue.cpp:77

bool isAliased(const MachineFrameInfo *MFI) const override

Test whether the memory pointed to by this PseudoSourceValue may also be pointed to by an LLVM IR Val...

Definition PseudoSourceValue.cpp:64

bool mayAlias(const MachineFrameInfo *) const override

Return true if the memory pointed to by this PseudoSourceValue can ever alias an LLVM IR Value.

Definition PseudoSourceValue.cpp:70

bool isConstant(const MachineFrameInfo *MFI) const override

Test whether the memory pointed to by this PseudoSourceValue has a constant value.

Definition PseudoSourceValue.cpp:59

LLVM_ABI GlobalValuePseudoSourceValue(const GlobalValue *GV, const TargetMachine &TM)

Definition PseudoSourceValue.cpp:97

The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.

bool isImmutableObjectIndex(int ObjectIdx) const

Returns true if the specified index corresponds to an immutable object.

bool isSpillSlotObjectIndex(int ObjectIdx) const

Returns true if the specified index corresponds to a spill slot.

bool isAliasedObjectIndex(int ObjectIdx) const

Returns true if the specified index corresponds to an object that might be pointed to by an LLVM IR v...

LLVM_ABI const PseudoSourceValue * getJumpTable()

Return a pseudo source value referencing a jump table.

Definition PseudoSourceValue.cpp:120

LLVM_ABI const PseudoSourceValue * getExternalSymbolCallEntry(const char *ES)

Definition PseudoSourceValue.cpp:147

LLVM_ABI const PseudoSourceValue * getFixedStack(int FI)

Return a pseudo source value referencing a fixed stack frame entry, e.g., a spill slot.

Definition PseudoSourceValue.cpp:125

LLVM_ABI const PseudoSourceValue * getGOT()

Return a pseudo source value referencing the global offset table (or something the like).

Definition PseudoSourceValue.cpp:114

LLVM_ABI const PseudoSourceValue * getGlobalValueCallEntry(const GlobalValue *GV)

Definition PseudoSourceValue.cpp:138

LLVM_ABI const PseudoSourceValue * getStack()

Return a pseudo source value referencing the area below the stack frame of a function,...

Definition PseudoSourceValue.cpp:110

LLVM_ABI const PseudoSourceValue * getConstantPool()

Return a pseudo source value referencing the constant pool.

Definition PseudoSourceValue.cpp:116

LLVM_ABI PseudoSourceValueManager(const TargetMachine &TM)

Definition PseudoSourceValue.cpp:104

Special value supplied for machine level alias analysis.

virtual ~PseudoSourceValue()

virtual bool mayAlias(const MachineFrameInfo *) const

Return true if the memory pointed to by this PseudoSourceValue can ever alias an LLVM IR Value.

Definition PseudoSourceValue.cpp:55

virtual bool isAliased(const MachineFrameInfo *) const

Test whether the memory pointed to by this PseudoSourceValue may also be pointed to by an LLVM IR Val...

Definition PseudoSourceValue.cpp:49

PseudoSourceValue(unsigned Kind, const TargetMachine &TM)

Definition PseudoSourceValue.cpp:27

@ ExternalSymbolCallEntry

bool isConstantPool() const

virtual bool isConstant(const MachineFrameInfo *) const

Test whether the memory pointed to by this PseudoSourceValue has a constant value.

Definition PseudoSourceValue.cpp:41

Primary interface to the complete machine description for the target machine.

virtual unsigned getAddressSpaceForPseudoSourceKind(unsigned Kind) const

getAddressSpaceForPseudoSourceKind - Given the kind of memory (e.g.

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

#define llvm_unreachable(msg)

Marks that the current location is not supposed to be reachable.

This is an optimization pass for GlobalISel generic memory operations.