[PATCH] Don't upgrade global constructors when reading bitcode
Duncan P. N. Exon Smith
dexonsmith at apple.com
Mon Aug 11 18:18:21 PDT 2014
> On 2014-Aug-11, at 16:50, Reid Kleckner <rnk at google.com> wrote:
>
>> IMO, writing to bitcode and reading back shouldn't change the IR.
>>
>> The motivating problem I'm solving is serializing use-list order to
>> bitcode (PR5680).
>
> The global_ctors auto-upgrade path is only one of many changes we make to IR when deserializing it, though, so by this argument we shouldn't do any auto-upgrade at all.
On the contrary, this as different from other auto-upgrades. This code
is taking new IR and transforming it through bitcode serialization. IMO,
"upgrade" is actually a misnomer here. This is canonicalization, and
causes unnecessary differences in the IR depending on whether it's
serialized to bitcode or not.
As far as I can tell, all the other auto-upgrades are taking old IR and
upgrading it to new IR -- which is a different sort of thing.
More information about the llvm-commits
mailing list