aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-02-01 18:06:53 +0000
committerDuncan Sands <baldrick@free.fr>2009-02-01 18:06:53 +0000
commitb0d5cdd52e8448f769cd71aaee6a4b8592dc08b1 (patch)
tree7a0189db8f4dd16bcf86da71718afa2515dd3e19 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parentfc4b677cd526f1f6a3d6487782557af99fbf6c32 (diff)
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
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 1b0d61ca0a..d8f895dac2 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/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;