[Passes] Avoid repeated hash lookups (NFC) (#135542)
This commit is contained in:
parent
4b4cd645a8
commit
d1d5f00a8e
@ -2001,14 +2001,12 @@ DotCfgDiff::DotCfgDiff(StringRef Title, const FuncDataT<DCData> &Before,
|
||||
for (auto &A : After.getData()) {
|
||||
StringRef Label = A.getKey();
|
||||
const BlockDataT<DCData> &BD = A.getValue();
|
||||
unsigned C = NodePosition.count(Label);
|
||||
if (C == 0)
|
||||
auto It = NodePosition.find(Label);
|
||||
if (It == NodePosition.end())
|
||||
// This only exists in the after IR. Create the node.
|
||||
createNode(Label, BD, AfterColour);
|
||||
else {
|
||||
assert(C == 1 && "Unexpected multiple nodes.");
|
||||
Nodes[NodePosition[Label]].setCommon(BD);
|
||||
}
|
||||
else
|
||||
Nodes[It->second].setCommon(BD);
|
||||
// Add in the edges between the nodes (as common or only in after).
|
||||
for (StringMap<std::string>::const_iterator Sink = BD.getData().begin(),
|
||||
E = BD.getData().end();
|
||||
|
Loading…
x
Reference in New Issue
Block a user