diff options
author | Bob Wilson <bob.wilson@apple.com> | 2009-03-01 01:13:55 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2009-03-01 01:13:55 +0000 |
commit | a27ea9e89f38e9bcca4d67defb0bae887a16d72c (patch) | |
tree | 169e3839df3c8f649cc93b6aaa34b53633ad5b79 /include/llvm/CodeGen | |
parent | f6f0bdfec336b596b095b4db8126149bbb33fec1 (diff) |
Combine PPC's GetConstantBuildVectorBits and isConstantSplat functions to a new
method in a BuildVectorSDNode "pseudo-class".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65747 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index e874ba7c06..b10c865f09 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -1929,6 +1929,24 @@ public: } }; +/// BuildVectorSDNode - A "pseudo-class" with methods for operating on +/// BUILD_VECTORs. +class BuildVectorSDNode : public SDNode { +public: + /// isConstantSplat - check if this is a constant splat, and if so, return + /// the splat element value in SplatBits. Any undefined bits in that value + /// are set to zero, and the corresponding bits in the SplatUndef mask are + /// set. The SplatSize value is set to the splat element size in bytes. + /// HasAnyUndefs is set to true if any bits in the vector are undefined. + bool isConstantSplat(unsigned &SplatBits, unsigned &SplatUndef, + unsigned &SplatSize, bool &HasAnyUndefs); + + static inline bool classof(const BuildVectorSDNode *) { return true; } + static inline bool classof(const SDNode *N) { + return N->getOpcode() == ISD::BUILD_VECTOR; + } +}; + /// SrcValueSDNode - An SDNode that holds an arbitrary LLVM IR Value. This is /// used when the SelectionDAG needs to make a simple reference to something /// in the LLVM IR representation. |