mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-17 00:57:54 +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. llvm-svn: 32637
This commit is contained in:
parent
7f6a73eb5c
commit
be18cd1575
@ -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