[PATCH] D31443: [LTO] Do not reorder global variables unnecessarily during merging

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 3 14:39:51 PDT 2017


On 3 April 2017 at 17:17, Tobias Edler von Koch <tobias at codeaurora.org> wrote:
> On 04/03/2017 03:51 PM, Rafael EspĂ­ndola wrote:
>>
>> We don't need a "good reason" and the order in the IR is not "source
>> order".
>
>
> Please suggest a wording you are comfortable with.

This can change at any time, for any reason or no reason whatsoever.
If you are depending on this order your code has a bug and should be
fixed.

>
> What do you mean by "IR is not in source order"? Clang emits global
> variables in source code order. Optimizations may change this (which is what
> I mean by 'good reason'). Am I missing something?

Yes, the fact that it is not defined. The lang ref says nothing about
the semantic value of the order. The order clang produces these and
the order llvm prints them out can change at any point.

Cheers,
Rafael


More information about the llvm-commits mailing list