[all-commits] [llvm/llvm-project] 055e43: [MemProf] Reduce cloning overhead by sharing nodes...
Teresa Johnson via All-commits
all-commits at lists.llvm.org
Tue Jul 23 12:44:28 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 055e4319112282354327af9908091fdb25149e9b
https://github.com/llvm/llvm-project/commit/055e4319112282354327af9908091fdb25149e9b
Author: Teresa Johnson <tejohnson at google.com>
Date: 2024-07-23 (Tue, 23 Jul 2024)
Changed paths:
M llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
Log Message:
-----------
[MemProf] Reduce cloning overhead by sharing nodes when possible (#99832)
When assigning calls to nodes while building the graph, we can share
nodes between multiple calls in some cases. Specifically, when we
process the list of calls that had the same stack ids (possibly pruned,
because we are looking at the stack ids that actually had nodes in the
graph due to stack ids in the pruned allocation MIBs), for calls that
are located in the same function, we know that they will behave exactly
the same through cloning and function assignment. Therefore, instead of
creating nodes for all of them (requiring context id duplication), keep
a list of additional "matching calls" on the nodes. During function
assignment we simply update all the matching calls the same way as the
primary call.
This change not only reduces the number of nodes (both original and
cloned), but also greatly reduces the number of duplicated context ids
and the time to propagate them.
For a large target, I measured a 25% peak memory reduction and 42% time
reduction.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list