forked from OSchip/llvm-project
[SelectionDAG] Use APInt::zextOrSelf instead of zextOrTrunc in ComputePHILiveOutRegInfo
The width never decreases here.
This commit is contained in:
parent
95871187bf
commit
306ff74154
|
@ -459,7 +459,7 @@ void FunctionLoweringInfo::ComputePHILiveOutRegInfo(const PHINode *PN) {
|
|||
}
|
||||
|
||||
if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
|
||||
APInt Val = CI->getValue().zextOrTrunc(BitWidth);
|
||||
APInt Val = CI->getValue().zextOrSelf(BitWidth);
|
||||
DestLOI.NumSignBits = Val.getNumSignBits();
|
||||
DestLOI.Known = KnownBits::makeConstant(Val);
|
||||
} else {
|
||||
|
@ -491,7 +491,7 @@ void FunctionLoweringInfo::ComputePHILiveOutRegInfo(const PHINode *PN) {
|
|||
}
|
||||
|
||||
if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
|
||||
APInt Val = CI->getValue().zextOrTrunc(BitWidth);
|
||||
APInt Val = CI->getValue().zextOrSelf(BitWidth);
|
||||
DestLOI.NumSignBits = std::min(DestLOI.NumSignBits, Val.getNumSignBits());
|
||||
DestLOI.Known.Zero &= ~Val;
|
||||
DestLOI.Known.One &= Val;
|
||||
|
|
Loading…
Reference in New Issue