This is the profile llvm-profgen part of the context split work. Please refer to D107299 for the original whole patch.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
llvm/tools/llvm-profgen/ProfiledBinary.h | ||
---|---|---|
124 | I guess Offset2LocStackMap will serve as the immutable storage of all SampleContextStorageType. Is there way to enforce its immutability? |
llvm/tools/llvm-profgen/ProfiledBinary.h | ||
---|---|---|
124 | Yes, it should be immutable once after symbolization is done. The checking of that may not be as easy as the CSName table in the reader. On the other hand, a std::unordered_map operation should not invalidate the values unless it removes or replaces the value. It should just work as other fields like the FuncStartAddrMap above. What do you think? |
llvm/tools/llvm-profgen/ProfiledBinary.h | ||
---|---|---|
124 | Ah, ok, just find that iterators will be invalidated for unordered_map rehashing but pointers and references will still be valid. So it is fine. |
LGTM.
llvm/include/llvm/MC/MCPseudoProbe.h | ||
---|---|---|
171 | Add a comment to explain the uint32_t contains the pseudo index. |
llvm/tools/llvm-profgen/CallContext.h | ||
---|---|---|
21 | Does this using statement do anything? | |
llvm/tools/llvm-profgen/PerfReader.cpp | ||
423 | nit: NYI is confusing. This is simply not expected, instead of "Not yet implemented", right? we don't have a 3rd ContextKey type. | |
llvm/tools/llvm-profgen/ProfileGenerator.cpp | ||
373 | The name CallerContextRef probably is left over from before we renamed into SampleContextFrames. Rename CallerContextRef accordingly, same for other places. And all other places where Context is called Name better be renamed accordingly too. | |
llvm/tools/llvm-profgen/ProfiledBinary.cpp | ||
425 | emplace_back with variadic args and avoid temp Callsite | |
llvm/tools/llvm-profgen/ProfiledBinary.h | ||
283 | nit: emplace_back with variadic args | |
284 | The actual string for Callsite.first is owned by MCPseudoProbeDecoder, right? Specifically, GUID2FuncDescMap. |
llvm/test/tools/llvm-profgen/recursion-compression-pseudoprobe.test | ||
---|---|---|
12 ↗ | (On Diff #369361) | The order change is due to the flip of using > to < for sortFuncProfiles in D108433, so that we don't have to provide a > operator. |
llvm/tools/llvm-profgen/CallContext.h | ||
21 | oops, looks like it's from a string replacement. Removed. | |
llvm/tools/llvm-profgen/PerfReader.cpp | ||
423 | Makes sense. Message changed. | |
llvm/tools/llvm-profgen/ProfileGenerator.cpp | ||
373 | Good catch. Renamed to CallerFrames. | |
373 | Renamed to NewContext. | |
llvm/tools/llvm-profgen/ProfiledBinary.cpp | ||
425 | fixed | |
llvm/tools/llvm-profgen/ProfiledBinary.h | ||
284 | Yes, the string is owned by the probe decoder, unlike the strings returned from the symbolizer which have to be saved somewhere in the profiled binary. |
llvm/test/tools/llvm-profgen/recursion-compression-pseudoprobe.test | ||
---|---|---|
12 ↗ | (On Diff #369361) | I was asking why this test change is here since the sortFuncProfiles is in the 2nd patch. But if you're going to commit these three patches together, it's not going to make a difference anyways. |
llvm/test/tools/llvm-profgen/recursion-compression-pseudoprobe.test | ||
---|---|---|
12 ↗ | (On Diff #369361) | Oh yeah, I'll commit all patches as a whole. Will update the original patch before checking them in. |
Add a comment to explain the uint32_t contains the pseudo index.