This is an archive of the discontinued LLVM Phabricator instance.

ThinLTO: Preserve alias-to-alias information (PR37884)
AbandonedPublic

Authored by vlad.tsyrklevich on Jun 22 2018, 2:10 PM.

Details

Summary

Change the BitcodeWriter/ModuleSummaryAnalysis to save the target of an
alias as the aliasee it points to, instead of the base object the alias
points to, e.g. without recursively dereferencing aliases until a
GlobalObject is reached. This is necessary for interprocedural analyses
that want to conservatively avoid evaluating call paths including
dso_preemptable symbols such as dso_local alias -> dso_preemptable alias
-> dso_local function.

Value::stripInBoundsOffsetsNoFollowAliases() is required to match the
logic of GlobalAlias::getBaseObject() without 'dereferencing' aliases,
its implementation matches that of stripPointerCastsNoFollowAliases().
The current stripInBoundsOffsets*() methods did not document that they
also strip aliases.

Diff Detail

Event Timeline

pcc requested changes to this revision.Jun 22 2018, 2:19 PM

I think we should be going in the other direction and removing alias summaries from the summary index altogether.

Note that in your example it would be valid to consider AliasToAlias to point to func. This is because creating an alias to a dso_preemptable global does not cause the alias to become preemptible: an alias is just another name for the (section, offset) pair represented by the global that it refers to.

This revision now requires changes to proceed.Jun 22 2018, 2:19 PM
vlad.tsyrklevich abandoned this revision.Jun 22 2018, 2:48 PM

You're right, I misunderstood how aliases were represented.