From 1ea4296208e61b1bd4e8a91bee9b5f56a0cfd526 Mon Sep 17 00:00:00 2001 From: Sander de Smalen Date: Thu, 4 Nov 2021 13:49:10 +0000 Subject: [PATCH] [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(). --- llvm/include/llvm/Support/TypeSize.h | 3 +-- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 2 +- llvm/unittests/Support/LinearPolyBaseTest.cpp | 3 --- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/llvm/include/llvm/Support/TypeSize.h b/llvm/include/llvm/Support/TypeSize.h index 30bbbd7..b9a8327 100644 --- a/llvm/include/llvm/Support/TypeSize.h +++ b/llvm/include/llvm/Support/TypeSize.h @@ -229,7 +229,6 @@ public: 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 @@ public: 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 6e7f298..64afe16 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 ShuffleMask(TargetType.getVectorElementCount().getValue()); + std::vector 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 6942ea2..f9a2d4e 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) { -- 2.7.4