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/Target/PowerPC/PPCCTRLoops.cpp | |
| parent | a89d178a4f15b73cc17fdd84c294946f1fa81072 (diff) | |
| download | bcm5719-llvm-2aacc0eccad6e0fee98ad28d9c885791926cf004.tar.gz bcm5719-llvm-2aacc0eccad6e0fee98ad28d9c885791926cf004.zip | |
[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/Target/PowerPC/PPCCTRLoops.cpp')
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCCTRLoops.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp b/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp index 65842357e4d..f6ecedf8b1a 100644 --- a/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp +++ b/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp @@ -546,7 +546,7 @@ bool PPCCTRLoops::convertToCTRLoop(Loop *L) { if (!ExitCount->getType()->isPointerTy() && ExitCount->getType() != CountType) ExitCount = SE->getZeroExtendExpr(ExitCount, CountType); - ExitCount = SE->getAddExpr(ExitCount, SE->getConstant(CountType, 1)); + ExitCount = SE->getAddExpr(ExitCount, SE->getOne(CountType)); Value *ECValue = SCEVE.expandCodeFor(ExitCount, CountType, Preheader->getTerminator()); |

