<div dir="ltr">Thanks for the pointer!<div><br></div><div>I'm a little confused how the custom script (specified by <a href="https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-reduce/llvm-reduce.cpp#L38">--test arg</a>) tells llvm-reduce if something is interesting in the IR. </div><div><br></div><div>Is it a common practice to wrap "llvm-lit <IR>" into a shell script to simplify IR for a unit test?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 18, 2021 at 9:23 AM Philip Reames <<a href="mailto:listmail@philipreames.com">listmail@philipreames.com</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>
<p>See llvm-reduce. <br>
</p>
<p>Philip<br>
</p>
<div>On 11/18/21 9:14 AM, Mingming Liu via
llvm-dev wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi,
<div><br>
<div> When modifying IR for the purpose of a unit test
(e.g., in <a href="https://github.com/llvm/llvm-project/tree/main/llvm/test/Transforms/SROA" target="_blank">https://github.com/llvm/llvm-project/tree/main/llvm/test/Transforms/SROA</a>),
the IR generated by OPT may have metadata that's not used by
the tested pass.</div>
<div><br>
Are there some general suggestions on how to strip
metadata? Is this mostly empirical by analyzing how the
metadata takes effect in the e2e compiling process (i.e.,
outside of one pass)? Any form of pointers / related threads
in the past would be enlightening!<br>
<br>
From this perspective stripping unused metadata
manually could be error prone (e.g., for a more complex IR,
or a test IR consisting of 10+ functions).<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div><font size="2" face="sans-serif" color="#555555">Thanks,</font></div>
<div><font size="2" face="sans-serif" color="#555555">Mingming</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
LLVM Developers mailing list
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
</div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div><font color="#555555" face="sans-serif" size="2">Thanks,</font></div><div><font color="#555555" face="sans-serif" size="2">Mingming</font></div></div></div></div></div></div>