llvm-reduce: Support multiple MachineFunctions
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 19 Apr 2022 02:19:57 +0000 (22:19 -0400)
committerMatt Arsenault <arsenm2@gmail.com>
Wed, 27 Apr 2022 22:11:59 +0000 (18:11 -0400)
commit7c2db66632486c7c460779843d60477a06ded462
treea03dfbf42dadca911a8389bb52d187a4db2281ba
parent49c75345871d8b5b192d41b1e222a36f2ba81584
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.
llvm/include/llvm/CodeGen/MachineModuleInfo.h
llvm/lib/CodeGen/MachineModuleInfo.cpp
llvm/test/tools/llvm-reduce/mir/multiple-functions.mir [new file with mode: 0644]
llvm/tools/llvm-reduce/ReducerWorkItem.cpp
llvm/tools/llvm-reduce/ReducerWorkItem.h
llvm/tools/llvm-reduce/TestRunner.cpp
llvm/tools/llvm-reduce/TestRunner.h
llvm/tools/llvm-reduce/deltas/Delta.cpp
llvm/tools/llvm-reduce/deltas/Delta.h
llvm/tools/llvm-reduce/deltas/ReduceInstructionsMIR.cpp
llvm/tools/llvm-reduce/llvm-reduce.cpp