mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-13 06:29:59 +00:00
Set isSigned to true when creating an all-ones integer constant, even
for unsigned purposes, so >64-bit integer values get a full all-ones value. llvm-svn: 102739
This commit is contained in:
parent
3c454a3df0
commit
116829ede7
@ -3948,22 +3948,22 @@ ScalarEvolution::ComputeBackedgeTakenCountFromExitCondICmp(const Loop *L,
|
||||
break;
|
||||
case ICmpInst::ICMP_ULE:
|
||||
if (!getUnsignedRange(RHS).getUnsignedMax().isMaxValue()) {
|
||||
RHS = getAddExpr(getConstant(RHS->getType(), 1, false), RHS,
|
||||
RHS = getAddExpr(getConstant(RHS->getType(), 1, true), RHS,
|
||||
/*HasNUW=*/true, /*HasNSW=*/false);
|
||||
Cond = ICmpInst::ICMP_ULT;
|
||||
} else if (!getUnsignedRange(LHS).getUnsignedMin().isMinValue()) {
|
||||
LHS = getAddExpr(getConstant(RHS->getType(), (uint64_t)-1, false), LHS,
|
||||
LHS = getAddExpr(getConstant(RHS->getType(), (uint64_t)-1, true), LHS,
|
||||
/*HasNUW=*/true, /*HasNSW=*/false);
|
||||
Cond = ICmpInst::ICMP_ULT;
|
||||
}
|
||||
break;
|
||||
case ICmpInst::ICMP_UGE:
|
||||
if (!getUnsignedRange(RHS).getUnsignedMin().isMinValue()) {
|
||||
RHS = getAddExpr(getConstant(RHS->getType(), (uint64_t)-1, false), RHS,
|
||||
RHS = getAddExpr(getConstant(RHS->getType(), (uint64_t)-1, true), RHS,
|
||||
/*HasNUW=*/true, /*HasNSW=*/false);
|
||||
Cond = ICmpInst::ICMP_UGT;
|
||||
} else if (!getUnsignedRange(LHS).getUnsignedMax().isMaxValue()) {
|
||||
LHS = getAddExpr(getConstant(RHS->getType(), 1, false), LHS,
|
||||
LHS = getAddExpr(getConstant(RHS->getType(), 1, true), LHS,
|
||||
/*HasNUW=*/true, /*HasNSW=*/false);
|
||||
Cond = ICmpInst::ICMP_UGT;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user