//===- ReduceArguments.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 a function which calls the Generic Delta pass in order // to reduce uninteresting Arguments from declared and defined functions. // //===----------------------------------------------------------------------===// #include "ReduceArguments.h" #include "Delta.h" #include "Utils.h" #include "llvm/ADT/SmallVector.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/Intrinsics.h" #include <set> #include <vector> usingnamespacellvm; /// Goes over OldF calls and replaces them with a call to NewF static void replaceFunctionCalls(Function &OldF, Function &NewF, const std::set<int> &ArgIndexesToKeep) { … } /// Returns whether or not this function should be considered a candidate for /// argument removal. Currently, functions with no arguments and intrinsics are /// not considered. Intrinsics aren't considered because their signatures are /// fixed. static bool shouldRemoveArguments(const Function &F) { … } /// Removes out-of-chunk arguments from functions, and modifies their calls /// accordingly. It also removes allocations of out-of-chunk arguments. static void extractArgumentsFromModule(Oracle &O, ReducerWorkItem &WorkItem) { … } void llvm::reduceArgumentsDeltaPass(TestRunner &Test) { … }