From 099e5c5bba23e06a7840d79ffcf66e9cd98cd52c Mon Sep 17 00:00:00 2001 From: Diego Trevino Ferrer Date: Wed, 7 Aug 2019 00:00:52 +0000 Subject: Added Delta IR Reduction Tool Summary: Tool parses input IR file, and runs the delta debugging algorithm to reduce the functions inside the input file. Reviewers: alexshap, chandlerc Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63672 > llvm-svn: 368071 llvm-svn: 368112 --- llvm/tools/llvm-reduce/deltas/RemoveFunctions.h | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 llvm/tools/llvm-reduce/deltas/RemoveFunctions.h (limited to 'llvm/tools/llvm-reduce/deltas/RemoveFunctions.h') diff --git a/llvm/tools/llvm-reduce/deltas/RemoveFunctions.h b/llvm/tools/llvm-reduce/deltas/RemoveFunctions.h new file mode 100644 index 00000000000..3a6e501dc93 --- /dev/null +++ b/llvm/tools/llvm-reduce/deltas/RemoveFunctions.h @@ -0,0 +1,28 @@ +//===- llvm-reduce.cpp - The LLVM Delta Reduction utility -----------------===// +// +// 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 is a Specialized Delta Pass, which removes the functions that are +// not in the provided function-chunks. +// +//===----------------------------------------------------------------------===// + +#include "Delta.h" +#include "llvm/Transforms/Utils/Cloning.h" + +namespace llvm { + +class RemoveFunctions { +public: + /// Outputs the number of Functions in the given Module + static int getTargetCount(Module *Program); + /// Clones module and returns it with chunk functions only + static std::unique_ptr + extractChunksFromModule(std::vector ChunksToKeep, Module *Program); +}; + +} // namespace llvm -- cgit v1.2.3