This is an archive of the discontinued LLVM Phabricator instance.

[GlobalMerge] Allow targets to enable merging of extern variables, NFC.
ClosedPublic

Authored by john.brawn on Jul 6 2015, 9:38 AM.

Details

Summary

Adjust the GlobalMergeOnExternal option so that the default behaviour is to do whatever the Target thinks is best. Explicitly enabled or disabling the option will override this default.

Diff Detail

Repository
rL LLVM

Event Timeline

john.brawn updated this revision to Diff 29099.Jul 6 2015, 9:38 AM
john.brawn retitled this revision from to [GlobalMerge] Allow targets to enable merging of extern variables, NFC..
john.brawn updated this object.
john.brawn added reviewers: ab, echristo.
john.brawn set the repository for this revision to rL LLVM.
john.brawn added a subscriber: llvm-commits.
ab accepted this revision.Jul 6 2015, 12:11 PM
ab edited edge metadata.

A couple nits, but this sounds reasonable. Obviously, please wait for D10966 to be approved.

lib/CodeGen/GlobalMerge.cpp
133 ↗(On Diff #29099)

"GlobalMerge" isn't a verb yet ;) How about "[Should]MergeExternalGlobals" or something similar?

610–614 ↗(On Diff #29099)

How about:

bool MergeExternal = MergeExternalByDefault
if (EnableGlobalMergeOnExternal != cl::BOU_UNSET)
  MergeExternal = (EnableGlobalMergeOnExternal == cl::BOU_TRUE);

(or the even terser ternary version).

This revision is now accepted and ready to land.Jul 6 2015, 12:11 PM
This revision was automatically updated to reflect the committed changes.