aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/SelectionDAGNodes.h
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2009-03-02 23:24:16 +0000
committerBob Wilson <bob.wilson@apple.com>2009-03-02 23:24:16 +0000
commite653968fa9cb34ee29cee7abb82607fe28608daf (patch)
treec4550a89aa6535468c9e5cc2acf69a6b6ad09d83 /include/llvm/CodeGen/SelectionDAGNodes.h
parent0c188b887628d5f86835640254df67fe8a1568f5 (diff)
downloadexternal_llvm-e653968fa9cb34ee29cee7abb82607fe28608daf.zip
external_llvm-e653968fa9cb34ee29cee7abb82607fe28608daf.tar.gz
external_llvm-e653968fa9cb34ee29cee7abb82607fe28608daf.tar.bz2
Generalize BuildVectorSDNode::isConstantSplat to use APInts and handle
arbitrary vector sizes. Add an optional MinSplatBits parameter to specify a minimum for the splat element size. Update the PPC target to use the revised interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65899 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/SelectionDAGNodes.h')
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index b10c865..e945b98 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -1933,13 +1933,18 @@ public:
/// 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);
+ /// isConstantSplat - Check if this is a constant splat, and if so, find the
+ /// smallest element size that splats the vector. If MinSplatBits is
+ /// nonzero, the element size must be at least that large. Note that the
+ /// splat element may be the entire vector (i.e., a one element vector).
+ /// Returns the splat element value in SplatValue. Any undefined bits in
+ /// that value are zero, and the corresponding bits in the SplatUndef mask
+ /// are set. The SplatBitSize value is set to the splat element size in
+ /// bits. HasAnyUndefs is set to true if any bits in the vector are
+ /// undefined.
+ bool isConstantSplat(APInt &SplatValue, APInt &SplatUndef,
+ unsigned &SplatBitSize, bool &HasAnyUndefs,
+ unsigned MinSplatBits = 0);
static inline bool classof(const BuildVectorSDNode *) { return true; }
static inline bool classof(const SDNode *N) {