[PATCH] Global merge on constants

Quentin Colombet qcolombet at apple.com
Wed Mar 13 15:18:25 PDT 2013


I’ve discussed offline with Bill Wendling and we came up with the following proposal:

We could scan the uses of the global variables and exculde from the candidates those that are used (directly or transitively via bit casts) in landing pad instructions or inline asm.

To fix the problem of potentially hardcoded reference of a global in inline assembly statement, the user must put a "used" attribute on the related global variable. Then, variables used into an appending global instruction would be filtered out too. (This is how the problem is fixed for functions called from inline asm).

I’m writing a patch in that direction.

In the meantime, if you have any concern/comment, feel free to ask.

Thanks again for your help,

-Quentin

On Mar 13, 2013, at 12:58 PM, Quentin Colombet <qcolombet at apple.com> wrote:

> Thanks Anton.
> 
> Seems like we are back to square one and in fact even worse, according to Duncan’s comment on inline assembly, the current approach may be wrong!
> 
> Ideas?
> 
> -Quentin
> 
> On Mar 13, 2013, at 12:40 PM, Anton Korobeynikov <anton at korobeynikov.info> wrote:
> 
>>> If I understand correctly this PR, it is not possible to create aliases to
>>> the middle of a structure for Mach-O target.
>>> What is the current status for other targets?
>> I believe you can create more or less arbitrary aliases on ELF targets
>> only. Everywhere else there are serious limitations
>> 
>> -- 
>> With best regards, Anton Korobeynikov
>> Faculty of Mathematics and Mechanics, Saint Petersburg State University
> 
> _______________________________________________
> 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/20130313/5f3fd0da/attachment.html>


More information about the llvm-commits mailing list