This is an archive of the discontinued LLVM Phabricator instance.

[GlobalMerge] Exit early if only one global is to be merged
ClosedPublic

Authored by haicheng on May 9 2018, 8:10 AM.

Details

Summary

I think this can save some compilation time and prevent some unnecessary changes.

Two test cases are changed. In AArch64/global-merge-3.ll, y is not merged with any other globals, but is changed to @_MergedGlobals.1 (or __MergedGlobals_y in the case of ios). In ARM/global-merge.ll, g3 is not merged with other globals, but is changed to _MergedGlobals.1.

Diff Detail

Repository
rL LLVM

Event Timeline

haicheng created this revision.May 9 2018, 8:10 AM
dmgreen added a subscriber: dmgreen.
dmgreen added inline comments.
lib/CodeGen/GlobalMerge.cpp
473 ↗(On Diff #145916)

Can you add a comment for this.

haicheng updated this revision to Diff 146186.May 10 2018, 12:20 PM
haicheng marked an inline comment as done.

Add the requested comment. Thank you for reviewing this.

Looks sensible to me.

test/CodeGen/ARM/global-merge.ll
63 ↗(On Diff #146186)

Could you keep the original layout of the test (i.e., g1, g2, ..., in this order)

haicheng updated this revision to Diff 146451.May 11 2018, 6:37 PM
haicheng marked an inline comment as done.

Fix the test case. Thank you, Quentin.

qcolombet added inline comments.May 15 2018, 4:21 PM
test/CodeGen/ARM/global-merge.ll
63 ↗(On Diff #146186)

What I meant here is don’t touch the input test, just modify the check lines.

haicheng updated this revision to Diff 146976.May 15 2018, 6:12 PM
haicheng marked an inline comment as done.

Change the test case. Thank you.

qcolombet accepted this revision.May 18 2018, 2:38 PM
This revision is now accepted and ready to land.May 18 2018, 2:38 PM
This revision was automatically updated to reflect the committed changes.