@@ -96,9 +96,8 @@ template <> struct MappingTraits<bolt::SuccessorInfo> {
9696namespace bolt {
9797struct PseudoProbeInfo {
9898 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
102101 std::vector<uint64_t > CallProbes;
103102 std::vector<uint64_t > IndCallProbes;
104103 std::vector<uint32_t > InlineTreeNodes;
@@ -113,10 +112,10 @@ struct PseudoProbeInfo {
113112
114113template <> struct MappingTraits <bolt::PseudoProbeInfo> {
115114 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 >());
120119 YamlIO.mapOptional (" id" , PI.InlineTreeIndex , 0 );
121120 YamlIO.mapOptional (" ids" , PI.InlineTreeNodes , std::vector<uint32_t >());
122121 }
@@ -170,18 +169,18 @@ template <> struct MappingTraits<bolt::BinaryBasicBlockProfile> {
170169};
171170
172171namespace bolt {
173- struct InlineTreeInfo {
172+ struct InlineTreeNode {
174173 uint32_t ParentIndexDelta;
175174 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)
177176 uint32_t GUIDIndex;
178- bool operator ==(const InlineTreeInfo &) const { return false ; }
177+ bool operator ==(const InlineTreeNode &) const { return false ; }
179178};
180179} // end namespace bolt
181180
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 );
185184 YamlIO.mapOptional (" p" , ITI.ParentIndexDelta , 0 );
186185 YamlIO.mapOptional (" cs" , ITI.CallSiteProbe , 0 );
187186 }
@@ -192,7 +191,7 @@ template <> struct MappingTraits<bolt::InlineTreeInfo> {
192191} // end namespace llvm
193192
194193LLVM_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 )
196195
197196namespace llvm {
198197namespace yaml {
@@ -205,7 +204,7 @@ struct BinaryFunctionProfile {
205204 llvm::yaml::Hex64 Hash{0 };
206205 uint64_t ExecCount{0 };
207206 std::vector<BinaryBasicBlockProfile> Blocks;
208- std::vector<InlineTreeInfo > InlineTree;
207+ std::vector<InlineTreeNode > InlineTree;
209208 bool Used{false };
210209};
211210} // end namespace bolt
@@ -220,7 +219,7 @@ template <> struct MappingTraits<bolt::BinaryFunctionProfile> {
220219 YamlIO.mapOptional (" blocks" , BFP.Blocks ,
221220 std::vector<bolt::BinaryBasicBlockProfile>());
222221 YamlIO.mapOptional (" inline_tree" , BFP.InlineTree ,
223- std::vector<bolt::InlineTreeInfo >());
222+ std::vector<bolt::InlineTreeNode >());
224223 }
225224};
226225
@@ -274,20 +273,21 @@ namespace bolt {
274273struct PseudoProbeDesc {
275274 std::vector<Hex64> GUID;
276275 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
278277
279278 bool operator ==(const PseudoProbeDesc &Other) const {
280279 // Only treat empty Desc as equal
281280 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 ();
283283 }
284284};
285285} // end namespace bolt
286286
287287template <> struct MappingTraits <bolt::PseudoProbeDesc> {
288288 static void mapping (IO &YamlIO, bolt::PseudoProbeDesc &PD) {
289289 YamlIO.mapRequired (" gs" , PD.GUID );
290- YamlIO.mapRequired (" gh" , PD.GUIDHash );
290+ YamlIO.mapRequired (" gh" , PD.GUIDHashIdx );
291291 YamlIO.mapRequired (" hs" , PD.Hash );
292292 }
293293};
0 commit comments