summaryrefslogtreecommitdiff
path: root/include/llvm/Constant.h
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2012-11-13 12:59:33 +0000
committerDuncan Sands <baldrick@free.fr>2012-11-13 12:59:33 +0000
commit2333e29be441d9d55920651e0b2add23ab0c1613 (patch)
treea81026fd460acee57a8305816fea3c2a75879aee /include/llvm/Constant.h
parent563e8fce2ee22b21beb40ac65a6eaf2199d30414 (diff)
downloadllvm-2333e29be441d9d55920651e0b2add23ab0c1613.tar.gz
llvm-2333e29be441d9d55920651e0b2add23ab0c1613.tar.bz2
llvm-2333e29be441d9d55920651e0b2add23ab0c1613.tar.xz
Relax the restrictions on vector of pointer types, and vector getelementptr.
Previously in a vector of pointers, the pointer couldn't be any pointer type, it had to be a pointer to an integer or floating point type. This is a hassle for dragonegg because the GCC vectorizer happily produces vectors of pointers where the pointer is a pointer to a struct or whatever. Vector getelementptr was restricted to just one index, but now that vectors of pointers can have any pointer type it is more natural to allow arbitrary vector getelementptrs. There is however the issue of struct GEPs, where if each lane chose different struct fields then from that point on each lane will be working down into unrelated types. This seems like too much pain for too little gain, so when you have a vector struct index all the elements are required to be the same. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167828 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Constant.h')
-rw-r--r--include/llvm/Constant.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/llvm/Constant.h b/include/llvm/Constant.h
index 7fecf4c7b4..bbd1b1a6e2 100644
--- a/include/llvm/Constant.h
+++ b/include/llvm/Constant.h
@@ -97,7 +97,15 @@ public:
/// 'this' is a constant expr.
Constant *getAggregateElement(unsigned Elt) const;
Constant *getAggregateElement(Constant *Elt) const;
-
+
+ /// getSplatValue - If this is a splat vector constant, meaning that all of
+ /// the elements have the same value, return that value. Otherwise return 0.
+ Constant *getSplatValue() const;
+
+ /// If C is a constant integer then return its value, otherwise C must be a
+ /// vector of constant integers, all equal, and the common value is returned.
+ const APInt &getUniqueInteger() const;
+
/// destroyConstant - Called if some element of this constant is no longer
/// valid. At this point only other constants may be on the use_list for this
/// constant. Any constants on our Use list must also be destroy'd. The