diff options
author | Hal Finkel <hfinkel@anl.gov> | 2014-10-06 14:42:56 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2014-10-06 14:42:56 +0000 |
commit | 8eae3ad2ff2474fc1cd91f9dbdacd4a8a0742b90 (patch) | |
tree | 83c17f41abb0d106f881f77eb229fbb85523793c /llvm/lib/Analysis | |
parent | c8514a342108d8dda0481d0239b8e347eecaea35 (diff) | |
download | bcm5719-llvm-8eae3ad2ff2474fc1cd91f9dbdacd4a8a0742b90.tar.gz bcm5719-llvm-8eae3ad2ff2474fc1cd91f9dbdacd4a8a0742b90.zip |
[CFL-AA] Update for handling of globals and more tests
We used to return PartialAlias if *either* variable being queried interacted
with arguments or globals. AFAICT, we can change this to only returning
MayAlias iff *both* variables being queried interacted with arguments or
globals.
Also, adding some basic functionality tests: some basic IPA tests, checking
that we give conservative responses with arguments/globals thrown in the mix,
and ensuring that we trace values through stores and loads.
Note that saying that 'x' interacted with arguments or globals means that the
Attributes of the StratifiedSet that 'x' belongs to has any bits set.
Patch by George Burgess IV, thanks!
llvm-svn: 219122
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/CFLAliasAnalysis.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/CFLAliasAnalysis.cpp b/llvm/lib/Analysis/CFLAliasAnalysis.cpp index db94f2868c4..0386afeb23a 100644 --- a/llvm/lib/Analysis/CFLAliasAnalysis.cpp +++ b/llvm/lib/Analysis/CFLAliasAnalysis.cpp @@ -986,9 +986,17 @@ CFLAliasAnalysis::query(const AliasAnalysis::Location &LocA, auto AttrsA = Sets.getLink(SetA.Index).Attrs; auto AttrsB = Sets.getLink(SetB.Index).Attrs; - auto CombinedAttrs = AttrsA | AttrsB; - if (CombinedAttrs.any()) - return AliasAnalysis::PartialAlias; + // Stratified set attributes are used as markets to signify whether a member + // of a StratifiedSet (or a member of a set above the current set) has + // interacted with either arguments or globals. "Interacted with" meaning + // its value may be different depending on the value of an argument or + // global. The thought behind this is that, because arguments and globals + // may alias each other, if AttrsA and AttrsB have touched args/globals, + // we must conservatively say that they alias. However, if at least one of + // the sets has no values that could legally be altered by changing the value + // of an argument or global, then we don't have to be as conservative. + if (AttrsA.any() && AttrsB.any()) + return AliasAnalysis::MayAlias; return AliasAnalysis::NoAlias; } |