LLVM: include/llvm/Support/OptimizedStructLayout.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

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35#ifndef LLVM_SUPPORT_OPTIMIZEDSTRUCTLAYOUT_H

36#define LLVM_SUPPORT_OPTIMIZEDSTRUCTLAYOUT_H

37

40#include

41

42namespace llvm {

43

44

46

47

49

53 assert(Size > 0 && "adding an empty field to the layout");

54 }

55

56

57

58

60

61

62

64

65

66 const void *Id;

67

68

69

71

72

74

75

76

79 }

80

81

82

86 }

87};

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

139 MutableArrayRef Fields);

140

141}

142

143#endif

assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())

This is an optimization pass for GlobalISel generic memory operations.

std::pair< uint64_t, Align > performOptimizedStructLayout(MutableArrayRef< OptimizedStructLayoutField > Fields)

Compute a layout for a struct containing the given fields, making a best-effort attempt to minimize t...

This struct is a compact representation of a valid (non-zero power of two) alignment.

const void * Id

A opaque value which uniquely identifies this field.

Align Alignment

The required alignment of this field.

uint64_t getEndOffset() const

Given that this field has a fixed offset, return the offset of the first byte following it.

void * Scratch

Private scratch space for the algorithm.

bool hasFixedOffset() const

Return true if this field has been assigned a fixed offset.

uint64_t Offset

The offset of this field in the final layout.

OptimizedStructLayoutField(const void *Id, uint64_t Size, Align Alignment, uint64_t FixedOffset=FlexibleOffset)

uint64_t Size

The required size of this field in bytes.

static constexpr uint64_t FlexibleOffset

A special value for Offset indicating that the field can be moved anywhere.