diff options
author | Dan Gohman <gohman@apple.com> | 2009-06-21 23:46:38 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-06-21 23:46:38 +0000 |
commit | 51f53b7f5a0e859ceef995c61667905166b96f1b (patch) | |
tree | d9190de286f8fd9ad559821d01fc525efee93146 /include | |
parent | 14ee48a5bae352780b767a14bd97e8e91800a95b (diff) | |
download | external_llvm-51f53b7f5a0e859ceef995c61667905166b96f1b.zip external_llvm-51f53b7f5a0e859ceef995c61667905166b96f1b.tar.gz external_llvm-51f53b7f5a0e859ceef995c61667905166b96f1b.tar.bz2 |
Fix ScalarEvolution's backedge-taken count computations to check for
overflow when computing a integer division to round up.
Thanks to Nick Lewycky for noticing this!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73862 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/ScalarEvolution.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h index 211c0ca..8578958 100644 --- a/include/llvm/Analysis/ScalarEvolution.h +++ b/include/llvm/Analysis/ScalarEvolution.h @@ -332,6 +332,13 @@ namespace llvm { const SCEVHandle &SymName, const SCEVHandle &NewVal); + /// getBECount - Subtract the end and start values and divide by the step, + /// rounding up, to get the number of times the backedge is executed. Return + /// CouldNotCompute if an intermediate computation overflows. + SCEVHandle getBECount(const SCEVHandle &Start, + const SCEVHandle &End, + const SCEVHandle &Step); + /// getBackedgeTakenInfo - Return the BackedgeTakenInfo for the given /// loop, lazily computing new values if the loop hasn't been analyzed /// yet. |