[LLVMdev] JIT debug dumps [Was Re: Load from abs address generated bad code on LLVM 2.4]

Evan Cheng evan.cheng at apple.com
Thu Jan 22 22:15:33 PST 2009



On Jan 22, 2009, at 3:13 AM, Andrew Haley <aph at redhat.com> wrote:

> Chris Lattner wrote:
>> On Jan 21, 2009, at 4:15 AM, Andrew Haley wrote:
>>>> That should work fine, just use "jit" instead of "x86-emitter" as  
>>>> the
>>>> debug type.
>>> That's impossible: CurrentDebugType is now private; it appears
>>> nowhere in the installed headers.  I can't find any public interface
>>> to allow a JIT to set it.
>>
>> Ah ok.  I'd suggest doing what llvm-gcc does here, it is a much more
>> stable API:
>>
>>   std::vector<const char*> Args;
>>   Args.push_back(""); // program name
>>   Args.push_back("-debug-only=jit");
>>   ...
>>   Args.push_back(0);  // Null terminator.
>>   cl::ParseCommandLineOptions(Args.size()-1, (char**)&Args[0]);
>>
>> This also gives you control over optimizations and codegen options,
>
> Yes, thanks.  It's a slightly weird hack, but it works perfectly.  :-)
>
> "-debug-only=jit" generates just a binary dump, like this:
>
> JIT: Binary code:
> JIT: 00000000: 4a04b848 000000ca 048b0000 c320
>
> whereas "-debug-only=x86-emitter" generates this:

This has been changed in tot. -debug-only=jit will dump both target  
independent and target specific debug info.

Evan
>
>
> %RAX<def> = MOV64ri <ga:poo1>
> %EAX<def> = MOV32rm %RAX<kill>, 1, %reg0, 0, Mem:LD(4,4) [poo1 + 0]
> RET %EAX<imp-use,kill>
>
> which may be more useful.
>
> Can I put in a request some machine-independent names for the debug
> dumps?  It's "x86-emitter", "alpha-emitter", "x86-codegen", and so on.
> We'd have to put a big target-dependent switch statement in our code  
> to
> enable asm dumps.
>
> Andrew.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



More information about the llvm-dev mailing list