[NFC] Remove from UnivariateLinearPolyBase::getValue().
authorSander de Smalen <sander.desmalen@arm.com>
Thu, 4 Nov 2021 13:49:10 +0000 (13:49 +0000)
committerSander de Smalen <sander.desmalen@arm.com>
Thu, 4 Nov 2021 14:32:08 +0000 (14:32 +0000)
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
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/unittests/Support/LinearPolyBaseTest.cpp

index 30bbbd7..b9a8327 100644 (file)
@@ -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
index 6e7f298..64afe16 100644 (file)
@@ -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,
index 6942ea2..f9a2d4e 100644 (file)
@@ -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) {