mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method trunc(), to be const and to return a new value instead of modifying the object in place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121120 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -3367,8 +3367,8 @@ const SCEV *ScalarEvolution::createSCEV(Value *V) {
|
||||
// If C is a single bit, it may be in the sign-bit position
|
||||
// before the zero-extend. In this case, represent the xor
|
||||
// using an add, which is equivalent, and re-apply the zext.
|
||||
APInt Trunc = APInt(CI->getValue()).trunc(Z0TySize);
|
||||
if (APInt(Trunc).zext(getTypeSizeInBits(UTy)) == CI->getValue() &&
|
||||
APInt Trunc = CI->getValue().trunc(Z0TySize);
|
||||
if (Trunc.zext(getTypeSizeInBits(UTy)) == CI->getValue() &&
|
||||
Trunc.isSignBit())
|
||||
return getZeroExtendExpr(getAddExpr(Z0, getConstant(Trunc)),
|
||||
UTy);
|
||||
|
Reference in New Issue
Block a user