<div dir="ltr"><div><div><div><div><div>I'm not sure if this helps, but here it is in case it does.<br><br></div>I typically use bugpoint in a way as to keep the actual failure that I'm after. For example, with the test case you've pasted, I was looking for a specific assert. So I used bugpoint this way:<br><br><span style="font-family:monospace,monospace">$ cat reduceme.sh <br>#!/bin/bash<br>llc -filetype=obj $1 2>&1 | grep 'Cannot lower calls with arbitrary operand bundles'<br>RC=$?<br>if [[ $RC -eq 0 ]]<br>then<br>  exit 1<br>fi<br>exit 0<br><br>$ bugpoint -compile-custom -compile-command=$PWD/reduceme.sh input.ll</span><br><br></div>That will ensure that bugpoint retains the specific desired failure behaviour as it is reducing the test case.<br><br></div>Hope that helps,<br></div>Nemanja<br><br></div>P.S. It is not that I am specifically interested in that assert - just that that's how the original test case was failing so that's what I wanted to preserve as an illustration.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 20, 2018 at 11:14 AM, Valentin Churavy <span dir="ltr"><<a href="mailto:v.churavy@gmail.com" target="_blank">v.churavy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thank you both!<div><br></div><div>I was running into the issue that bugpoint was reducing my test-case into other failures and I hadn't managed yet to find the right point in the Julia pass pipeline to insert the module to reproduce the issue reliably from llc and that's why I started looking at using the MIR.</div><div><br></div><div>I will go back at looking at the pass pipeline and the IR and get a reproducer that way!</div><div><br></div><div>Thanks,</div><div>Valentin</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, 20 Mar 2018 at 07:51 Nemanja Ivanovic <<a href="mailto:nemanja.i.ibm@gmail.com" target="_blank">nemanja.i.ibm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Valentin,<br></div>in terms of limitations as Sean pointed out, an important one is that .mir doesn't have MachineFunctionInfo which may result in failure on accesses to global variables due to use of register X2. The verifier considers it an undefined register.<br></div>Also, it's probably easier to reduce test cases using bugpoint starting from an IR test case. With the code you provided, I get a different crash than what you apparently get. Here are the test case and the backtrace.<br><br></div><div>Test case: <a href="https://pastebin.com/fxjRtJD0" target="_blank">https://pastebin.com/fxjRtJD0</a><br></div>Backtrace: <a href="https://pastebin.com/FsXMvbGK" target="_blank">https://pastebin.com/FsXMvbGK</a><br><br></div></div><div dir="ltr">Nemanja<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 19, 2018 at 11:51 PM, Sean Fertile via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hello Valentin, <br><br></div>To generate a mir test case i 
think the process is to first create an IR file by passing '-S 
-emit-llvm' to clang, then you can feed that file into llc and use 
stop-before to get the mir just before the if-converter pass, eg: `llc 
-stop-before=if-converter  -simplify-mir -o test.mir test.ll`. <br><br></div><div>Also there is a MIR language reference: <a href="https://llvm.org/docs/MIRLangRef.html" target="_blank">https://llvm.org/docs/<wbr>MIRLangRef.html</a> which has some of the limitations documented, as well as tips for further simplifying the generated mir if need be.<br><br></div></div><div>Regards,<br></div>Sean<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-8226874686914593656m_1111079430730877769h5">On Mon, Mar 19, 2018 at 7:53 PM, Valentin Churavy via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-8226874686914593656m_1111079430730877769h5"><div dir="ltr">Hello,<div><br></div><div>I am trying to isolate an assertion failure in if-converter (on PPC) and I generated a textual debuglog with:</div><div><br></div><div>```</div><div>LLVM_ARGS=-print-before-all -print-module-scope -filter-print-funcs=japi1__<wbr>require_7687<br></div><div>```</div><div><br></div><div>and after splicing out the the MIR before the if-converter pass</div><div>I would like to run `llc -march=ppc64le -run-pass=if-converter input.mir` so that I can start minimising the MIR.</div><div><br></div><div>This steps fails for me with a:</div><div>```</div><div><div>error: YAML:188:20: Unrecognized character while tokenizing.</div><div>Function Live Ins: %x4</div><div>                   ^</div><div><br></div><div>error: YAML:188:1: Map value must not be empty</div><div>Function Live Ins: %x4</div><div>^~~~~~~~~~~~~~~~~</div></div><div>```</div><div><br></div><div>Should I expect this to work, or is some part of my workflow wrong?</div><div><br></div><div>I put the full log and just the extracted MIR file online:</div><div><a href="https://drive.google.com/open?id=1Br0s9Qvr4tzPv8nqbnV_nWezpEH5Ci7B" target="_blank">https://drive.google.com/open?<wbr>id=1Br0s9Qvr4tzPv8nqbnV_<wbr>nWezpEH5Ci7B</a> and would appreciate any guidance whether I should file this as a deserialiser bug.</div><div><br></div><div>Best,</div><div>Valentin</div><div><br></div><div><br></div></div>
<br></div></div>______________________________<wbr>_________________<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div>
</blockquote></div><br></div>