[llvm] 07aab4a - [DataLayout] Remove getMaxIndexSizeInBits() API

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 04:05:10 PST 2024


Author: Nikita Popov
Date: 2024-12-13T13:01:01+01:00
New Revision: 07aab4a3cdab3d46caab270845413c5ba4546b50

URL: https://github.com/llvm/llvm-project/commit/07aab4a3cdab3d46caab270845413c5ba4546b50
DIFF: https://github.com/llvm/llvm-project/commit/07aab4a3cdab3d46caab270845413c5ba4546b50.diff

LOG: [DataLayout] Remove getMaxIndexSizeInBits() API

The last use was removed in #119365, and we should not add more
uses of this concept in the future either.

Added: 
    

Modified: 
    llvm/include/llvm/IR/DataLayout.h
    llvm/lib/IR/DataLayout.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/DataLayout.h b/llvm/include/llvm/IR/DataLayout.h
index 5e6a6198a94733..2ad080e6d0cd2c 100644
--- a/llvm/include/llvm/IR/DataLayout.h
+++ b/llvm/include/llvm/IR/DataLayout.h
@@ -365,9 +365,6 @@ class DataLayout {
     return getPointerSpec(AS).BitWidth;
   }
 
-  /// Returns the maximum index size over all address spaces.
-  unsigned getMaxIndexSizeInBits() const;
-
   /// Size in bits of index used for address calculation in getelementptr.
   unsigned getIndexSizeInBits(unsigned AS) const {
     return getPointerSpec(AS).IndexBitWidth;

diff  --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp
index 5b3ce2d62efd5b..95a5e5989ad009 100644
--- a/llvm/lib/IR/DataLayout.cpp
+++ b/llvm/lib/IR/DataLayout.cpp
@@ -740,13 +740,6 @@ unsigned DataLayout::getPointerSize(unsigned AS) const {
   return divideCeil(getPointerSpec(AS).BitWidth, 8);
 }
 
-unsigned DataLayout::getMaxIndexSizeInBits() const {
-  unsigned MaxIndexSize = 0;
-  for (const PointerSpec &Spec : PointerSpecs)
-    MaxIndexSize = std::max(MaxIndexSize, Spec.IndexBitWidth);
-  return MaxIndexSize;
-}
-
 unsigned DataLayout::getPointerTypeSizeInBits(Type *Ty) const {
   assert(Ty->isPtrOrPtrVectorTy() &&
          "This should only be called with a pointer or pointer vector type");


        


More information about the llvm-commits mailing list