mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-24 07:35:04 +00:00
Fix problems in the CBE and InstructionCombining which use the isMaxValue
and isMinValue methods of ConstantInt. These have been broken since the isSigned parameter was added. It is necessary to use the signed version of the type in the call to isValueValidForType or else incorrect results are returned. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32637 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5c7e326585
commit
691458697c
@ -205,7 +205,7 @@ public:
|
||||
int64_t V = getSExtValue();
|
||||
if (V < 0) return false; // Be careful about wrap-around on 'long's
|
||||
++V;
|
||||
return !isValueValidForType(getType(), V) || V < 0;
|
||||
return !isValueValidForType(getType()->getSignedVersion(), V) || V < 0;
|
||||
}
|
||||
return isAllOnesValue();
|
||||
}
|
||||
@ -219,7 +219,7 @@ public:
|
||||
int64_t V = getSExtValue();
|
||||
if (V > 0) return false; // Be careful about wrap-around on 'long's
|
||||
--V;
|
||||
return !isValueValidForType(getType(), V) || V > 0;
|
||||
return !isValueValidForType(getType()->getSignedVersion(), V) || V > 0;
|
||||
}
|
||||
return getZExtValue() == 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user