[LLVMdev] merging globals

Eli Friedman eli.friedman at gmail.com
Mon Oct 20 09:25:32 PDT 2008

On Mon, Oct 20, 2008 at 12:38 AM, Matthijs Kooijman <matthijs at stdin.nl> wrote:
> Hi Chris,
>> > Wouldn't it be slightly cleaner to mark the distinct objects in the
>> > LLVM intermediate representation?
>> That is what I'm suggesting.  Each llvm IR global variable would have
>> its own flag.
> I think the suggestion is to have a "notmergable" flag instead of a
> "mergeable" flag. In practice, it doesn't really matter, but I guess you'll
> see the difference in the IR. I agree here that it would be more logical to
> have a notmergable (or "distinct" ?) flag, instead of a mergeable flag, though
> it's not quite critical.

I'm pretty sure we want mergeable to be opt-in.  If it defaults to
being allowed, unaware frontends (like the current llvm-gcc and clang)
will introduce logical contradictions by assuming that globals aren't
mergeable, and optimization passes that mark globals const will have
to make sure to mark them unmergeable.


More information about the llvm-dev mailing list