diff options
author | Duncan Sands <baldrick@free.fr> | 2009-02-01 18:06:53 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2009-02-01 18:06:53 +0000 |
commit | 3ed768868db9f0023f2e4b07e2ccb285d2f821be (patch) | |
tree | 35160c84ac06e815ed7747a33ea7a4d6750019a0 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | a6c75ffd73a72fb9d5e9a5e5ec9344a7d96cdfd3 (diff) | |
download | bcm5719-llvm-3ed768868db9f0023f2e4b07e2ccb285d2f821be.tar.gz bcm5719-llvm-3ed768868db9f0023f2e4b07e2ccb285d2f821be.zip |
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.
llvm-svn: 63494
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 1b0d61ca0a7..d8f895dac2f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -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; |