[LLVMdev] Associate IR instruction with corresponding assembly

shruti padmanabha shrupad at umich.edu
Sun May 18 23:23:23 PDT 2014


Hi,

Thank you for the reply! Can you point me to a method to go about solving
this bug?
Or instead, is there another way I can associate every assembly instruction
to a corresponding IR one?

Thanks again!
Shruti


On Mon, May 19, 2014 at 2:13 AM, Bruce Hoult <bruce at hoult.org> wrote:

> Yes, that one crashes for me for every architecture I tried except the
> experimental AVR target -- which doesn't support dwarf.
>
>         .file   "hello.deb.ll"
>
>         .text
>
>         .globl  main
>
>         .align  2
>
>         .type   main, at function
>
> main:                                   ; @main
>
> ; BB#0:                                 ; %entry
>
>         ldi     r24, lo8(.L.str)
>
>         ldi     r25, hi8(.L.str)
>
>         push    r25
>
>         push    r24
>
>         call    printf
>
>         in      r30, 61
>
>         in      r31, 62
>
>         adiw    r30, 2
>
>         in      r0, 63
>
>         cli
>
>         out     62, r31
>
>         out     63, r0
>
>         out     61, r30
>
>         ldi     r22, 1
>
>         ldi     r23, 0
>
>         ldi     r24, 0
>
>         ldi     r25, 0
>
>         ret
>
> .Ltmp0:
>
>         .size   main, .Ltmp0-main
>
>
>         .type   .L.str, at object          ; @.str
>
>         .section        .rodata.str1.1,"aMS", at progbits,1
>
> .L.str:
>
>         .asciz  "Hello World"
>
>         .size   .L.str, 12
>
>
>
> On Mon, May 19, 2014 at 5:59 PM, shruti padmanabha <shrupad at umich.edu>wrote:
>
>> Oops, I didn't attach the .ll file after the -debug-ir pass. Adding it
>> here.
>>
>>
>>
>> On Mon, May 19, 2014 at 1:55 AM, shruti padmanabha <shrupad at umich.edu>wrote:
>>
>>> Hi,
>>>
>>> Compiling for both x86 and ARM with llc aborts after this pass.
>>> I have a simple helloworld.c program.
>>>
>>> I am attaching the .ll file created by:
>>> *clang -O3 -g -emit-llvm hello.c -c -o hello.bc*
>>>
>>> *llvm-dis hello.bc*
>>>
>>> Thanks again for the response!
>>> Shruti
>>>
>>>
>>> On Mon, May 19, 2014 at 1:28 AM, Tobias Grosser <tobias at grosser.es>wrote:
>>>
>>>> On 19/05/2014 00:54, shruti padmanabha wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Thanks for the pointer. I am unfortunately running into llc problems
>>>>> with
>>>>> this pass.
>>>>> I did
>>>>> *opt  -debug-ir   hello.bc -o hello.deb.bc*
>>>>>
>>>>> *llc -march=arm -debug  -O0 hello.deb.bc  -o hello.deb.s*
>>>>>
>>>>>
>>>>> This is aborting with the error: llc:
>>>>> llvm-3.4/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1614: void
>>>>> llvm::DwarfDebug::beginFunction(const llvm::MachineFunction*):
>>>>> Assertion
>>>>> `TheCU && "Unable to find compile unit!"' failed.
>>>>> I'm assuming this is because llc found some errors in the metadata that
>>>>> debug-ir prints out. How do I find and correct this?
>>>>>
>>>>
>>>> This is indeed surprising. I have no idea where this is coming from.
>>>> Does this only happen on ARM? Can you attach the debug.bc file? Or even
>>>> better, open a bug report for that?
>>>>
>>>> I included Daniel who committed the -debug-ir pass as well as Eric who
>>>> has better knowledge about debug info than me.
>>>>
>>>> Cheers,
>>>> Tobisa
>>>>
>>>
>>>
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140519/69354c18/attachment.html>


More information about the llvm-dev mailing list