[llvm] ec43def - Style tweaks for SCEV's computeMaxBECountForLT [NFC]
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 23 17:19:54 PDT 2021
Author: Philip Reames
Date: 2021-07-23T17:19:45-07:00
New Revision: ec43def7003db38640597b94fee38f6bc53379f9
URL: https://github.com/llvm/llvm-project/commit/ec43def7003db38640597b94fee38f6bc53379f9
DIFF: https://github.com/llvm/llvm-project/commit/ec43def7003db38640597b94fee38f6bc53379f9.diff
LOG: Style tweaks for SCEV's computeMaxBECountForLT [NFC]
Added:
Modified:
llvm/lib/Analysis/ScalarEvolution.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index b69350082124..3a1182ca01e0 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -11536,18 +11536,17 @@ const SCEV *ScalarEvolution::computeMaxBECountForLT(const SCEV *Start,
// Calculate the maximum backedge count based on the range of values
// permitted by Start, End, and Stride.
- const SCEV *MaxBECount;
APInt MinStart =
IsSigned ? getSignedRangeMin(Start) : getUnsignedRangeMin(Start);
- APInt StrideForMaxBECount =
+ APInt MinStride =
IsSigned ? getSignedRangeMin(Stride) : getUnsignedRangeMin(Stride);
// We assume either the stride is positive, or the backedge-taken count
// is zero. So force StrideForMaxBECount to be at least one.
APInt One(BitWidth, 1);
- StrideForMaxBECount = IsSigned ? APIntOps::smax(One, StrideForMaxBECount)
- : APIntOps::umax(One, StrideForMaxBECount);
+ APInt StrideForMaxBECount = IsSigned ? APIntOps::smax(One, MinStride)
+ : APIntOps::umax(One, MinStride);
APInt MaxValue = IsSigned ? APInt::getSignedMaxValue(BitWidth)
: APInt::getMaxValue(BitWidth);
@@ -11564,10 +11563,8 @@ const SCEV *ScalarEvolution::computeMaxBECountForLT(const SCEV *Start,
MaxEnd = IsSigned ? APIntOps::smax(MaxEnd, MinStart)
: APIntOps::umax(MaxEnd, MinStart);
- MaxBECount = getUDivCeilSCEV(getConstant(MaxEnd - MinStart) /* Delta */,
- getConstant(StrideForMaxBECount) /* Step */);
-
- return MaxBECount;
+ return getUDivCeilSCEV(getConstant(MaxEnd - MinStart) /* Delta */,
+ getConstant(StrideForMaxBECount) /* Step */);
}
ScalarEvolution::ExitLimit
More information about the llvm-commits
mailing list