OSDN Git Service

Rename getLargestLegalIntTypeSize to getLargestLegalIntTypeSizeInBits(). NFC.
authorJun Bum Lim <junbuml@codeaurora.org>
Fri, 13 May 2016 18:38:35 +0000 (18:38 +0000)
committerJun Bum Lim <junbuml@codeaurora.org>
Fri, 13 May 2016 18:38:35 +0000 (18:38 +0000)
Summary: Rename DataLayout::getLargestLegalIntTypeSize to DataLayout::getLargestLegalIntTypeSizeInBits() to prevent similar mistakes  fixed in r269433.

Reviewers: joker.eph, mcrosier

Subscribers: mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D20248

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269456 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/DataLayout.h
lib/CodeGen/AtomicExpandPass.cpp
lib/CodeGen/CodeGenPrepare.cpp
lib/IR/DataLayout.cpp
lib/Transforms/InstCombine/InstructionCombining.cpp
lib/Transforms/Scalar/MemCpyOptimizer.cpp

index e9a893f..ed71ae7 100644 (file)
@@ -427,13 +427,13 @@ public:
 
   /// \brief Returns the largest legal integer type, or null if none are set.
   Type *getLargestLegalIntType(LLVMContext &C) const {
-    unsigned LargestSize = getLargestLegalIntTypeSize();
+    unsigned LargestSize = getLargestLegalIntTypeSizeInBits();
     return (LargestSize == 0) ? nullptr : Type::getIntNTy(C, LargestSize);
   }
 
   /// \brief Returns the size of largest legal integer type size, or 0 if none
   /// are set.
-  unsigned getLargestLegalIntTypeSize() const;
+  unsigned getLargestLegalIntTypeSizeInBits() const;
 
   /// \brief Returns the offset from the beginning of the type for the specified
   /// indices.
index 47e69d8..433ba94 100644 (file)
@@ -951,7 +951,7 @@ static bool canUseSizedAtomicCall(unsigned Size, unsigned Align,
   // call a sized libcall that doesn't actually exist. There should
   // really be some more reliable way in LLVM of determining integer
   // sizes which are valid in the target's C ABI...
-  unsigned LargestSize = DL.getLargestLegalIntTypeSize() >= 64 ? 16 : 8;
+  unsigned LargestSize = DL.getLargestLegalIntTypeSizeInBits() >= 64 ? 16 : 8;
   return Align >= Size &&
          (Size == 1 || Size == 2 || Size == 4 || Size == 8 || Size == 16) &&
          Size <= LargestSize;
index 56a1639..3282dc6 100644 (file)
@@ -1690,7 +1690,7 @@ static bool despeculateCountZeros(IntrinsicInst *CountZeros,
   // Only handle legal scalar cases. Anything else requires too much work.
   Type *Ty = CountZeros->getType();
   unsigned SizeInBits = Ty->getPrimitiveSizeInBits();
-  if (Ty->isVectorTy() || SizeInBits > DL->getLargestLegalIntTypeSize())
+  if (Ty->isVectorTy() || SizeInBits > DL->getLargestLegalIntTypeSizeInBits())
     return false;
 
   // The intrinsic will be sunk behind a compare against zero and branch.
index dd85a17..dc4b898 100644 (file)
@@ -718,7 +718,7 @@ Type *DataLayout::getSmallestLegalIntType(LLVMContext &C, unsigned Width) const
   return nullptr;
 }
 
-unsigned DataLayout::getLargestLegalIntTypeSize() const {
+unsigned DataLayout::getLargestLegalIntTypeSizeInBits() const {
   auto Max = std::max_element(LegalIntWidths.begin(), LegalIntWidths.end());
   return Max != LegalIntWidths.end() ? *Max : 0;
 }
index ddb866c..cc3d168 100644 (file)
@@ -2201,7 +2201,7 @@ Instruction *InstCombiner::visitSwitchInst(SwitchInst &SI) {
   // truncated to i8 or i16.
   bool TruncCond = false;
   if (NewWidth > 0 && BitWidth > NewWidth &&
-      NewWidth >= DL.getLargestLegalIntTypeSize()) {
+      NewWidth >= DL.getLargestLegalIntTypeSizeInBits()) {
     TruncCond = true;
     IntegerType *Ty = IntegerType::get(SI.getContext(), NewWidth);
     Builder->SetInsertPoint(&SI);
index d8f6c2a..8976742 100644 (file)
@@ -185,7 +185,7 @@ bool MemsetRange::isProfitableToUseMemset(const DataLayout &DL) const {
   // size. If so, check to see whether we will end up actually reducing the
   // number of stores used.
   unsigned Bytes = unsigned(End-Start);
-  unsigned MaxIntSize = DL.getLargestLegalIntTypeSize() / 8;
+  unsigned MaxIntSize = DL.getLargestLegalIntTypeSizeInBits() / 8;
   if (MaxIntSize == 0)
     MaxIntSize = 1;
   unsigned NumPointerStores = Bytes / MaxIntSize;