aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-reduce/DeltaManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-reduce/DeltaManager.cpp')
-rw-r--r--llvm/tools/llvm-reduce/DeltaManager.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/llvm/tools/llvm-reduce/DeltaManager.cpp b/llvm/tools/llvm-reduce/DeltaManager.cpp
index dab4040..8dd16b0 100644
--- a/llvm/tools/llvm-reduce/DeltaManager.cpp
+++ b/llvm/tools/llvm-reduce/DeltaManager.cpp
@@ -24,6 +24,7 @@
#include "deltas/ReduceGlobalVarInitializers.h"
#include "deltas/ReduceGlobalVars.h"
#include "deltas/ReduceInstructions.h"
+#include "deltas/ReduceInstructionsMIR.h"
#include "deltas/ReduceMetadata.h"
#include "deltas/ReduceModuleData.h"
#include "deltas/ReduceOperandBundles.h"
@@ -59,9 +60,16 @@ static cl::opt<std::string>
DELTA_PASS("attributes", reduceAttributesDeltaPass) \
DELTA_PASS("module-data", reduceModuleDataDeltaPass)
+#define DELTA_PASSES_MIR \
+ DELTA_PASS("instructions", reduceInstructionsMIRDeltaPass)
+
static void runAllDeltaPasses(TestRunner &Tester) {
#define DELTA_PASS(NAME, FUNC) FUNC(Tester);
- DELTA_PASSES
+ if (Tester.getProgram().isMIR()) {
+ DELTA_PASSES_MIR
+ } else {
+ DELTA_PASSES
+ }
#undef DELTA_PASS
}
@@ -71,7 +79,11 @@ static void runDeltaPassName(TestRunner &Tester, StringRef PassName) {
FUNC(Tester); \
return; \
}
- DELTA_PASSES
+ if (Tester.getProgram().isMIR()) {
+ DELTA_PASSES_MIR
+ } else {
+ DELTA_PASSES
+ }
#undef DELTA_PASS
errs() << "unknown pass \"" << PassName << "\"";
exit(1);
@@ -80,7 +92,10 @@ 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
+ OS << " MIR:\n";
+ DELTA_PASSES_MIR
#undef DELTA_PASS
}