[llvm-commits] patch: treat selector ref globals as constant in MachineLICM

Duncan Sands baldrick at free.fr
Thu Nov 3 02:03:26 PDT 2011


Hi Peter,

> Please review this patch to allow the compiler to treat objc selector reference globals as constant when optimizing.  These globals aren't actually constant at compile time in that the value they point at may be changed by the linker or runtime, but the value they have is the same for all loads from that address once the program has started.

what if you declare the global to be a weak constant?  I guess the problem is
that you need internal linkage?

Ciao, Duncan.

> Ideally this code shouldn't be checking for the name of the global, but the correct change likely involves adding a new linkage type which is much more significant and overkill while there's only one type of variable this applies to.
>
> Thanks,
> Pete
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list