Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 58 additions & 85 deletions llvm/tools/llvm-reduce/DeltaManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
//===----------------------------------------------------------------------===//

#include "DeltaManager.h"
#include "ReducerWorkItem.h"
#include "DeltaPass.h"
#include "TestRunner.h"
#include "deltas/Delta.h"
#include "deltas/ReduceAliases.h"
#include "deltas/ReduceArguments.h"
#include "deltas/ReduceAttributes.h"
Expand Down Expand Up @@ -71,91 +70,64 @@ static cl::list<std::string>
"default, run all delta passes."),
cl::cat(LLVMReduceOptions), cl::CommaSeparated);

#define DELTA_PASSES \
do { \
DELTA_PASS("strip-debug-info", stripDebugInfoDeltaPass) \
DELTA_PASS("functions", reduceFunctionsDeltaPass) \
DELTA_PASS("function-bodies", reduceFunctionBodiesDeltaPass) \
DELTA_PASS("special-globals", reduceSpecialGlobalsDeltaPass) \
DELTA_PASS("aliases", reduceAliasesDeltaPass) \
DELTA_PASS("ifuncs", reduceIFuncsDeltaPass) \
DELTA_PASS("simplify-conditionals-true", reduceConditionalsTrueDeltaPass) \
DELTA_PASS("simplify-conditionals-false", \
reduceConditionalsFalseDeltaPass) \
DELTA_PASS("invokes", reduceInvokesDeltaPass) \
DELTA_PASS("unreachable-basic-blocks", \
reduceUnreachableBasicBlocksDeltaPass) \
DELTA_PASS("basic-blocks", reduceBasicBlocksDeltaPass) \
DELTA_PASS("simplify-cfg", reduceUsingSimplifyCFGDeltaPass) \
DELTA_PASS("function-data", reduceFunctionDataDeltaPass) \
DELTA_PASS("global-values", reduceGlobalValuesDeltaPass) \
DELTA_PASS("global-objects", reduceGlobalObjectsDeltaPass) \
DELTA_PASS("global-initializers", reduceGlobalsInitializersDeltaPass) \
DELTA_PASS("global-variables", reduceGlobalsDeltaPass) \
DELTA_PASS("di-metadata", reduceDIMetadataDeltaPass) \
DELTA_PASS("dbg-records", reduceDbgRecordDeltaPass) \
DELTA_PASS("distinct-metadata", reduceDistinctMetadataDeltaPass) \
DELTA_PASS("metadata", reduceMetadataDeltaPass) \
DELTA_PASS("named-metadata", reduceNamedMetadataDeltaPass) \
DELTA_PASS("arguments", reduceArgumentsDeltaPass) \
DELTA_PASS("instructions", reduceInstructionsDeltaPass) \
DELTA_PASS("simplify-instructions", simplifyInstructionsDeltaPass) \
DELTA_PASS("ir-passes", runIRPassesDeltaPass) \
DELTA_PASS("operands-zero", reduceOperandsZeroDeltaPass) \
DELTA_PASS("operands-one", reduceOperandsOneDeltaPass) \
DELTA_PASS("operands-nan", reduceOperandsNaNDeltaPass) \
DELTA_PASS("operands-to-args", reduceOperandsToArgsDeltaPass) \
DELTA_PASS("operands-skip", reduceOperandsSkipDeltaPass) \
DELTA_PASS("operand-bundles", reduceOperandBundesDeltaPass) \
DELTA_PASS("attributes", reduceAttributesDeltaPass) \
DELTA_PASS("module-data", reduceModuleDataDeltaPass) \
DELTA_PASS("opcodes", reduceOpcodesDeltaPass) \
DELTA_PASS("volatile", reduceVolatileInstructionsDeltaPass) \
DELTA_PASS("atomic-ordering", reduceAtomicOrderingDeltaPass) \
DELTA_PASS("syncscopes", reduceAtomicSyncScopesDeltaPass) \
DELTA_PASS("instruction-flags", reduceInstructionFlagsDeltaPass) \
} while (false)

