[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)
Utkarsh Saxena via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 28 04:59:37 PDT 2024
usx95 wrote:
What is the reason for changing from `llvm::TimeTraceProfilerEntry*` to `std::shared_ptr<DurableEvent>`? We are also adding significant devirtualization cost with the added different event types.
Can we do something like this:
```
enum class TimeTraceEventType { DurationEvent, InstantEvent };
struct llvm::TimeTraceProfilerEntry {
const TimePointType Start;
TimePointType End;
const std::string Name;
TimeTraceMetadata Metadata;
TimeTraceEventType EventType;
std::vector<std::unique_ptr<TimeTraceProfilerEntry>> InstantEvents; // Instant event associated to a duration event.
}
```
This will remove the need for different implementations for each event type and reduce the complexity.
We can also move the `TimeTraceProfilerEntry` decl to `TimeProfiler.h`. I do not see a point of having just a forward decl
https://github.com/llvm/llvm-project/pull/103039
More information about the cfe-commits
mailing list