[llvm] 7ef15c8 - [NFC] Make ConstantVector/ConstantDataVector::getType() return a FixedVectorType
Christopher Tetreault via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 29 14:23:58 PDT 2020
Author: Christopher Tetreault
Date: 2020-04-29T14:23:40-07:00
New Revision: 7ef15c869a551084a111a718e897954cad6ddcde
URL: https://github.com/llvm/llvm-project/commit/7ef15c869a551084a111a718e897954cad6ddcde
DIFF: https://github.com/llvm/llvm-project/commit/7ef15c869a551084a111a718e897954cad6ddcde.diff
LOG: [NFC] Make ConstantVector/ConstantDataVector::getType() return a FixedVectorType
Reviewers: efriedma, huihuiz, dexonsmith, spatel
Reviewed By: efriedma
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79122
Added:
Modified:
llvm/include/llvm/IR/Constants.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/Constants.h b/llvm/include/llvm/IR/Constants.h
index c41d1582a834..b31bcb751ab7 100644
--- a/llvm/include/llvm/IR/Constants.h
+++ b/llvm/include/llvm/IR/Constants.h
@@ -516,12 +516,13 @@ class ConstantVector final : public ConstantAggregate {
public:
/// Return a ConstantVector with the specified constant in each element.
+ /// Note that this might not return an instance of ConstantVector
static Constant *getSplat(ElementCount EC, Constant *Elt);
- /// Specialize the getType() method to always return a VectorType,
+ /// Specialize the getType() method to always return a FixedVectorType,
/// which reduces the amount of casting needed in parts of the compiler.
- inline VectorType *getType() const {
- return cast<VectorType>(Value::getType());
+ inline FixedVectorType *getType() const {
+ return cast<FixedVectorType>(Value::getType());
}
/// If all elements of the vector constant have the same value, return that
@@ -801,10 +802,10 @@ class ConstantDataVector final : public ConstantDataSequential {
/// same value, return that value. Otherwise return NULL.
Constant *getSplatValue() const;
- /// Specialize the getType() method to always return a VectorType,
+ /// Specialize the getType() method to always return a FixedVectorType,
/// which reduces the amount of casting needed in parts of the compiler.
- inline VectorType *getType() const {
- return cast<VectorType>(Value::getType());
+ inline FixedVectorType *getType() const {
+ return cast<FixedVectorType>(Value::getType());
}
/// Methods for support type inquiry through isa, cast, and dyn_cast:
More information about the llvm-commits
mailing list