[llvm] 1ea4296 - [NFC] Remove from UnivariateLinearPolyBase::getValue().
Sander de Smalen via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 4 07:39:25 PDT 2021
Author: Sander de Smalen
Date: 2021-11-04T14:32:08Z
New Revision: 1ea4296208e61b1bd4e8a91bee9b5f56a0cfd526
URL: https://github.com/llvm/llvm-project/commit/1ea4296208e61b1bd4e8a91bee9b5f56a0cfd526
DIFF: https://github.com/llvm/llvm-project/commit/1ea4296208e61b1bd4e8a91bee9b5f56a0cfd526.diff
LOG: [NFC] Remove from UnivariateLinearPolyBase::getValue().
This interface should not have existed in the first place, let alone
be a public member.
It allows calling `ElementCount::get(..)->getValue()`, which is ambiguous.
The interfaces to be used are either getFixedValue() or getKnownMinValue().
Added:
Modified:
llvm/include/llvm/Support/TypeSize.h
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/unittests/Support/LinearPolyBaseTest.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Support/TypeSize.h b/llvm/include/llvm/Support/TypeSize.h
index 30bbbd7db8c97..b9a8327bcc04d 100644
--- a/llvm/include/llvm/Support/TypeSize.h
+++ b/llvm/include/llvm/Support/TypeSize.h
@@ -229,7 +229,6 @@ class UnivariateLinearPolyBase {
bool isZero() const { return !Value; }
bool isNonZero() const { return !isZero(); }
explicit operator bool() const { return isNonZero(); }
- ScalarTy getValue() const { return Value; }
ScalarTy getValue(unsigned Dim) const {
return Dim == UnivariateDim ? Value : 0;
}
@@ -294,7 +293,7 @@ class LinearPolySize : public UnivariateLinearPolyBase<LeafTy> {
static LeafTy getNull() { return get(0, false); }
/// Returns the minimum value this size can represent.
- ScalarTy getKnownMinValue() const { return this->getValue(); }
+ ScalarTy getKnownMinValue() const { return this->Value; }
/// Returns whether the size is scaled by a runtime quantity (vscale).
bool isScalable() const { return this->UnivariateDim == ScalableDim; }
/// A return value of true indicates we know at compile time that the number
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 6e7f29820b52a..64afe16d0c3db 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -13090,7 +13090,7 @@ static SDValue performCommonVectorExtendCombine(SDValue VectorShuffle,
DAG.getAnyExtOrTrunc(Extend.getOperand(0), DL, PreExtendType),
DAG.getConstant(0, DL, MVT::i64));
- std::vector<int> ShuffleMask(TargetType.getVectorElementCount().getValue());
+ std::vector<int> ShuffleMask(TargetType.getVectorNumElements());
SDValue VectorShuffleNode =
DAG.getVectorShuffle(PreExtendVT, DL, InsertVectorNode,
diff --git a/llvm/unittests/Support/LinearPolyBaseTest.cpp b/llvm/unittests/Support/LinearPolyBaseTest.cpp
index 6942ea2a14ea1..f9a2d4e7521ee 100644
--- a/llvm/unittests/Support/LinearPolyBaseTest.cpp
+++ b/llvm/unittests/Support/LinearPolyBaseTest.cpp
@@ -124,9 +124,6 @@ TEST(UnivariateLinearPolyBase, Univariate3D_GetValue) {
EXPECT_EQ(Univariate3D(42, 1).getValue(0), 0);
EXPECT_EQ(Univariate3D(42, 1).getValue(1), 42);
EXPECT_EQ(Univariate3D(42, 1).getValue(2), 0);
-
- EXPECT_EQ(Univariate3D(42, 0).getValue(), 42);
- EXPECT_EQ(Univariate3D(42, 1).getValue(), 42);
}
TEST(UnivariateLinearPolyBase, Univariate3D_Add) {
More information about the llvm-commits
mailing list