[MemProf] Cache context nodes for callsite stack ids during matching (NFC) (#239822)
updateStackNodes and assignStackNodesPostOrder repeatedly looked up the
context node for each stack id of each call being matched. Save the
nodes in CallContextInfo when they are first looked up and use them
throughout. The stack ids themselves are no longer saved, as they are
available via each node's OrigStackOrAllocId. The sort of calls with the
same last stack id now orders by those ids, and identical sequences are
detected by comparing the node vectors.
This efficiency improvement is leveraged in a follow on PR to avoid
adding another round of context node lookups.
Assisted-by: Gemini