aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/ScalarEvolution.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-01-09 22:26:35 +0000
committerChris Lattner <sabre@nondot.org>2011-01-09 22:26:35 +0000
commit992efb03785f2a368fbb63b09373be1d6a96ce5a (patch)
tree14906ff0c13ed69b70d5155ea2a375da023e5205 /include/llvm/Analysis/ScalarEvolution.h
parent42e9c963921776cb498c33b6c6c03f29971316f3 (diff)
downloadexternal_llvm-992efb03785f2a368fbb63b09373be1d6a96ce5a.zip
external_llvm-992efb03785f2a368fbb63b09373be1d6a96ce5a.tar.gz
external_llvm-992efb03785f2a368fbb63b09373be1d6a96ce5a.tar.bz2
Step #2 to improve trip count analysis for loops like this:
void f(int* begin, int* end) { std::fill(begin, end, 0); } which turns into a != exit expression where one pointer is strided and (thanks to step #1) known to not overflow, and the other is loop invariant. The observation here is that, though the IV is strided by 4 in this case, that the IV *has* to become equal to the end value. It cannot "miss" the end value by stepping over it, because if it did, the strided IV expression would eventually wrap around. Handle this by turning A != B into "A-B != 0" where the A-B part is known to be NUW. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123131 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/ScalarEvolution.h')
-rw-r--r--include/llvm/Analysis/ScalarEvolution.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h
index d910406..4706c09 100644
--- a/include/llvm/Analysis/ScalarEvolution.h
+++ b/include/llvm/Analysis/ScalarEvolution.h
@@ -539,7 +539,8 @@ namespace llvm {
/// getMinusSCEV - Return LHS-RHS.
///
- const SCEV *getMinusSCEV(const SCEV *LHS, const SCEV *RHS);
+ const SCEV *getMinusSCEV(const SCEV *LHS, const SCEV *RHS,
+ bool HasNUW = false, bool HasNSW = false);
/// getTruncateOrZeroExtend - Return a SCEV corresponding to a conversion
/// of the input value to the specified type. If the type must be