summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorMax Kazantsev <max.kazantsev@azul.com>2017-10-30 09:35:16 +0000
committerMax Kazantsev <max.kazantsev@azul.com>2017-10-30 09:35:16 +0000
commit390fc5777165656acac5bf8ffbb2ea2dec2ca00b (patch)
tree35a0257e7c6c6c177947b487a229142972560259 /llvm/lib/Transforms
parentd18443edad5f0578c2f8fce09721e1016aeb079b (diff)
downloadbcm5719-llvm-390fc5777165656acac5bf8ffbb2ea2dec2ca00b.tar.gz
bcm5719-llvm-390fc5777165656acac5bf8ffbb2ea2dec2ca00b.zip
[IRCE][NFC] Store Length as SCEV in RangeCheck instead of Value
llvm-svn: 316889
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp b/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
index 42c74c3a3cc..d9c1b2ba57b 100644
--- a/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
@@ -151,7 +151,7 @@ class InductiveRangeCheck {
const SCEV *Offset = nullptr;
const SCEV *Scale = nullptr;
- Value *Length = nullptr;
+ const SCEV *Length = nullptr;
Use *CheckUse = nullptr;
RangeCheckKind Kind = RANGE_CHECK_UNKNOWN;
bool IsSigned = true;
@@ -168,7 +168,7 @@ class InductiveRangeCheck {
public:
const SCEV *getOffset() const { return Offset; }
const SCEV *getScale() const { return Scale; }
- Value *getLength() const { return Length; }
+ const SCEV *getLength() const { return Length; }
bool isSigned() const { return IsSigned; }
void print(raw_ostream &OS) const {
@@ -419,7 +419,7 @@ void InductiveRangeCheck::extractRangeChecksFromCond(
return;
InductiveRangeCheck IRC;
- IRC.Length = Length;
+ IRC.Length = Length ? SE.getSCEV(Length) : nullptr;
IRC.Offset = IndexAddRec->getStart();
IRC.Scale = IndexAddRec->getStepRecurrence(SE);
IRC.CheckUse = &ConditionUse;
@@ -1660,9 +1660,9 @@ InductiveRangeCheck::computeSafeIterationSpace(
// We strengthen "0 <= I" to "0 <= I < INT_SMAX" and "I < L" to "0 <= I < L".
// We can potentially do much better here.
- if (Value *V = getLength()) {
- UpperLimit = SE.getSCEV(V);
- } else {
+ if (const SCEV *L = getLength())
+ UpperLimit = L;
+ else {
assert(Kind == InductiveRangeCheck::RANGE_CHECK_LOWER && "invariant!");
unsigned BitWidth = cast<IntegerType>(IndVar->getType())->getBitWidth();
UpperLimit = SE.getConstant(APInt::getSignedMaxValue(BitWidth));
OpenPOWER on IntegriCloud