Page MenuHomePhabricator

Preserve the lexical order of global variables during llvm-link merge
Needs ReviewPublic

Authored by jinlin on Wed, Jan 6, 4:12 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

The order of global variables is generated in the order of recursively materializing variables if the global variable has the attribute of hasLocalLinkage or hasLinkOnceLinkage during the module merging. In practice, it is often the exact reverse of source order. This new order may cause performance regression.

The change is to preserve the original lexical order of the global variables in the above case.

Diff Detail

Event Timeline

jinlin created this revision.Wed, Jan 6, 4:12 PM
jinlin requested review of this revision.Wed, Jan 6, 4:12 PM
jinlin updated this revision to Diff 316570.Wed, Jan 13, 10:38 PM
jinlin updated this revision to Diff 316672.Thu, Jan 14, 8:40 AM
hiraditya added inline comments.Sat, Jan 16, 10:01 AM
llvm/lib/Linker/IRMover.cpp
1477

Can we move this inside the condition below?

1508

use erase