mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Fix PR3453 and probably a bunch of other potential
crashes or wrong code with codegen of large integers: eliminate the legacy getIntegerVTBitMask and getIntegerVTSignBit methods, which returned their value as a uint64_t, so couldn't handle huge types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63494 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -845,12 +845,13 @@ SDValue SelectionDAG::getNOT(DebugLoc DL, SDValue Val, MVT VT) {
|
||||
SDValue NegOne;
|
||||
if (VT.isVector()) {
|
||||
MVT EltVT = VT.getVectorElementType();
|
||||
SDValue NegOneElt = getConstant(EltVT.getIntegerVTBitMask(), EltVT);
|
||||
SDValue NegOneElt =
|
||||
getConstant(APInt::getAllOnesValue(EltVT.getSizeInBits()), EltVT);
|
||||
std::vector<SDValue> NegOnes(VT.getVectorNumElements(), NegOneElt);
|
||||
NegOne = getNode(ISD::BUILD_VECTOR, DebugLoc::getUnknownLoc(), VT,
|
||||
&NegOnes[0], NegOnes.size());
|
||||
} else {
|
||||
NegOne = getConstant(VT.getIntegerVTBitMask(), VT);
|
||||
NegOne = getConstant(APInt::getAllOnesValue(VT.getSizeInBits()), VT);
|
||||
}
|
||||
|
||||
return getNode(ISD::XOR, DL, VT, Val, NegOne);
|
||||
@@ -2772,7 +2773,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, MVT VT,
|
||||
return N1;
|
||||
case ISD::OR:
|
||||
if (!VT.isVector())
|
||||
return getConstant(VT.getIntegerVTBitMask(), VT);
|
||||
return getConstant(APInt::getAllOnesValue(VT.getSizeInBits()), VT);
|
||||
// For vectors, we can't easily build an all one vector, just return
|
||||
// the LHS.
|
||||
return N1;
|
||||
|
Reference in New Issue
Block a user