[llvm-dev] MIR YAML deserialisation failure

Nemanja Ivanovic via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 20 04:51:36 PDT 2018


Valentin,
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.
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.

Test case: https://pastebin.com/fxjRtJD0
Backtrace: https://pastebin.com/FsXMvbGK

Nemanja

On Mon, Mar 19, 2018 at 11:51 PM, Sean Fertile via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hello Valentin,
>
> 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`.
>
> Also there is a MIR language reference: https://llvm.org/docs/
> MIRLangRef.html which has some of the limitations documented, as well as
> tips for further simplifying the generated mir if need be.
>
> Regards,
> Sean
>
> On Mon, Mar 19, 2018 at 7:53 PM, Valentin Churavy via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> Hello,
>>
>> I am trying to isolate an assertion failure in if-converter (on PPC) and
>> I generated a textual debuglog with:
>>
>> ```
>> LLVM_ARGS=-print-before-all -print-module-scope
>> -filter-print-funcs=japi1__require_7687
>> ```
>>
>> and after splicing out the the MIR before the if-converter pass
>> I would like to run `llc -march=ppc64le -run-pass=if-converter input.mir`
>> so that I can start minimising the MIR.
>>
>> This steps fails for me with a:
>> ```
>> error: YAML:188:20: Unrecognized character while tokenizing.
>> Function Live Ins: %x4
>>                    ^
>>
>> error: YAML:188:1: Map value must not be empty
>> Function Live Ins: %x4
>> ^~~~~~~~~~~~~~~~~
>> ```
>>
>> Should I expect this to work, or is some part of my workflow wrong?
>>
>> I put the full log and just the extracted MIR file online:
>> https://drive.google.com/open?id=1Br0s9Qvr4tzPv8nqbnV_nWezpEH5Ci7B and
>> would appreciate any guidance whether I should file this as a deserialiser
>> bug.
>>
>> Best,
>> Valentin
>>
>>
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>
>>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180320/9731d7fe/attachment-0001.html>


More information about the llvm-dev mailing list