diff options
| author | Scott Michel <scottm@aero.org> | 2009-02-25 03:12:50 +0000 |
|---|---|---|
| committer | Scott Michel <scottm@aero.org> | 2009-02-25 03:12:50 +0000 |
| commit | bb878288cb199f862d0ada1d4fa58888c4332456 (patch) | |
| tree | fedb6ac20c20b5fa6fa73e6a16292667569cee2f /llvm/lib/CodeGen | |
| parent | dce7846c24d17a4836acdf87eeaf58da00cea23b (diff) | |
| download | bcm5719-llvm-bb878288cb199f862d0ada1d4fa58888c4332456.tar.gz bcm5719-llvm-bb878288cb199f862d0ada1d4fa58888c4332456.zip | |
Remove all "cached" data from BuildVectorSDNode, preferring to retrieve
results via reference parameters.
This patch also appears to fix Evan's reported problem supplied as a
reduced bugpoint test case.
llvm-svn: 65426
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 358c9703a80..12534308adb 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -4856,27 +4856,25 @@ MemSDNode::MemSDNode(unsigned Opc, DebugLoc dl, SDVTList VTs, BuildVectorSDNode::BuildVectorSDNode(MVT vecVT, DebugLoc dl, const SDValue *Elts, unsigned NumElts) - : SDNode(ISD::BUILD_VECTOR, dl, getSDVTList(vecVT), Elts, NumElts), - computedSplat(false), isSplatVector(false), hasUndefSplatBitsFlag(false), - SplatBits(0LL), SplatUndef(0LL), SplatSize(0) + : SDNode(ISD::BUILD_VECTOR, dl, getSDVTList(vecVT), Elts, NumElts) { } -bool BuildVectorSDNode::isConstantSplat(int MinSplatBits) { +bool BuildVectorSDNode::isConstantSplat(bool &hasUndefSplatBitsFlag, + uint64_t &SplatBits, + uint64_t &SplatUndef, + unsigned &SplatSize, + int MinSplatBits) { unsigned int nOps = getNumOperands(); assert(nOps > 0 && "isConstantSplat has 0-size build vector"); - // Return early if we already know the answer: - if (computedSplat) - return isSplatVector; + // Assume that this isn't a constant splat. + bool isSplatVector = false; // The vector's used (non-undef) bits uint64_t VectorBits[2] = { 0, 0 }; // The vector's undefined bits uint64_t UndefBits[2] = { 0, 0 }; - // Assume that this isn't a constant splat. - isSplatVector = false; - // Gather the constant and undefined bits unsigned EltBitSize = getOperand(0).getValueType().getSizeInBits(); for (unsigned i = 0; i < nOps; ++i) { @@ -4901,7 +4899,6 @@ bool BuildVectorSDNode::isConstantSplat(int MinSplatBits) { EltBits = DoubleToBits(apf.convertToDouble()); } else { // Nonconstant element -> not a splat. - computedSplat = true; return isSplatVector; } @@ -4910,7 +4907,6 @@ bool BuildVectorSDNode::isConstantSplat(int MinSplatBits) { if ((VectorBits[0] & ~UndefBits[1]) != (VectorBits[1] & ~UndefBits[0])) { // Can't be a splat if two pieces don't match. - computedSplat = true; return isSplatVector; } @@ -4954,7 +4950,6 @@ bool BuildVectorSDNode::isConstantSplat(int MinSplatBits) { isSplatVector = true; } - computedSplat = true; return isSplatVector; } |

