Before: identity nodes stuffed into VMap
// Insert identity nodes into VMap upfront
for (Node in FindDebugInfoToIdentityMap(Fn)) {
VMap[Node] = Node; // expensive tracking
}
CloneFunctionInto(NewFn, Fn, VMap, ...);
After: separate immutable set, lazy mapping
// Build set separately (still O(CU))
IdentityMD = FindDebugInfoToIdentityMap(Fn);
// New parameter flows through to ValueMapper
CloneFunctionInto(NewFn, Fn, VMap,
..., &IdentityMD);
↓
ValueMapper(VMap, ..., &IdentityMD);
// identity-maps matching metadata on first use