diff options
author | George Burgess IV <george.burgess.iv@gmail.com> | 2018-10-10 06:39:40 +0000 |
---|---|---|
committer | George Burgess IV <george.burgess.iv@gmail.com> | 2018-10-10 06:39:40 +0000 |
commit | 40dc63e1f0928ee31ae30390e6b03a6c79dc178c (patch) | |
tree | cfd9bf6353bc9a761f5d25e3213a0a1e87bb641d /llvm/lib/Transforms | |
parent | 1d893bfcea1b7149b1f55b103f7654e68e91d6b6 (diff) | |
download | bcm5719-llvm-40dc63e1f0928ee31ae30390e6b03a6c79dc178c.tar.gz bcm5719-llvm-40dc63e1f0928ee31ae30390e6b03a6c79dc178c.zip |
[Analysis] Make LocationSizes carry an 'imprecise' bit
There are places where we need to merge multiple LocationSizes of
different sizes into one, and get a sensible result.
There are other places where we want to optimize aggressively based on
the value of a LocationSizes (e.g. how can a store of four bytes be to
an area of storage that's only two bytes large?)
This patch makes LocationSize hold an 'imprecise' bit to note whether
the LocationSize can be treated as an upper-bound and lower-bound for
the size of a location, or just an upper-bound.
This concludes the series of patches leading up to this. The most recent
of which is r344108.
Fixes PR36228.
Differential Revision: https://reviews.llvm.org/D44748
llvm-svn: 344114
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index 810c2fee0e0..545b0060c13 100644 --- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -349,9 +349,9 @@ static OverwriteResult isOverwrite(const MemoryLocation &Later, InstOverlapIntervalsTy &IOL, AliasAnalysis &AA, const Function *F) { - // If we don't know the sizes of either access, then we can't do a comparison. - if (Later.Size == MemoryLocation::UnknownSize || - Earlier.Size == MemoryLocation::UnknownSize) + // FIXME: Vet that this works for size upper-bounds. Seems unlikely that we'll + // get imprecise values here, though (except for unknown sizes). + if (!Later.Size.isPrecise() || !Earlier.Size.isPrecise()) return OW_Unknown; const uint64_t LaterSize = Later.Size.getValue(); |