[PATCH] D66691: [LLVM][NFC] Removing unused functions

Guillaume Chatelet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 23 16:20:20 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL369824: [LLVM][NFC] Removing unused functions (authored by gchatelet, committed by ).
Herald added a subscriber: kristina.

Changed prior to commit:
  https://reviews.llvm.org/D66691?vs=216973&id=216976#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66691/new/

https://reviews.llvm.org/D66691

Files:
  llvm/trunk/include/llvm/IR/DataLayout.h
  llvm/trunk/include/llvm/Support/MathExtras.h
  llvm/trunk/lib/IR/DataLayout.cpp
  llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp


Index: llvm/trunk/include/llvm/IR/DataLayout.h
===================================================================
--- llvm/trunk/include/llvm/IR/DataLayout.h
+++ llvm/trunk/include/llvm/IR/DataLayout.h
@@ -494,10 +494,6 @@
   /// This is always at least as good as the ABI alignment.
   unsigned getPrefTypeAlignment(Type *Ty) const;
 
-  /// Returns the preferred alignment for the specified type, returned as
-  /// log2 of the value (a shift amount).
-  unsigned getPreferredTypeAlignmentShift(Type *Ty) const;
-
   /// Returns an integer type with size at least as big as that of a
   /// pointer in the given address space.
   IntegerType *getIntPtrType(LLVMContext &C, unsigned AddressSpace = 0) const;
Index: llvm/trunk/include/llvm/Support/MathExtras.h
===================================================================
--- llvm/trunk/include/llvm/Support/MathExtras.h
+++ llvm/trunk/include/llvm/Support/MathExtras.h
@@ -704,19 +704,6 @@
   return alignTo(Numerator, Denominator) / Denominator;
 }
 
-/// \c alignTo for contexts where a constant expression is required.
-/// \sa alignTo
-///
-/// \todo FIXME: remove when \c constexpr becomes really \c constexpr
-template <uint64_t Align>
-struct AlignTo {
-  static_assert(Align != 0u, "Align must be non-zero");
-  template <uint64_t Value>
-  struct from_value {
-    static const uint64_t value = (Value + Align - 1) / Align * Align;
-  };
-};
-
 /// Returns the largest uint64_t less than or equal to \p Value and is
 /// \p Skew mod \p Align. \p Align must be non-zero
 inline uint64_t alignDown(uint64_t Value, uint64_t Align, uint64_t Skew = 0) {
Index: llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp
===================================================================
--- llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp
+++ llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp
@@ -115,7 +115,7 @@
 
   MCSymbol *GVSym = getSymbol(GV);
   const Constant *C = GV->getInitializer();
-  unsigned Align = (unsigned)DL.getPreferredTypeAlignmentShift(C->getType());
+  unsigned Align = Log2_32(DL.getPrefTypeAlignment(C->getType()));
 
   // Mark the start of the global
   getTargetStreamer().emitCCTopData(GVSym->getName());
Index: llvm/trunk/lib/IR/DataLayout.cpp
===================================================================
--- llvm/trunk/lib/IR/DataLayout.cpp
+++ llvm/trunk/lib/IR/DataLayout.cpp
@@ -763,12 +763,6 @@
   return getAlignment(Ty, false);
 }
 
-unsigned DataLayout::getPreferredTypeAlignmentShift(Type *Ty) const {
-  unsigned Align = getPrefTypeAlignment(Ty);
-  assert(!(Align & (Align-1)) && "Alignment is not a power of two!");
-  return Log2_32(Align);
-}
-
 IntegerType *DataLayout::getIntPtrType(LLVMContext &C,
                                        unsigned AddressSpace) const {
   return IntegerType::get(C, getIndexSizeInBits(AddressSpace));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66691.216976.patch
Type: text/x-patch
Size: 2841 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190823/d01b3deb/attachment.bin>


More information about the llvm-commits mailing list