[PATCH 1/3] Add new keyword externally_initialized to LLVM.

Michael Gottesman mgottesman at apple.com
Fri Feb 1 16:54:17 PST 2013


(when I say here I mean on the list for comments/etc).

On Feb 1, 2013, at 4:53 PM, Michael Gottesman <mgottesman at apple.com> wrote:

> Ok. So how does this sound John/Sean:
> 
> I will commit this patch and prepare a second patch with the clarification paragraph and post it here.
> 
> Michael
> 
> On Feb 1, 2013, at 4:36 PM, John McCall <rjmccall at apple.com> wrote:
> 
>> On Feb 1, 2013, at 3:01 PM, Sean Silva <silvas at purdue.edu> wrote:
>>> +By default, LLVM optimizes global initializers by assuming that global
>>> +variables defined within the module are not modified from their
>>> +initial values before the start of the global initializer.
>>> 
>>> Is this assumption documented anywhere else in LangRef?
>> 
>> I don't think so.  I agree that it ought to be;  I'm not sure where.
>> 
>>> If not, then this creates a normative specification about the
>>> semantics of globals in LLVM IR. I'm not saying whether that is good
>>> or bad, but is it intentional?
>> 
>> It is at least the apparent existing semantics of IR.  Arguably the default
>> semantics ought to be reversed, but that would be a very invasive change.
>> 
>>> If so, I would rather add this specification in a separate patch fixing the
>>> omission (it is essentially fixing a documentation bug (unspecified aspect
>>> of the language); no need to confuse that change with adding a new
>>> language feature).
>> 
>> This is a fair point.
>> 
>> John.
> 




More information about the llvm-commits mailing list