diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp index a8381a7ce3fd..771e09d9c3a2 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -459,7 +459,7 @@ void FunctionLoweringInfo::ComputePHILiveOutRegInfo(const PHINode *PN) { } if (ConstantInt *CI = dyn_cast(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(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;