[llvm-dev] llvm-reduce for MIR

Markus Lavin via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 17 02:04:28 PDT 2021


Has anyone thought about extending llvm-reduce to also be able to do reduction on MIR?

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?

-Markus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210817/b950201d/attachment.html>


More information about the llvm-dev mailing list