diff options
| author | Johannes Doerfert <jdoerfert@anl.gov> | 2019-08-23 15:45:46 +0000 | 
|---|---|---|
| committer | Johannes Doerfert <jdoerfert@anl.gov> | 2019-08-23 15:45:46 +0000 | 
| commit | 2f2d7c3addff2e03e0b051a663743bb751ddb5bd (patch) | |
| tree | ea40c250ca29c5164d7cdb53f52f7077bfb72c41 /llvm/lib/Transforms | |
| parent | deb9ea3a8c842f279cf9d7db695760acd55be660 (diff) | |
| download | bcm5719-llvm-2f2d7c3addff2e03e0b051a663743bb751ddb5bd.tar.gz bcm5719-llvm-2f2d7c3addff2e03e0b051a663743bb751ddb5bd.zip  | |
[Attributor][Fix] Deal with "growing" dereferenceability
Summary:
If we have a negative inbounds offset dereferenceabily "grows". However,
until we do not handle the overflow that can occur in the
dereferenceable bytes and the problem with loops, we simply do not grow
the state.
Reviewers: sstefan1, uenoku
Subscribers: hiraditya, bollu, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66557
llvm-svn: 369771
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/IPO/Attributor.cpp | 6 | 
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp index ea897d7e361..e518994f153 100644 --- a/llvm/lib/Transforms/IPO/Attributor.cpp +++ b/llvm/lib/Transforms/IPO/Attributor.cpp @@ -1985,6 +1985,12 @@ struct AADereferenceableFloating : AADereferenceableImpl {          T.GlobalState &= DS.GlobalState;        } +      // For now we do not try to "increase" dereferenceability due to negative +      // indices as we first have to come up with code to deal with loops and +      // for overflows of the dereferenceable bytes. +      if (Offset.getSExtValue() < 0) +        Offset = 0; +        T.takeAssumedDerefBytesMinimum(            std::max(int64_t(0), DerefBytes - Offset.getSExtValue()));  | 

