Commits

Manman Ren committed 0351a2aa85b
[Global Opt] update SILGlobalOpt to use static initializer if possible. Update SILGlobalOpt to remove "once" call from addressor and set the InitializerF for SILGlboalVariable if legal. For calls to addressor in non-cold block, we check the addressor to find out the globalinit_func and the associated SILGlobalVariable. If legal, we set InitializerF of SILGlobalVariable and remove "once" call from addressor. The current rules for legality: 1> the addressor contains a single "once" call 2> it calls globalinit_func 3> the globalinit_func is called by "once" from a single location 4> the globalinit_func is trivial Update IRGen to emit llvm.global_ctors for global variables with static initializers (i.e non-null InitializerF). Performance -------- After: Totals,54,67202,67202,67202,0,0 Onone Totals,54,88948,88948,88948,0,0 O Totals,54,71222,71222,71222,0,0 Ounchecked Totals,54,66405,66405,66405,0,0 Onone Totals,54,88759,88759,88759,0,0 O Totals,54,71761,71761,71761,0,0 Ounchecked Before: Totals,55,68133,68133,68133,0,0 Onone Totals,55,92458,92458,92458,0,0 O Totals,55,72262,72262,72262,0,0 Ounchecked Totals,55,69022,69022,69022,0,0 Onone Totals,55,92178,92178,92178,0,0 O Totals,55,72593,72593,72593,0,0 Ounchecked Swift SVN r21996