summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorScott Michel <scottm@aero.org>2009-02-25 03:12:50 +0000
committerScott Michel <scottm@aero.org>2009-02-25 03:12:50 +0000
commitdf38043a46b873acb98e7ce0c700d82c1d888772 (patch)
treeda1fd9c994090c2be230ef879e0c94f9d8001248 /include
parent0d52ff1f7b993750a74a5d4432273092de9af069 (diff)
downloadllvm-df38043a46b873acb98e7ce0c700d82c1d888772.tar.gz
llvm-df38043a46b873acb98e7ce0c700d82c1d888772.tar.bz2
llvm-df38043a46b873acb98e7ce0c700d82c1d888772.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65426 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h50
1 files changed, 16 insertions, 34 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index 4cb1a3d8e0..9e0aa871fb 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -1933,13 +1933,6 @@ public:
/// encapsulate common BUILD_VECTOR code and operations such as constant splat
/// testing.
class BuildVectorSDNode : public SDNode {
- //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
- // Constant splat state:
- //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
- //! We've computed the splat already?
- bool computedSplat;
- //! It is a splat?
- bool isSplatVector;
//! Splat has undefined bits in it
bool hasUndefSplatBitsFlag;
//! The splat value
@@ -1959,36 +1952,25 @@ protected:
public:
//! Constant splat predicate.
/*!
- Determine if this ISD::BUILD_VECTOR is a constant splat. The results are
- cached to prevent recomputation.
-
- @param MinSplatBits: minimum number of bits in the constant splat, defaults
+ Determine if this ISD::BUILD_VECTOR is a constant splat. This method
+ returns information about the splat in \a hasUndefSplatBitsFlag,
+ \a SplatBits, \a SplatUndef and \a SplatSize if the return value is
+ true.
+
+ \param[out] hasUndefSplatBitsFlag: true if the constant splat contains
+ any undefined bits in the splat.
+ \param[out] SplatBits: The constant splat value
+ \param[out] SplatUndef: The undefined bits in the splat value
+ \param[out] SplatSize: The size of the constant splat in bytes
+ \param MinSplatBits: minimum number of bits in the constant splat, defaults
to 0 for 'don't care', but normally one of [8, 16, 32, 64].
- @return true if the splat has the required minimum number of bits and the
+
+ \return true if the splat has the required minimum number of bits and the
splat really is a constant splat (accounting for undef bits).
*/
- bool isConstantSplat(int MinSplatBits = 0);
-
- //! Get the splatbits
- uint64_t getSplatBits() const {
- assert(computedSplat && "BuildVectorSDNode: compute splat bits first!");
- return SplatBits;
- }
-
- uint64_t getSplatUndef() const {
- assert(computedSplat && "BuildVectorSDNode: compute splat bits first!");
- return SplatUndef;
- }
-
- unsigned getSplatSize() const {
- assert(computedSplat && "BuildVectorSDNode: compute splat bits first!");
- return SplatSize;
- }
-
- bool hasAnyUndefBits() const {
- assert(computedSplat && "BuildVectorSDNode: compute splat bits first!");
- return hasUndefSplatBitsFlag;
- }
+ bool isConstantSplat(bool &hasUndefSplatBitsFlag, uint64_t &SplatBits,
+ uint64_t &SplatUndef, unsigned &SplatSize,
+ int MinSplatBits = 0);
static bool classof(const BuildVectorSDNode *) { return true; }
static bool classof(const SDNode *N) {