LLVM: lib/Target/AMDGPU/AMDGPUMachineModuleInfo.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUMACHINEMODULEINFO_H

16#define LLVM_LIB_TARGET_AMDGPU_AMDGPUMACHINEMODULEINFO_H

17

20

21namespace llvm {

22

24private:

25

26

27

28

29

31

33

35

37

39

41

43

45

47

49

50

51

52

53

54

55

56 std::optional<uint8_t>

57 getSyncScopeInclusionOrdering(SyncScope::ID SSID) const {

60 return 0;

63 return 1;

66 return 2;

69 return 3;

72 return 4;

75 return 5;

76

77 return std::nullopt;

78 }

79

80

81

82 bool isOneAddressSpace(SyncScope::ID SSID) const {

89 }

90

91public:

93

94

96 return AgentSSID;

97 }

98

100 return WorkgroupSSID;

101 }

102

104 return WavefrontSSID;

105 }

106

108

110 return SystemOneAddressSpaceSSID;

111 }

112

114 return AgentOneAddressSpaceSSID;

115 }

116

118 return WorkgroupOneAddressSpaceSSID;

119 }

120

122 return WavefrontOneAddressSpaceSSID;

123 }

124

126 return SingleThreadOneAddressSpaceSSID;

127 }

128

130 return ClusterOneAddressSpaceSSID;

131 }

132

133

134

135

136

137

138

139

140

143 const auto &AIO = getSyncScopeInclusionOrdering(A);

144 const auto &BIO = getSyncScopeInclusionOrdering(B);

145 if (!AIO || !BIO)

146 return std::nullopt;

147

148 bool IsAOneAddressSpace = isOneAddressSpace(A);

149 bool IsBOneAddressSpace = isOneAddressSpace(B);

150

151 return *AIO >= *BIO &&

152 (IsAOneAddressSpace == IsBOneAddressSpace || !IsAOneAddressSpace);

153 }

154};

155

156}

157

158#endif

static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")

static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")

SyncScope::ID getWorkgroupSSID() const

Definition AMDGPUMachineModuleInfo.h:99

AMDGPUMachineModuleInfo(const MachineModuleInfo &MMI)

SyncScope::ID getWavefrontSSID() const

Definition AMDGPUMachineModuleInfo.h:103

SyncScope::ID getAgentSSID() const

Definition AMDGPUMachineModuleInfo.h:95

SyncScope::ID getClusterOneAddressSpaceSSID() const

Definition AMDGPUMachineModuleInfo.h:129

SyncScope::ID getClusterSSID() const

Definition AMDGPUMachineModuleInfo.h:107

std::optional< bool > isSyncScopeInclusion(SyncScope::ID A, SyncScope::ID B) const

In AMDGPU target synchronization scopes are inclusive, meaning a larger synchronization scope is incl...

Definition AMDGPUMachineModuleInfo.h:141

SyncScope::ID getAgentOneAddressSpaceSSID() const

Definition AMDGPUMachineModuleInfo.h:113

SyncScope::ID getSingleThreadOneAddressSpaceSSID() const

Definition AMDGPUMachineModuleInfo.h:125

SyncScope::ID getWavefrontOneAddressSpaceSSID() const

Definition AMDGPUMachineModuleInfo.h:121

SyncScope::ID getSystemOneAddressSpaceSSID() const

Definition AMDGPUMachineModuleInfo.h:109

SyncScope::ID getWorkgroupOneAddressSpaceSSID() const

Definition AMDGPUMachineModuleInfo.h:117

MachineModuleInfoELF(const MachineModuleInfo &)

This class contains meta information specific to a module.

@ SingleThread

Synchronized with respect to signal handlers executing in the same thread.

@ System

Synchronized with respect to all concurrently executing threads.

This is an optimization pass for GlobalISel generic memory operations.