diff options
author | George Burgess IV <george.burgess.iv@gmail.com> | 2018-10-09 02:14:33 +0000 |
---|---|---|
committer | George Burgess IV <george.burgess.iv@gmail.com> | 2018-10-09 02:14:33 +0000 |
commit | fefc42c9bbf44e755f213f494f263a52cbe12913 (patch) | |
tree | bdcd73245e412b92be8debb52f98a6c50fe82e19 /llvm/lib/Analysis/CFLAndersAliasAnalysis.cpp | |
parent | 40a64c4c08d3c1f4c2cdca657d691c97bf09e580 (diff) | |
download | bcm5719-llvm-fefc42c9bbf44e755f213f494f263a52cbe12913.tar.gz bcm5719-llvm-fefc42c9bbf44e755f213f494f263a52cbe12913.zip |
Use locals instead of struct fields; NFC
This is one of a series of changes intended to make
https://reviews.llvm.org/D44748 more easily reviewable. Please see that
patch for more context.
Since I was requested to do all of this with post-commit review, this is
about as small as I can make it (beyond committing changes to these few
files separately, but they're incredibly similar in spirit, so...)
On its own, this change doesn't make a great deal of sense. I plan on
having a follow-up Real Soon Now(TM) to make the bits here make more
sense. :)
In particular, the next change in this series is meant to make
LocationSize an actual type, which you have to call .getValue() on in
order to get at the uint64_t inside. Hence, this change refactors code
so that:
- we only need to call the soon-to-come getValue() once in most cases,
and
- said call to getValue() happens very closely to a piece of code that
checks if the LocationSize has a value (e.g. if it's != UnknownSize).
llvm-svn: 344012
Diffstat (limited to 'llvm/lib/Analysis/CFLAndersAliasAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/CFLAndersAliasAnalysis.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/CFLAndersAliasAnalysis.cpp b/llvm/lib/Analysis/CFLAndersAliasAnalysis.cpp index 18ea37fd7a8..db350e2c22f 100644 --- a/llvm/lib/Analysis/CFLAndersAliasAnalysis.cpp +++ b/llvm/lib/Analysis/CFLAndersAliasAnalysis.cpp @@ -515,10 +515,9 @@ CFLAndersAAResult::FunctionInfo::getAttrs(const Value *V) const { return None; } -bool CFLAndersAAResult::FunctionInfo::mayAlias(const Value *LHS, - LocationSize LHSSize, - const Value *RHS, - LocationSize RHSSize) const { +bool CFLAndersAAResult::FunctionInfo::mayAlias( + const Value *LHS, LocationSize MaybeLHSSize, const Value *RHS, + LocationSize MaybeRHSSize) const { assert(LHS && RHS); // Check if we've seen LHS and RHS before. Sometimes LHS or RHS can be created @@ -558,10 +557,13 @@ bool CFLAndersAAResult::FunctionInfo::mayAlias(const Value *LHS, if (RangePair.first != RangePair.second) { // Be conservative about UnknownSize - if (LHSSize == MemoryLocation::UnknownSize || - RHSSize == MemoryLocation::UnknownSize) + if (MaybeLHSSize == MemoryLocation::UnknownSize || + MaybeRHSSize == MemoryLocation::UnknownSize) return true; + const uint64_t LHSSize = MaybeLHSSize; + const uint64_t RHSSize = MaybeRHSSize; + for (const auto &OVal : make_range(RangePair)) { // Be conservative about UnknownOffset if (OVal.Offset == UnknownOffset) |