Skip to content

Commit 2cdf474

Browse files
[MemProf] Merge callee clones as needed before assigning functions (#135702)
We perform cloning for each allocation node separately. However, this sometimes results in a situation where the same node calls multiple clones of the same callee, created for different allocations. This causes issues when assigning functions to these clones, as each node can in reality only call a single callee clone. To address this, before assigning functions, merge callee clone nodes as needed using a post order traversal from the allocations. We attempt to use existing clones as the merge node when legal, and to share them among callers with the same properties (callers calling the same set of callee clone nodes for the same allocations). Without this fix, in some cases incorrect function assignment will lead to calling the wrong allocation clone. In fact, this showed up in an existing test, that I didn't notice as it existed to test earlier parts of the cloning process.
1 parent a1db2c6 commit 2cdf474

File tree

4 files changed

+1259
-12
lines changed

4 files changed

+1259
-12
lines changed

0 commit comments

Comments
 (0)