So to report back to this thread. I went ahead and did something https://reviews.llvm.org/D110527 If anyone is interested feel free to add yourselves as reviewer. -Markus From: Arthur Eubanks <aeubanks at google.com> Sent: den 18 augusti 2021 00:08 To: Quentin Colombet <qcolombet at apple.com> Cc: Markus Lavin <markus.lavin at ericsson.com>; llvm-dev <llvm-dev at lists.llvm.org> Subject: Re: [llvm-dev] llvm-reduce for MIR +1, this would be a cool addition to llvm-reduce. On Tue, Aug 17, 2021 at 1:08 PM Quentin Colombet via llvm-dev <mailto:llvm-dev at lists.llvm.org> wrote: Hi Markus, On Aug 17, 2021, at 2:04 AM, Markus Lavin via llvm-dev <mailto:llvm-dev at lists.llvm.org> wrote: Has anyone thought about extending llvm-reduce to also be able to do reduction on MIR? Thought about it, yes, doing anything about it, no :). The current tool itself seems quite modular and nicely structured with the delta-algorithm separated from the actual IR specific reductions. When reducing IR instructions (ReduceInstructions.cpp) it just does RAUW undef and then eraseFromParent so in theory it seems it would be possible to do a similar thing for MIR. At least while on SSA form one could either RAUW $noreg or perhaps a dominating definition of the same register class. So maybe it would not be too much work to add a set of MIR specific reducers (at least for MBB and MI) and generalize the remaining part of the tool (module import and verification) to able to handle both IR and MIR. At least for me manually reducing MIR is quite slow an painful so any automation here would be appreciated. Of course in general MIR is more constrained that IR so it may be “a bit” more complicated than outlined here, but still seems worth a try. Any thoughts on this? Having such tool would be super useful! On a somewhat related note, I built a tool to extract a basic block from MIR (i.e., like llvm-extract but on MIR). I’ve never bothered cleaning it up and open sourcing it, but if there is interest for that I could certainly push that out. Cheers, -Quentin -Markus _______________________________________________ LLVM Developers mailing list mailto:llvm-dev at lists.llvm.org https://protect2.fireeye.com/v1/url?k=0528e208-5ab3db39-0528a293-86e2237f51fb-7364d6345fc306d7&q=1&e=a4b84571-8b4a-495a-897e-364168be80ed&u=https%3A%2F%2Flists.llvm.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fllvm-dev _______________________________________________ LLVM Developers mailing list mailto:llvm-dev at lists.llvm.org https://protect2.fireeye.com/v1/url?k=e73b4d67-b8a07456-e73b0dfc-86e2237f51fb-744529c322f89b86&q=1&e=a4b84571-8b4a-495a-897e-364168be80ed&u=https%3A%2F%2Flists.llvm.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fllvm-dev