#define DELTA_PASSES_MIR \
do { \
DELTA_PASS("instructions", reduceInstructionsMIRDeltaPass) \
DELTA_PASS("ir-instruction-references", \
reduceIRInstructionReferencesDeltaPass) \
DELTA_PASS("ir-block-references", reduceIRBlockReferencesDeltaPass) \
DELTA_PASS("ir-function-references", reduceIRFunctionReferencesDeltaPass) \
DELTA_PASS("instruction-flags", reduceInstructionFlagsMIRDeltaPass) \
DELTA_PASS("register-uses", reduceRegisterUsesMIRDeltaPass) \
DELTA_PASS("register-defs", reduceRegisterDefsMIRDeltaPass) \
DELTA_PASS("register-hints", reduceVirtualRegisterHintsDeltaPass) \
DELTA_PASS("register-masks", reduceRegisterMasksMIRDeltaPass) \
} while (false)
// Generate two separate Pass lists: IR_Passes and MIR_Passes
static const DeltaPass IR_Passes[] = {
#undef DELTA_PASS_IR
#undef DELTA_PASS_MIR
#define DELTA_PASS_IR(NAME, FUNC, DESC) {NAME, FUNC, DESC},
#include "DeltaPasses.def"
#undef DELTA_PASS_IR
};

static const DeltaPass MIR_Passes[] = {
#undef DELTA_PASS_IR
#undef DELTA_PASS_MIR
#define DELTA_PASS_MIR(NAME, FUNC, DESC) {NAME, FUNC, DESC},
#include "DeltaPasses.def"
#undef DELTA_PASS_MIR
};

static SmallString<64> getPassMessage(const DeltaPass &Pass) {
SmallString<64> Message = Pass.Desc;
Message += " (";
Message += Pass.Name;
Message += ')';
return Message;
}

static void runAllDeltaPasses(TestRunner &Tester,
const SmallStringSet &SkipPass) {
#define DELTA_PASS(NAME, FUNC) \
if (!SkipPass.count(NAME)) { \
FUNC(Tester); \
}
if (Tester.getProgram().isMIR()) {
DELTA_PASSES_MIR;
for (const DeltaPass &Pass : MIR_Passes) {
if (!SkipPass.count(Pass.Name)) {
runDeltaPass(Tester, Pass.Func, getPassMessage(Pass));
}
}
} else {
DELTA_PASSES;
for (const DeltaPass &Pass : IR_Passes) {
if (!SkipPass.count(Pass.Name)) {
runDeltaPass(Tester, Pass.Func, getPassMessage(Pass));
}
}
}
#undef DELTA_PASS
}

