mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-16 00:33:10 +00:00
PHINode::hasConstantValue(): return undef if the PHI is fully recursive.
Thanks Duncan for the idea git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159687 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
86b032b2ab
commit
0fd518beb3
@ -694,7 +694,7 @@ void llvm::ComputeMaskedBits(Value *V, APInt &KnownZero, APInt &KnownOne,
|
||||
// taking conservative care to avoid excessive recursion.
|
||||
if (Depth < MaxDepth - 1 && !KnownZero && !KnownOne) {
|
||||
// Skip if every incoming value references to ourself.
|
||||
if (P->hasConstantValue() == P)
|
||||
if (dyn_cast_or_null<UndefValue>(P->hasConstantValue()))
|
||||
break;
|
||||
|
||||
KnownZero = APInt::getAllOnesValue(BitWidth);
|
||||
|
@ -167,6 +167,8 @@ Value *PHINode::hasConstantValue() const {
|
||||
// The case where the first value is this PHI.
|
||||
ConstantValue = getIncomingValue(i);
|
||||
}
|
||||
if (ConstantValue == this)
|
||||
return UndefValue::get(getType());
|
||||
return ConstantValue;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user