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:
Duncan Sands
2009-02-01 18:06:53 +00:00
parent fc4b677cd5
commit b0d5cdd52e
7 changed files with 57 additions and 42 deletions

View File

@@ -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;