[llvm] 8c058dd - [SVE] Remove TypeSize comparison operators

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 29 07:32:42 PDT 2020


Author: David Sherwood
Date: 2020-10-29T14:32:26Z
New Revision: 8c058dd2d752f9ac26a085eb93e1b6e864583be0

URL: https://github.com/llvm/llvm-project/commit/8c058dd2d752f9ac26a085eb93e1b6e864583be0
DIFF: https://github.com/llvm/llvm-project/commit/8c058dd2d752f9ac26a085eb93e1b6e864583be0.diff

LOG: [SVE] Remove TypeSize comparison operators

All known instances in the code where we relied upon the TypeSize
comparison operators have now been changed to either use scalar
interger comparisons or one of the TypeSize::isKnownXY functions.
It is now safe to remove the comparison operators.

Differential Revision: https://reviews.llvm.org/D90160

Added: 
    

Modified: 
    llvm/include/llvm/Support/TypeSize.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/TypeSize.h b/llvm/include/llvm/Support/TypeSize.h
index 47fb90d21c0b..392dd1a33605 100644
--- a/llvm/include/llvm/Support/TypeSize.h
+++ b/llvm/include/llvm/Support/TypeSize.h
@@ -206,25 +206,6 @@ class TypeSize : public PolySize<uint64_t> {
   uint64_t getFixedSize() const { return getFixedValue(); }
   uint64_t getKnownMinSize() const { return getKnownMinValue(); }
 
-  friend bool operator<(const TypeSize &LHS, const TypeSize &RHS) {
-    assert(LHS.IsScalable == RHS.IsScalable &&
-           "Ordering comparison of scalable and fixed types");
-
-    return LHS.MinVal < RHS.MinVal;
-  }
-
-  friend bool operator>(const TypeSize &LHS, const TypeSize &RHS) {
-    return RHS < LHS;
-  }
-
-  friend bool operator<=(const TypeSize &LHS, const TypeSize &RHS) {
-    return !(RHS < LHS);
-  }
-
-  friend bool operator>=(const TypeSize &LHS, const TypeSize& RHS) {
-    return !(LHS < RHS);
-  }
-
   TypeSize &operator-=(TypeSize RHS) {
     assert(IsScalable == RHS.IsScalable &&
            "Subtraction using mixed scalable and fixed types");


        


More information about the llvm-commits mailing list