This is an archive of the discontinued LLVM Phabricator instance.

In split module utility we should never separate alias with its aliasee.
ClosedPublic

Authored by slarin on Jan 26 2016, 8:13 AM.

Details

Summary

When splitting module with preserving locals, we currently do not handle case of global alias being separated with its aliasee.

Diff Detail

Repository
rL LLVM

Event Timeline

slarin updated this revision to Diff 45996.Jan 26 2016, 8:13 AM
slarin retitled this revision from to In split module utility we should never separate alias with its aliasee..
slarin updated this object.
slarin added a subscriber: llvm-commits.
slarin added a reviewer: pcc.Jan 26 2016, 8:14 AM
slarin added a subscriber: joker-eph-DISABLED.
slarin added a subscriber: tobiasvk.
mehdi_amini accepted this revision.Jan 26 2016, 8:21 AM
mehdi_amini added a reviewer: mehdi_amini.
mehdi_amini added a subscriber: mehdi_amini.

LGTM

This revision is now accepted and ready to land.Jan 26 2016, 8:21 AM

Thanks Mehdi. I will let some time for Peter to comment if he pleases...

Sergei

pcc added inline comments.Jan 26 2016, 11:49 AM
lib/Transforms/Utils/SplitModule.cpp
94 ↗(On Diff #45996)

An aliasee can be something other than a GlobalValue (for example, it could be a ConstantInt or a GEP ConstantExpr). I think what you want here is getBaseObject.

slarin updated this revision to Diff 46032.Jan 26 2016, 12:27 PM
slarin edited edge metadata.

Implement Peters comments.

pcc added inline comments.Jan 26 2016, 12:29 PM
lib/Transforms/Utils/SplitModule.cpp
95 ↗(On Diff #46032)

You no longer need this cast.

test/tools/llvm-split/scc-global-alias.ll
22 ↗(On Diff #46032)

Please add a test case with a non-GlobalValue constant.

slarin updated this revision to Diff 46052.Jan 26 2016, 2:06 PM

Make sure all kind of alisees are handled + test.

Peter,

Can this be landed now...?

Thanks.

Sergei


Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

pcc accepted this revision.Jan 27 2016, 2:04 PM
pcc edited edge metadata.

LGTM after dealing with comment.

test/tools/llvm-split/scc-const-alias.ll
24 ↗(On Diff #46052)

This isn't quite what I meant. I meant e.g.

@g1Alias = internal alias i8, bitcast (i32* @g1 to i8*)
@constAlias = internal alias i8, inttoptr (i64 42 to i8*)
slarin updated this revision to Diff 46296.Jan 28 2016, 10:58 AM
slarin edited edge metadata.

Updated test.

This revision was automatically updated to reflect the committed changes.