diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-09-23 01:59:04 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-09-23 01:59:04 +0000 |
commit | 2aacc0eccad6e0fee98ad28d9c885791926cf004 (patch) | |
tree | 22f89f23ae978ecfdb553c424287103c5f2eda18 /llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | |
parent | a89d178a4f15b73cc17fdd84c294946f1fa81072 (diff) | |
download | llvm-2aacc0eccad6e0fee98ad28d9c885791926cf004.zip llvm-2aacc0eccad6e0fee98ad28d9c885791926cf004.tar.gz llvm-2aacc0eccad6e0fee98ad28d9c885791926cf004.tar.bz2 |
[SCEV] Introduce ScalarEvolution::getOne and getZero.
Summary:
It is fairly common to call SE->getConstant(Ty, 0) or
SE->getConstant(Ty, 1); this change makes such uses a little bit
briefer.
I've refactored the call sites I could find easily to use getZero /
getOne.
Reviewers: hfinkel, majnemer, reames
Subscribers: sanjoy, llvm-commits
Differential Revision: http://reviews.llvm.org/D12947
llvm-svn: 248362
Diffstat (limited to 'llvm/lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index 54b6694..2f295fe 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -1796,7 +1796,7 @@ LinearFunctionTestReplace(Loop *L, // This addition may overflow, which is valid as long as the comparison is // truncated to BackedgeTakenCount->getType(). IVCount = SE->getAddExpr(BackedgeTakenCount, - SE->getConstant(BackedgeTakenCount->getType(), 1)); + SE->getOne(BackedgeTakenCount->getType())); // The BackedgeTaken expression contains the number of times that the // backedge branches to the loop header. This is one less than the // number of times the loop executes, so use the incremented indvar. |