[LLVMdev] merging globals

Mike Stump mrs at apple.com
Thu Oct 16 12:35:45 PDT 2008


On Oct 16, 2008, at 1:50 AM, Eli Friedman wrote:
> Hmm... so the issue is that it's good for codesize to merge objects
> with static duration that are marked in the source as const in
> C/ObjC/C++, even when we can't prove it's correct?

Yes.

> That sounds generally reasonable, although it would be mildly  
> surprising for anyone coding according to the standard.

Apparently no.  :-)  In practice, I've seen one bug report for it in 5  
years.

> It doesn't really change the issue, though; we want the merging to be
> a front-end option, and we still need a solution which handles
> variables that gets marked by the optimizer.

I think so.  If we could get C/C++ to just bless merging and then just  
support that and ignore legacy standards and legacy code, we might be  
able to leave it as is.



More information about the llvm-dev mailing list