From 922772122582c59091b2750bca0a8d0aba0cdf44 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 14 Apr 2019 04:45:04 +0000 Subject: [PATCH] [ConstantRange] Delete unused getSetSize getSetSize returns an APInt that is 1 bit wider. The APInt is typically 65-bit and requires memory allocation. isSizeStrictlySmallerThan and isSizeLargerThan are preferred. The last use of this helper method was removed by rL302385. llvm-svn: 358347 --- include/llvm/IR/ConstantRange.h | 3 --- lib/IR/ConstantRange.cpp | 8 -------- 2 files changed, 11 deletions(-) diff --git a/include/llvm/IR/ConstantRange.h b/include/llvm/IR/ConstantRange.h index 16079598bec..ec57e08be72 100644 --- a/include/llvm/IR/ConstantRange.h +++ b/include/llvm/IR/ConstantRange.h @@ -205,9 +205,6 @@ public: /// Return true if this set contains exactly one member. bool isSingleElement() const { return getSingleElement() != nullptr; } - /// Return the number of elements in this set. - APInt getSetSize() const; - /// Compare set size of this range with the range CR. bool isSizeStrictlySmallerThan(const ConstantRange &CR) const; diff --git a/lib/IR/ConstantRange.cpp b/lib/IR/ConstantRange.cpp index 40934d97286..87b66fa821c 100644 --- a/lib/IR/ConstantRange.cpp +++ b/lib/IR/ConstantRange.cpp @@ -349,14 +349,6 @@ bool ConstantRange::isUpperSignWrapped() const { return Lower.sgt(Upper); } -APInt ConstantRange::getSetSize() const { - if (isFullSet()) - return APInt::getOneBitSet(getBitWidth()+1, getBitWidth()); - - // This is also correct for wrapped sets. - return (Upper - Lower).zext(getBitWidth()+1); -} - bool ConstantRange::isSizeStrictlySmallerThan(const ConstantRange &Other) const { assert(getBitWidth() == Other.getBitWidth());