@@ -96,9 +96,8 @@ template <> struct MappingTraits<bolt::SuccessorInfo> {
96
96
namespace bolt {
97
97
struct PseudoProbeInfo {
98
98
uint32_t InlineTreeIndex = 0 ;
99
- uint64_t BlockMask = 0 ; // bitset with probe indices
100
- // Assume BlockMask == 1 if no other probes are set
101
- std::vector<uint64_t > BlockProbes;
99
+ uint64_t BlockMask = 0 ; // bitset with probe indices from 1 to 64
100
+ std::vector<uint64_t > BlockProbes; // block probes with indices above 64
102
101
std::vector<uint64_t > CallProbes;
103
102
std::vector<uint64_t > IndCallProbes;
104
103
std::vector<uint32_t > InlineTreeNodes;
@@ -113,10 +112,10 @@ struct PseudoProbeInfo {
113
112
114
113
template <> struct MappingTraits <bolt::PseudoProbeInfo> {
115
114
static void mapping (IO &YamlIO, bolt::PseudoProbeInfo &PI) {
116
- YamlIO.mapOptional (" blk " , PI.BlockMask , 0 );
117
- YamlIO.mapOptional (" blks " , PI.BlockProbes , std::vector<uint64_t >());
118
- YamlIO.mapOptional (" calls " , PI.CallProbes , std::vector<uint64_t >());
119
- YamlIO.mapOptional (" indcalls " , PI.IndCallProbes , std::vector<uint64_t >());
115
+ YamlIO.mapOptional (" blx " , PI.BlockMask , 0 );
116
+ YamlIO.mapOptional (" blk " , PI.BlockProbes , std::vector<uint64_t >());
117
+ YamlIO.mapOptional (" call " , PI.CallProbes , std::vector<uint64_t >());
118
+ YamlIO.mapOptional (" icall " , PI.IndCallProbes , std::vector<uint64_t >());
120
119
YamlIO.mapOptional (" id" , PI.InlineTreeIndex , 0 );
121
120
YamlIO.mapOptional (" ids" , PI.InlineTreeNodes , std::vector<uint32_t >());
122
121
}
@@ -170,18 +169,18 @@ template <> struct MappingTraits<bolt::BinaryBasicBlockProfile> {
170
169
};
171
170
172
171
namespace bolt {
173
- struct InlineTreeInfo {
172
+ struct InlineTreeNode {
174
173
uint32_t ParentIndexDelta;
175
174
uint32_t CallSiteProbe;
176
- // Index in PseudoProbeDesc.GUID + 1, 0 for same as previous
175
+ // Index in PseudoProbeDesc.GUID, UINT32_MAX for same as previous (omitted)
177
176
uint32_t GUIDIndex;
178
- bool operator ==(const InlineTreeInfo &) const { return false ; }
177
+ bool operator ==(const InlineTreeNode &) const { return false ; }
179
178
};
180
179
} // end namespace bolt
181
180
182
- template <> struct MappingTraits <bolt::InlineTreeInfo > {
183
- static void mapping (IO &YamlIO, bolt::InlineTreeInfo &ITI) {
184
- YamlIO.mapOptional (" g" , ITI.GUIDIndex , 0 );
181
+ template <> struct MappingTraits <bolt::InlineTreeNode > {
182
+ static void mapping (IO &YamlIO, bolt::InlineTreeNode &ITI) {
183
+ YamlIO.mapOptional (" g" , ITI.GUIDIndex , UINT32_MAX );
185
184
YamlIO.mapOptional (" p" , ITI.ParentIndexDelta , 0 );
186
185
YamlIO.mapOptional (" cs" , ITI.CallSiteProbe , 0 );
187
186
}
@@ -192,7 +191,7 @@ template <> struct MappingTraits<bolt::InlineTreeInfo> {
192
191
} // end namespace llvm
193
192
194
193
LLVM_YAML_IS_SEQUENCE_VECTOR (llvm::yaml::bolt::BinaryBasicBlockProfile)
195
- LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(llvm::yaml::bolt::InlineTreeInfo )
194
+ LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(llvm::yaml::bolt::InlineTreeNode )
196
195
197
196
namespace llvm {
198
197
namespace yaml {
@@ -205,7 +204,7 @@ struct BinaryFunctionProfile {
205
204
llvm::yaml::Hex64 Hash{0 };
206
205
uint64_t ExecCount{0 };
207
206
std::vector<BinaryBasicBlockProfile> Blocks;
208
- std::vector<InlineTreeInfo > InlineTree;
207
+ std::vector<InlineTreeNode > InlineTree;
209
208
bool Used{false };
210
209
};
211
210
} // end namespace bolt
@@ -220,7 +219,7 @@ template <> struct MappingTraits<bolt::BinaryFunctionProfile> {
220
219
YamlIO.mapOptional (" blocks" , BFP.Blocks ,
221
220
std::vector<bolt::BinaryBasicBlockProfile>());
222
221
YamlIO.mapOptional (" inline_tree" , BFP.InlineTree ,
223
- std::vector<bolt::InlineTreeInfo >());
222
+ std::vector<bolt::InlineTreeNode >());
224
223
}
225
224
};
226
225
@@ -274,20 +273,21 @@ namespace bolt {
274
273
struct PseudoProbeDesc {
275
274
std::vector<Hex64> GUID;
276
275
std::vector<Hex64> Hash;
277
- std::vector<uint32_t > GUIDHash ; // Index of hash for that GUID in Hash
276
+ std::vector<uint32_t > GUIDHashIdx ; // Index of hash for that GUID in Hash
278
277
279
278
bool operator ==(const PseudoProbeDesc &Other) const {
280
279
// Only treat empty Desc as equal
281
280
return GUID.empty () && Other.GUID .empty () && Hash.empty () &&
282
- Other.Hash .empty () && GUIDHash.empty () && Other.GUIDHash .empty ();
281
+ Other.Hash .empty () && GUIDHashIdx.empty () &&
282
+ Other.GUIDHashIdx .empty ();
283
283
}
284
284
};
285
285
} // end namespace bolt
286
286
287
287
template <> struct MappingTraits <bolt::PseudoProbeDesc> {
288
288
static void mapping (IO &YamlIO, bolt::PseudoProbeDesc &PD) {
289
289
YamlIO.mapRequired (" gs" , PD.GUID );
290
- YamlIO.mapRequired (" gh" , PD.GUIDHash );
290
+ YamlIO.mapRequired (" gh" , PD.GUIDHashIdx );
291
291
YamlIO.mapRequired (" hs" , PD.Hash );
292
292
}
293
293
};
0 commit comments