mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
Use ScalarEvolution's new GetMinSignBits and GetMinLeadingZeros
in the loop backedge-taken count computation of the maximum possible trip count. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73805 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cc40f077b0
commit
3964acc2f4
@ -3836,9 +3836,12 @@ HowManyLessThans(const SCEV *LHS, const SCEV *RHS,
|
||||
: getUMaxExpr(RHS, Start);
|
||||
|
||||
// Determine the maximum constant end value.
|
||||
SCEVHandle MaxEnd = isa<SCEVConstant>(End) ? End :
|
||||
getConstant(isSigned ? APInt::getSignedMaxValue(BitWidth) :
|
||||
APInt::getMaxValue(BitWidth));
|
||||
SCEVHandle MaxEnd =
|
||||
isa<SCEVConstant>(End) ? End :
|
||||
getConstant(isSigned ? APInt::getSignedMaxValue(BitWidth)
|
||||
.ashr(GetMinSignBits(End) - 1) :
|
||||
APInt::getMaxValue(BitWidth)
|
||||
.lshr(GetMinLeadingZeros(End)));
|
||||
|
||||
// Finally, we subtract these two values and divide, rounding up, to get
|
||||
// the number of times the backedge is executed.
|
||||
|
Loading…
Reference in New Issue
Block a user