[patch] Change the .ll syntax for comdats and add a syntactic sugar

Sean Silva chisophugis at gmail.com
Mon Jan 5 15:39:54 PST 2015


I haven't been following the discussion that led to seeking a more compact
syntax, but personally I think that adding sugar to the .ll syntax is not a
good idea. The reason is that I generally find it more difficult to
remember how to expand various infrequently-used/encountered sugars while
reading than to wade through verbosity while reading.

Just my 2 cents.

-- Sean Silva

On Mon, Jan 5, 2015 at 11:34 AM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> In order to make comdats always explicit in the IR, we decided to make
> the syntax a bit more compact for the case o a GlobalObject in a
> comdat with the same name.
>
> Just dropping the $name causes problems for
>
> @foo = globabl i32 0, comdat
> $bar = comdat ...
>
> and
>
> declare void @foo() comdat
> $bar = comdat ...
>
> so the attached patch changes the syntax to
>
> @foo = comdat $foo global i32 0
>
> and
>
> declare comdat $foo void @foo
>
> and as a syntactic sugar
>
> $foo = comdat ...
> @foo = comdat global ...
>
> is now equivalent to
>
> $foo = comdat ...
> @foo = comdat $foo global ...
>
> and
>
> $foo = comdat ...
> declare comdat void @foo(...
>
> is now equivalent to
>
> $foo = comdat ...
> declare comdat $foo void @foo(...
>
> It would be possible to take this one step further and make
>
> @foo = comdat global ...
>
> equivalent to
>
> $foo = comdat any
> @foo = comdat $foo global ...
>
> but it is not clear if that is worth it. It would require rejecting things
> like
>
> $foo = comdat largest
> @foo = comdat global...
>
> Maybe as an independent patch we could make all
>
> $foo = comdat any
>
> optional instead?
>
> Cheers,
> Rafael
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150105/932763b0/attachment.html>


More information about the llvm-commits mailing list