//===- ReduceDistinctMetadata.cpp - Specialized Delta Pass ----------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file implements two functions used by the Generic Delta Debugging // Algorithm, which are used to reduce unnamed distinct metadata nodes. // //===----------------------------------------------------------------------===// #include "ReduceDistinctMetadata.h" #include "Delta.h" #include "llvm/ADT/Sequence.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallVector.h" #include "llvm/IR/InstIterator.h" #include <algorithm> #include <queue> usingnamespacellvm; // Traverse the graph breadth-first and try to remove unnamed metadata nodes static void reduceNodes(MDNode *Root, SetVector<std::pair<unsigned int, MDNode *>> &NodesToDelete, MDNode *TemporaryNode, Oracle &O, Module &Program) { … } // After reducing metadata, we need to remove references to the temporary node, // this is also done with BFS static void cleanUpTemporaries(NamedMDNode &NamedNode, MDTuple *TemporaryTuple, Module &Program) { … } static void extractDistinctMetadataFromModule(Oracle &O, ReducerWorkItem &WorkItem) { … } void llvm::reduceDistinctMetadataDeltaPass(TestRunner &Test) { … }