mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-22 10:33:23 +00:00
Simplify this code, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47434 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3b71165b32
commit
39442afb36
@ -2600,11 +2600,8 @@ SCEVHandle ScalarEvolutionsImpl::HowFarToNonZero(SCEV *V, const Loop *L) {
|
|||||||
// If the value is a constant, check to see if it is known to be non-zero
|
// If the value is a constant, check to see if it is known to be non-zero
|
||||||
// already. If so, the backedge will execute zero times.
|
// already. If so, the backedge will execute zero times.
|
||||||
if (SCEVConstant *C = dyn_cast<SCEVConstant>(V)) {
|
if (SCEVConstant *C = dyn_cast<SCEVConstant>(V)) {
|
||||||
Constant *Zero = Constant::getNullValue(C->getValue()->getType());
|
if (!C->getValue()->isNullValue())
|
||||||
Constant *NonZero =
|
return SE.getIntegerSCEV(0, C->getType());
|
||||||
ConstantExpr::getICmp(ICmpInst::ICMP_NE, C->getValue(), Zero);
|
|
||||||
if (NonZero == ConstantInt::getTrue())
|
|
||||||
return getSCEV(Zero);
|
|
||||||
return UnknownValue; // Otherwise it will loop infinitely.
|
return UnknownValue; // Otherwise it will loop infinitely.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user