<div dir="ltr">+1, this would be a cool addition to llvm-reduce.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 17, 2021 at 1:08 PM Quentin Colombet via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">Hi Markus,<br><div><br><blockquote type="cite"><div>On Aug 17, 2021, at 2:04 AM, Markus Lavin via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br><div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">Has anyone thought about extending llvm-reduce to also be able to do reduction on MIR?</span></div></div></div></blockquote><div><br></div><div>Thought about it, yes, doing anything about it, no :).</div><br><blockquote type="cite"><div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US"><u></u><u></u></span></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US"><u></u> <u></u></span></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">The current tool itself seems quite modular and nicely structured with the delta-algorithm separated from the actual IR specific reductions.<u></u><u></u></span></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">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.<u></u><u></u></span></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US"><u></u> <u></u></span></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">At least for me manually reducing MIR is quite slow an painful so any automation here would be appreciated.<u></u><u></u></span></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US"><u></u> <u></u></span></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">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.<u></u><u></u></span></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US"><u></u> <u></u></span></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">Any thoughts on this?</span></div></div></div></blockquote><div><br></div><div>Having such tool would be super useful!</div><div><br></div><div>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.</div><div><br></div><div>Cheers,</div><div>-Quentin</div><br><blockquote type="cite"><div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US"><u></u><u></u></span></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US"><u></u> <u></u></span></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">-Markus<u></u><u></u></span></div></div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">_______________________________________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">LLVM Developers mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><a href="mailto:llvm-dev@lists.llvm.org" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">llvm-dev@lists.llvm.org</a><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a></div></blockquote></div><br></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>