LLVM: lib/CodeGen/SelectionDAG/StatepointLowering.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_LIB_CODEGEN_SELECTIONDAG_STATEPOINTLOWERING_H

15#define LLVM_LIB_CODEGEN_SELECTIONDAG_STATEPOINTLOWERING_H

16

22#include

23

24namespace llvm {

25

27

28

29

30

31

32

34public:

36

37

38

40

41

42

43

45

46

47

48

49

51 auto I = Locations.find(Val);

52 if (I == Locations.end())

54 return I->second;

55 }

56

58 assert(!Locations.count(Val) &&

59 "Trying to allocate already allocated location");

60 Locations[Val] = Location;

61 }

62

63

64

65

67

69 PendingGCRelocateCalls.push_back(&RelocCall);

70 }

71

72

73

74

76

78 return;

79 auto I = llvm::find(PendingGCRelocateCalls, &RelocCall);

80 assert(I != PendingGCRelocateCalls.end() &&

81 "Visited unexpected gcrelocate call");

82 PendingGCRelocateCalls.erase(I);

83 }

84

85

86

87

88

89

91

94 "out of bounds");

95 assert(!AllocatedStackSlots.test(Offset) && "already reserved!");

96 assert(NextSlotToAllocate <= (unsigned)Offset && "consistency!");

97 AllocatedStackSlots.set(Offset);

98 }

99

102 "out of bounds");

103 return AllocatedStackSlots.test(Offset);

104 }

105

106private:

107

108

110

111

112

113

114

116

117

118 unsigned NextSlotToAllocate = 0;

119

120

122};

123

124}

125

126#endif

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

This file defines the DenseMap class.

This file implements the SmallBitVector class.

This file defines the SmallVector class.

Represents calls to the gc.relocate intrinsic.

Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.

SelectionDAGBuilder - This is the common target-independent lowering implementation that is parameter...

This is a 'bitvector' (really, a variable-sized bit array), optimized for the case when the array is ...

This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.

void clear()

Clear the memory usage of this object.

SDValue getLocation(SDValue Val)

Returns the spill location of a value incoming to the current statepoint.

Definition StatepointLowering.h:50

SDValue allocateStackSlot(EVT ValueType, SelectionDAGBuilder &Builder)

Get a stack slot we can use to store an value of type ValueType.

void scheduleRelocCall(const GCRelocateInst &RelocCall)

Record the fact that we expect to encounter a given gc_relocate before the next statepoint.

Definition StatepointLowering.h:66

bool isStackSlotAllocated(int Offset)

Definition StatepointLowering.h:100

void setLocation(SDValue Val, SDValue Location)

Definition StatepointLowering.h:57

StatepointLoweringState()=default

void relocCallVisited(const GCRelocateInst &RelocCall)

Remove this gc_relocate from the list we're expecting to see before the next statepoint.

Definition StatepointLowering.h:75

void startNewStatepoint(SelectionDAGBuilder &Builder)

Reset all state tracking for a newly encountered safepoint.

void reserveStackSlot(int Offset)

Definition StatepointLowering.h:92

This is an optimization pass for GlobalISel generic memory operations.

auto find(R &&Range, const T &Val)

Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly.

PointerUnion< const Value *, const PseudoSourceValue * > ValueType