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/AlignmentFromAssumptions.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/Transforms/Scalar/AlignmentFromAssumptions.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp b/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp index 3c2c0cbc3d2..a13e552cbd0 100644 --- a/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp +++ b/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp @@ -270,7 +270,7 @@ bool AlignmentFromAssumptions::extractAlignmentInfo(CallInst *I, OffSCEV = nullptr; if (PtrToIntInst *PToI = dyn_cast<PtrToIntInst>(AndLHS)) { AAPtr = PToI->getPointerOperand(); - OffSCEV = SE->getConstant(Int64Ty, 0); + OffSCEV = SE->getZero(Int64Ty); } else if (const SCEVAddExpr* AndLHSAddSCEV = dyn_cast<SCEVAddExpr>(AndLHSSCEV)) { // Try to find the ptrtoint; subtract it and the rest is the offset. |