static void runDeltaPassName(TestRunner &Tester, StringRef PassName) {
#define DELTA_PASS(NAME, FUNC) \
if (PassName == NAME) { \
FUNC(Tester); \
return; \
}
if (Tester.getProgram().isMIR()) {
DELTA_PASSES_MIR;
for (const DeltaPass &Pass : MIR_Passes) {
if (PassName == Pass.Name) {
runDeltaPass(Tester, Pass.Func, getPassMessage(Pass));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can simplify this by making runDeltaPass take const DeltaPass &. You don't need to build the intermediate string, the final print can directly consume the DeltaPass fields

return;
}
}
} else {
DELTA_PASSES;
for (const DeltaPass &Pass : IR_Passes) {
if (PassName == Pass.Name) {
runDeltaPass(Tester, Pass.Func, getPassMessage(Pass));
return;
}
}
}
#undef DELTA_PASS

// We should have errored on unrecognized passes before trying to run
// anything.
Expand All @@ -164,24 +136,25 @@ static void runDeltaPassName(TestRunner &Tester, StringRef PassName) {

void llvm::printDeltaPasses(raw_ostream &OS) {
OS << "Delta passes (pass to `--delta-passes=` as a comma separated list):\n";
#define DELTA_PASS(NAME, FUNC) OS << " " << NAME << "\n";
OS << " IR:\n";
DELTA_PASSES;
for (const DeltaPass &Pass : IR_Passes) {
OS << " " << Pass.Name << '\n';
}
OS << " MIR:\n";
DELTA_PASSES_MIR;
#undef DELTA_PASS
for (const DeltaPass &Pass : MIR_Passes) {
OS << " " << Pass.Name << '\n';
}
}

// Built a set of available delta passes.
static void collectPassNames(const TestRunner &Tester,
SmallStringSet &NameSet) {
#define DELTA_PASS(NAME, FUNC) NameSet.insert(NAME);
if (Tester.getProgram().isMIR()) {
DELTA_PASSES_MIR;
} else {
DELTA_PASSES;
for (const DeltaPass &Pass : MIR_Passes) {
NameSet.insert(Pass.Name);
}
for (const DeltaPass &Pass : IR_Passes) {
NameSet.insert(Pass.Name);
}
#undef DELTA_PASS
}

/// Verify all requested or skipped passes are valid names, and return them in a
Expand Down
24 changes: 24 additions & 0 deletions llvm/tools/llvm-reduce/DeltaPass.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//===--- DeltaPass.h - Delta Pass Structure --------------------*- C++ -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_TOOLS_LLVM_REDUCE_DELTAPASS_H
#define LLVM_TOOLS_LLVM_REDUCE_DELTAPASS_H

#include "ReducerWorkItem.h"
#include "deltas/Delta.h"
#include "llvm/ADT/StringRef.h"

namespace llvm {
struct DeltaPass {
StringRef Name; // e.g., "strip-debug-info"
void (*Func)(Oracle &, ReducerWorkItem &); // e.g.,stripDebugInfoDeltaPass
StringRef Desc; // e.g., "Stripping Debug Info"
};
} // namespace llvm

#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#endif
#endif

68 changes: 68 additions & 0 deletions llvm/tools/llvm-reduce/DeltaPasses.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
//===--- DeltaPasses.def - Delta Pass Definitions --------------*- C++ -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//


#ifndef DELTA_PASS_IR
#define DELTA_PASS_IR(NAME, FUNC, DESC)
#endif
DELTA_PASS_IR("strip-debug-info", stripDebugInfoDeltaPass, "Stripping Debug Info")
DELTA_PASS_IR("functions", reduceFunctionsDeltaPass, "Reducing Functions")
DELTA_PASS_IR("function-bodies", reduceFunctionBodiesDeltaPass, "Reducing Function Bodies")
DELTA_PASS_IR("special-globals", reduceSpecialGlobalsDeltaPass, "Reducing Special Globals")
DELTA_PASS_IR("aliases", reduceAliasesDeltaPass, "Reducing Aliases")
DELTA_PASS_IR("ifuncs", reduceIFuncsDeltaPass, "Reducing Ifuncs")
DELTA_PASS_IR("simplify-conditionals-true", reduceConditionalsTrueDeltaPass,"Reducing conditional branches to true")
DELTA_PASS_IR("simplify-conditionals-false",
reduceConditionalsFalseDeltaPass,"Reducing conditional branches to false")
DELTA_PASS_IR("invokes", reduceInvokesDeltaPass, "Reducing Invokes")
DELTA_PASS_IR("unreachable-basic-blocks",
reduceUnreachableBasicBlocksDeltaPass, "Removing Unreachable Basic Blocks")
DELTA_PASS_IR("basic-blocks", reduceBasicBlocksDeltaPass, "Reducing Basic Blocks")
DELTA_PASS_IR("simplify-cfg", reduceUsingSimplifyCFGDeltaPass,"Reducing using SimplifyCFG")
DELTA_PASS_IR("function-data", reduceFunctionDataDeltaPass, "Reducing Function Data")
DELTA_PASS_IR("global-values", reduceGlobalValuesDeltaPass, "Reducing GlobalValues")
DELTA_PASS_IR("global-objects", reduceGlobalObjectsDeltaPass, "Reducing GlobalObjects")
DELTA_PASS_IR("global-initializers", reduceGlobalsInitializersDeltaPass, "Reducing GV Initializers")
DELTA_PASS_IR("global-variables", reduceGlobalsDeltaPass, "Reducing GlobalVariables")
DELTA_PASS_IR("di-metadata", reduceDIMetadataDeltaPass, "Reducing DIMetadata")
DELTA_PASS_IR("dbg-records", reduceDbgRecordDeltaPass, "Reducing DbgRecords")
DELTA_PASS_IR("distinct-metadata", reduceDistinctMetadataDeltaPass, "Reducing Distinct Metadata")
DELTA_PASS_IR("metadata", reduceMetadataDeltaPass,"Reducing Metadata")
DELTA_PASS_IR("named-metadata", reduceNamedMetadataDeltaPass,"Reducing Named Metadata")
DELTA_PASS_IR("arguments", reduceArgumentsDeltaPass, "Reducing Arguments")
DELTA_PASS_IR("instructions", reduceInstructionsDeltaPass, "Reducing Instructions")
DELTA_PASS_IR("simplify-instructions", simplifyInstructionsDeltaPass,"Simplifying Instructions")
DELTA_PASS_IR("ir-passes", runIRPassesDeltaPass,"Running passes")
DELTA_PASS_IR("operands-zero", reduceOperandsZeroDeltaPass,"Reducing Operands to zero")
DELTA_PASS_IR("operands-one", reduceOperandsOneDeltaPass,"Reducing Operands to one")
DELTA_PASS_IR("operands-nan", reduceOperandsNaNDeltaPass,"Reducing Operands to NaN")
DELTA_PASS_IR("operands-to-args", reduceOperandsToArgsDeltaPass,"Converting operands to function arguments")
DELTA_PASS_IR("operands-skip", reduceOperandsSkipDeltaPass,"Reducing operands by skipping over instructions")
DELTA_PASS_IR("operand-bundles", reduceOperandBundesDeltaPass,"Reducing Operand Bundles")
DELTA_PASS_IR("attributes", reduceAttributesDeltaPass, "Reducing Attributes")
DELTA_PASS_IR("module-data", reduceModuleDataDeltaPass,"Reducing Module Data")
DELTA_PASS_IR("opcodes", reduceOpcodesDeltaPass,"Reducing Opcodes")
DELTA_PASS_IR("volatile", reduceVolatileInstructionsDeltaPass,"Reducing Volatile Instructions")
DELTA_PASS_IR("atomic-ordering", reduceAtomicOrderingDeltaPass,"Reducing Atomic Ordering")
DELTA_PASS_IR("syncscopes", reduceAtomicSyncScopesDeltaPass,"Reducing Atomic Sync Scopes")
DELTA_PASS_IR("instruction-flags", reduceInstructionFlagsDeltaPass, "Reducing Instruction Flags")


#ifndef DELTA_PASS_MIR
#define DELTA_PASS_MIR(NAME, FUNC, DESC)
#endif
DELTA_PASS_MIR("instructions", reduceInstructionsMIRDeltaPass, "Reducing Instructions")
DELTA_PASS_MIR("ir-instruction-references",
reduceIRInstructionReferencesDeltaPass,"Reducing IR references from instructions")
DELTA_PASS_MIR("ir-block-references", reduceIRBlockReferencesDeltaPass,"Reducing IR references from blocks")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
DELTA_PASS_MIR("ir-block-references", reduceIRBlockReferencesDeltaPass,"Reducing IR references from blocks")
DELTA_PASS_MIR("ir-block-references", reduceIRBlockReferencesDeltaPass, "Reducing IR references from blocks")

DELTA_PASS_MIR("ir-function-references", reduceIRFunctionReferencesDeltaPass,"Reducing IR references from functions")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
DELTA_PASS_MIR("ir-function-references", reduceIRFunctionReferencesDeltaPass,"Reducing IR references from functions")
DELTA_PASS_MIR("ir-function-references", reduceIRFunctionReferencesDeltaPass, "Reducing IR references from functions")
Suggested change
DELTA_PASS_MIR("ir-function-references", reduceIRFunctionReferencesDeltaPass,"Reducing IR references from functions")
DELTA_PASS_MIR("ir-function-references", reduceIRFunctionReferencesDeltaPass,"Reducing IR references from functions")

DELTA_PASS_MIR("instruction-flags", reduceInstructionFlagsMIRDeltaPass, "Reducing Instruction Flags")
DELTA_PASS_MIR("register-uses", reduceRegisterUsesMIRDeltaPass,"Reducing register uses")
DELTA_PASS_MIR("register-defs", reduceRegisterDefsMIRDeltaPass,"Reducing register defs")
DELTA_PASS_MIR("register-hints", reduceVirtualRegisterHintsDeltaPass,"Reducing virtual register hints from functions")
DELTA_PASS_MIR("register-masks", reduceRegisterMasksMIRDeltaPass,"Reducing register masks")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
DELTA_PASS_MIR("register-masks", reduceRegisterMasksMIRDeltaPass,"Reducing register masks")
DELTA_PASS_MIR("register-masks", reduceRegisterMasksMIRDeltaPass,"Reducing register masks")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
DELTA_PASS_MIR("register-uses", reduceRegisterUsesMIRDeltaPass,"Reducing register uses")
DELTA_PASS_MIR("register-defs", reduceRegisterDefsMIRDeltaPass,"Reducing register defs")
DELTA_PASS_MIR("register-hints", reduceVirtualRegisterHintsDeltaPass,"Reducing virtual register hints from functions")
DELTA_PASS_MIR("register-masks", reduceRegisterMasksMIRDeltaPass,"Reducing register masks")
DELTA_PASS_MIR("register-uses", reduceRegisterUsesMIRDeltaPass, "Reducing register uses")
DELTA_PASS_MIR("register-defs", reduceRegisterDefsMIRDeltaPass, "Reducing register defs")
DELTA_PASS_MIR("register-hints", reduceVirtualRegisterHintsDeltaPass, "Reducing virtual register hints from functions")
DELTA_PASS_MIR("register-masks", reduceRegisterMasksMIRDeltaPass, "Reducing register masks")

1 change: 1 addition & 0 deletions llvm/tools/llvm-reduce/deltas/Delta.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "ReducerWorkItem.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/raw_ostream.h"
#include <functional>
#include <utility>
Expand Down
15 changes: 3 additions & 12 deletions llvm/tools/llvm-reduce/deltas/ReduceAliases.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
//===----------------------------------------------------------------------===//

#include "ReduceAliases.h"
#include "Delta.h"
#include "Utils.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/GlobalValue.h"
Expand All @@ -22,7 +21,7 @@ using namespace llvm;

/// Removes all aliases aren't inside any of the
/// desired Chunks.
static void extractAliasesFromModule(Oracle &O, ReducerWorkItem &Program) {
void llvm::reduceAliasesDeltaPass(Oracle &O, ReducerWorkItem &Program) {
for (auto &GA : make_early_inc_range(Program.getModule().aliases())) {
if (!O.shouldKeep()) {
GA.replaceAllUsesWith(GA.getAliasee());
Expand All @@ -31,7 +30,7 @@ static void extractAliasesFromModule(Oracle &O, ReducerWorkItem &Program) {
}
}

static void extractIFuncsFromModule(Oracle &O, ReducerWorkItem &WorkItem) {
void llvm::reduceIFuncsDeltaPass(Oracle &O, ReducerWorkItem &WorkItem) {
Module &Mod = WorkItem.getModule();

std::vector<GlobalIFunc *> IFuncs;
Expand All @@ -42,12 +41,4 @@ static void extractIFuncsFromModule(Oracle &O, ReducerWorkItem &WorkItem) {

if (!IFuncs.empty())
lowerGlobalIFuncUsersAsGlobalCtor(Mod, IFuncs);
}

void llvm::reduceAliasesDeltaPass(TestRunner &Test) {
runDeltaPass(Test, extractAliasesFromModule, "Reducing Aliases");
}

void llvm::reduceIFuncsDeltaPass(TestRunner &Test) {
runDeltaPass(Test, extractIFuncsFromModule, "Reducing Ifuncs");
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline at end of file errors

Suggested change
}
}

4 changes: 2 additions & 2 deletions llvm/tools/llvm-reduce/deltas/ReduceAliases.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#include "Delta.h"

namespace llvm {
void reduceAliasesDeltaPass(TestRunner &Test);
void reduceIFuncsDeltaPass(TestRunner &Test);
void reduceAliasesDeltaPass(Oracle &O, ReducerWorkItem &Program);
void reduceIFuncsDeltaPass(Oracle &O, ReducerWorkItem &WorkItem);
} // namespace llvm

#endif
9 changes: 2 additions & 7 deletions llvm/tools/llvm-reduce/deltas/ReduceArguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
//===----------------------------------------------------------------------===//

#include "ReduceArguments.h"
#include "Delta.h"
#include "Utils.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/IR/Constants.h"
Expand Down Expand Up @@ -112,7 +111,7 @@ static bool allFuncUsersRewritable(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(Oracle &O, ReducerWorkItem &WorkItem) {
Module &Program = WorkItem.getModule();
std::vector<Argument *> InitArgsToKeep;
std::vector<Function *> Funcs;
Expand Down Expand Up @@ -176,8 +175,4 @@ static void extractArgumentsFromModule(Oracle &O, ReducerWorkItem &WorkItem) {
F->replaceAllUsesWith(ClonedFunc);
F->eraseFromParent();
}
}

void llvm::reduceArgumentsDeltaPass(TestRunner &Test) {
runDeltaPass(Test, extractArgumentsFromModule, "Reducing Arguments");
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}

More of these

2 changes: 1 addition & 1 deletion llvm/tools/llvm-reduce/deltas/ReduceArguments.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "llvm/Transforms/Utils/Cloning.h"

namespace llvm {
void reduceArgumentsDeltaPass(TestRunner &Test);
void reduceArgumentsDeltaPass(Oracle &O, ReducerWorkItem &WorkItem);
} // namespace llvm

#endif
7 changes: 1 addition & 6 deletions llvm/tools/llvm-reduce/deltas/ReduceAttributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
//===----------------------------------------------------------------------===//

#include "ReduceAttributes.h"
#include "Delta.h"
#include "TestRunner.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
Expand Down Expand Up @@ -166,11 +165,7 @@ class AttributeRemapper : public InstVisitor<AttributeRemapper> {
} // namespace

/// Removes out-of-chunk attributes from module.
static void extractAttributesFromModule(Oracle &O, ReducerWorkItem &WorkItem) {
void llvm::reduceAttributesDeltaPass(Oracle &O, ReducerWorkItem &WorkItem) {
AttributeRemapper R(O, WorkItem.getModule());
R.visit(WorkItem.getModule());
}

void llvm::reduceAttributesDeltaPass(TestRunner &Test) {
runDeltaPass(Test, extractAttributesFromModule, "Reducing Attributes");
}
Loading