[llvm-commits] JIT: Emitting a debug location after an instruction

Jeffrey Yasskin jyasskin at google.com
Mon Aug 23 11:57:47 PDT 2010


On Mon, Aug 23, 2010 at 3:28 PM, nicolas geoffray
<nicolas.geoffray at gmail.com> wrote:
> On Mon, Aug 23, 2010 at 2:57 PM, Jeffrey Yasskin <jyasskin at google.com>
> wrote:
>>
>> Do you _only_ attach line information to calls, or also to each other
>> instruction?
>
> I only attach line (or more precisely metadata) information to calls.
>
>>
>> If it's only to the calls, do you just not provide line
>> numbers for the leaf frame? If you do provide line numbers for the
>> leaf frame, are you worried about providing the wrong number just
>> after returning from a call?
>
> I don't have leaf frames.
>
>>
>> The line number debug information is generally compressed into a table
>> of (address, line) pairs, sorted by the address. Then you search the
>> leaf frame using "std::upper_bound(table, PC)-1".
>
> The code that looks up the method from the PC is performance sensitive, so
> using upper_bound is not ideal.

I'm not sure processDebugLoc does what you need it to, even with your
changes. It only records an address when the DebugLoc changes, and
that's not guaranteed to happen exactly on the call
MachineInstruction. (Unless you've done something to ensure it does?)
Do you have a unit test that shows this works in all cases?

Mapping return addresses to metadata seems like more of a job for the
GC system, but that's not implemented for the JIT, so I can't very
well say to use it instead. :-/



More information about the llvm-commits mailing list