[llvm] [MemProf] Suppress duplicate clones in the LTO backend (PR #161551)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 1 14:06:16 PDT 2025


================
@@ -5448,6 +5540,8 @@ bool MemProfContextDisambiguation::applyImport(Module &M) {
       // below.
       auto CalleeOrigName = CalledFunction->getName();
       for (unsigned J = 0; J < StackNode.Clones.size(); J++) {
+        if (J > 0 && VMaps[J - 1]->empty())
+          continue;
----------------
kazutakahirata wrote:

I'm wondering if this small block of code warrants a comment:

```
// If the VMap is empty, this clone was a duplicate of another and was created
// as an alias or a declaration.
```

The same applies to the three more instances of `if` statements below.


https://github.com/llvm/llvm-project/pull/161551


More information about the llvm-commits mailing list