aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-reduce/llvm-reduce.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2022-04-18 22:19:57 -0400
committerMatt Arsenault <arsenm2@gmail.com>2022-04-27 18:11:59 -0400
commit7c2db66632486c7c460779843d60477a06ded462 (patch)
treea03dfbf42dadca911a8389bb52d187a4db2281ba /llvm/tools/llvm-reduce/llvm-reduce.cpp
parent49c75345871d8b5b192d41b1e222a36f2ba81584 (diff)
downloadllvm-7c2db66632486c7c460779843d60477a06ded462.zip
llvm-7c2db66632486c7c460779843d60477a06ded462.tar.gz
llvm-7c2db66632486c7c460779843d60477a06ded462.tar.bz2
llvm-reduce: Support multiple MachineFunctions
The current testcase I'm trying to reduce only reproduces with IPRA enabled and requires handling multiple functions. The only real difference vs. the IR is the extra indirect to look for the underlying MachineFunction, so treat the ReduceWorkItem as the module instead of the function. The ugliest piece of this is really the ugliness of MachineModuleInfo. It not only tracks actual module state, but has a number of transient fields used for isel and/or the asm printer. These shouldn't do any harm for the use here, though they should be separated out.
Diffstat (limited to 'llvm/tools/llvm-reduce/llvm-reduce.cpp')
-rw-r--r--llvm/tools/llvm-reduce/llvm-reduce.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/tools/llvm-reduce/llvm-reduce.cpp b/llvm/tools/llvm-reduce/llvm-reduce.cpp
index db7bfa9..5581745 100644
--- a/llvm/tools/llvm-reduce/llvm-reduce.cpp
+++ b/llvm/tools/llvm-reduce/llvm-reduce.cpp
@@ -138,16 +138,16 @@ int main(int Argc, char **Argv) {
LLVMContext Context;
std::unique_ptr<TargetMachine> TM;
- std::unique_ptr<MachineModuleInfo> MMI;
- std::unique_ptr<ReducerWorkItem> OriginalProgram = parseReducerWorkItem(
- Argv[0], InputFilename, Context, TM, MMI, ReduceModeMIR);
+ std::unique_ptr<ReducerWorkItem> OriginalProgram =
+ parseReducerWorkItem(Argv[0], InputFilename, Context, TM, ReduceModeMIR);
if (!OriginalProgram) {
return 1;
}
// Initialize test environment
- TestRunner Tester(TestFilename, TestArguments, std::move(OriginalProgram));
+ TestRunner Tester(TestFilename, TestArguments, std::move(OriginalProgram),
+ std::move(TM));
// Try to reduce code
runDeltaPasses(Tester, MaxPassIterations);