Labeling of blocks and locals
Dibyendu Majumdar
mobile@majumdar.org.uk
Thu Jan 1 00:00:00 GMT 2015
On 15 June 2015 at 04:41, David Malcolm <dmalcolm@redhat.com> wrote:
> On Sun, 2015-06-14 at 20:21 +0100, Dibyendu Majumdar wrote:
>> It seems that if a name is supplied to a block it is translated as a
>> label - but then if the same name is supplied to two blocks the labels
>> show up as the same.
>
> They show up in dumps the same, which is going to be ambiguous to a
> human reader, but I don't think it's a problem for the IR and the
> compiler, I *think* it does it by identity, rather than be name, as it
> were (not sure, but it's late here).
>
>> A similar question involves naming of locals. When I declare a local
>> and assign it a name - the name is not made unique. During code
>> generation whenever certain types of statements are processed, local
>> variables may be generated. These are given the same name - in LLVM
>> the names are automatically made unqiue, but I notice that in
>> libgccjit this is not so.
>
> Again, I'm not sure that this is a problem other than the ambiguity of
> the dumps for the human reader; I *think* the IR/compiler treats two
> locals created with multiple calls to gcc_jit_function_new_local as
> different, even if they have the same name (it'd be a problem for
> *globals* though).
>
I will ensure names are unique as otherwise they will be useless to
the human reader - but would be good if you confirmed whether name
plays any role other than being useful debugging information.
Thanks and Regards
Dibyendu
More information about the Jit
mailing list