@@ -464,9 +464,6 @@ class CallsiteContextGraph {
464
464
// / iteration.
465
465
MapVector<FuncTy *, std::vector<CallInfo>> FuncToCallsWithMetadata;
466
466
467
- // / Records the function each call is located in.
468
- DenseMap<CallInfo, const FuncTy *> CallToFunc;
469
-
470
467
// / Map from callsite node to the enclosing caller function.
471
468
std::map<const ContextNode *, const FuncTy *> NodeToCallingFunc;
472
469
@@ -1575,15 +1572,13 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::updateStackNodes() {
1575
1572
continue ;
1576
1573
}
1577
1574
1578
- const FuncTy *CallFunc = CallToFunc[Call];
1579
-
1580
1575
// If the prior call had the same stack ids this map would not be empty.
1581
1576
// Check if we already have a call that "matches" because it is located
1582
1577
// in the same function.
1583
- if (FuncToCallMap.contains (CallFunc )) {
1578
+ if (FuncToCallMap.contains (Func )) {
1584
1579
// Record the matching call found for this call, and skip it. We
1585
1580
// will subsequently combine it into the same node.
1586
- CallToMatchingCall[Call] = FuncToCallMap[CallFunc ];
1581
+ CallToMatchingCall[Call] = FuncToCallMap[Func ];
1587
1582
continue ;
1588
1583
}
1589
1584
@@ -1623,7 +1618,7 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::updateStackNodes() {
1623
1618
// Record the call with its function, so we can locate it the next time
1624
1619
// we find a call from this function when processing the calls with the
1625
1620
// same stack ids.
1626
- FuncToCallMap[CallFunc ] = Call;
1621
+ FuncToCallMap[Func ] = Call;
1627
1622
}
1628
1623
}
1629
1624
@@ -1741,7 +1736,6 @@ ModuleCallsiteContextGraph::ModuleCallsiteContextGraph(
1741
1736
continue ;
1742
1737
if (auto *MemProfMD = I.getMetadata (LLVMContext::MD_memprof)) {
1743
1738
CallsWithMetadata.push_back (&I);
1744
- CallToFunc[&I] = &F;
1745
1739
auto *AllocNode = addAllocNode (&I, &F);
1746
1740
auto *CallsiteMD = I.getMetadata (LLVMContext::MD_callsite);
1747
1741
assert (CallsiteMD);
@@ -1765,7 +1759,6 @@ ModuleCallsiteContextGraph::ModuleCallsiteContextGraph(
1765
1759
// For callsite metadata, add to list for this function for later use.
1766
1760
else if (I.getMetadata (LLVMContext::MD_callsite)) {
1767
1761
CallsWithMetadata.push_back (&I);
1768
- CallToFunc[&I] = &F;
1769
1762
}
1770
1763
}
1771
1764
}
@@ -1823,7 +1816,6 @@ IndexCallsiteContextGraph::IndexCallsiteContextGraph(
1823
1816
continue ;
1824
1817
IndexCall AllocCall (&AN);
1825
1818
CallsWithMetadata.push_back (AllocCall);
1826
- CallToFunc[AllocCall] = FS;
1827
1819
auto *AllocNode = addAllocNode (AllocCall, FS);
1828
1820
// Pass an empty CallStack to the CallsiteContext (second)
1829
1821
// parameter, since for ThinLTO we already collapsed out the inlined
@@ -1858,7 +1850,6 @@ IndexCallsiteContextGraph::IndexCallsiteContextGraph(
1858
1850
for (auto &SN : FS->mutableCallsites ()) {
1859
1851
IndexCall StackNodeCall (&SN);
1860
1852
CallsWithMetadata.push_back (StackNodeCall);
1861
- CallToFunc[StackNodeCall] = FS;
1862
1853
}
1863
1854
1864
1855
if (!CallsWithMetadata.empty ())
@@ -1942,9 +1933,6 @@ void CallsiteContextGraph<DerivedCCG, FuncTy,
1942
1933
// want to do this during iteration over that map, so save the calls
1943
1934
// that need updated entries.
1944
1935
NewCallToNode.push_back ({ThisCall, Node});
1945
- // We should only have shared this node between calls from the same
1946
- // function.
1947
- assert (NodeToCallingFunc[Node] == CallToFunc[Node->Call ]);
1948
1936
}
1949
1937
break ;
1950
1938
}
0 commit comments