[llvm] r375013 - [SVE][IR] Small TypeSize improvements left out of initial commit

Graham Hunter via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 16 09:33:41 PDT 2019


Author: huntergr
Date: Wed Oct 16 09:33:41 2019
New Revision: 375013

URL: http://llvm.org/viewvc/llvm-project?rev=375013&view=rev
Log:
[SVE][IR] Small TypeSize improvements left out of initial commit

The commit for D53137 left out the last round of improvements
requested by reviewers. Adding those in now.

Modified:
    llvm/trunk/include/llvm/IR/DataLayout.h
    llvm/trunk/include/llvm/Support/TypeSize.h
    llvm/trunk/lib/IR/Instructions.cpp

Modified: llvm/trunk/include/llvm/IR/DataLayout.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DataLayout.h?rev=375013&r1=375012&r2=375013&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DataLayout.h (original)
+++ llvm/trunk/include/llvm/IR/DataLayout.h Wed Oct 16 09:33:41 2019
@@ -453,7 +453,7 @@ public:
   ///
   /// For example, returns 5 for i36 and 10 for x86_fp80.
   TypeSize getTypeStoreSize(Type *Ty) const {
-    auto BaseSize = getTypeSizeInBits(Ty);
+    TypeSize BaseSize = getTypeSizeInBits(Ty);
     return { (BaseSize.getKnownMinSize() + 7) / 8, BaseSize.isScalable() };
   }
 

Modified: llvm/trunk/include/llvm/Support/TypeSize.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/TypeSize.h?rev=375013&r1=375012&r2=375013&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/TypeSize.h (original)
+++ llvm/trunk/include/llvm/Support/TypeSize.h Wed Oct 16 09:33:41 2019
@@ -120,7 +120,7 @@ public:
 
   // Return the minimum size with the assumption that the size is exact.
   // Use in places where a scalable size doesn't make sense (e.g. non-vector
-  // types, or vectors in backends which don't support scalable vectors)
+  // types, or vectors in backends which don't support scalable vectors).
   uint64_t getFixedSize() const {
     assert(!IsScalable && "Request for a fixed size on a scalable object");
     return MinSize;
@@ -141,12 +141,12 @@ public:
   // Casts to a uint64_t if this is a fixed-width size.
   //
   // NOTE: This interface is obsolete and will be removed in a future version
-  // of LLVM in favour of calling getFixedSize() directly
+  // of LLVM in favour of calling getFixedSize() directly.
   operator uint64_t() const {
     return getFixedSize();
   }
 
-  // Additional convenience operators needed to avoid ambiguous parses
+  // Additional convenience operators needed to avoid ambiguous parses.
   // TODO: Make uint64_t the default operator?
   TypeSize operator*(uint64_t RHS) const {
     return { MinSize * RHS, IsScalable };

Modified: llvm/trunk/lib/IR/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Instructions.cpp?rev=375013&r1=375012&r2=375013&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Instructions.cpp (original)
+++ llvm/trunk/lib/IR/Instructions.cpp Wed Oct 16 09:33:41 2019
@@ -2983,8 +2983,8 @@ bool CastInst::isCastable(Type *SrcTy, T
       }
 
   // Get the bit sizes, we'll need these
-  auto SrcBits = SrcTy->getPrimitiveSizeInBits();   // 0 for ptr
-  auto DestBits = DestTy->getPrimitiveSizeInBits(); // 0 for ptr
+  TypeSize SrcBits = SrcTy->getPrimitiveSizeInBits();   // 0 for ptr
+  TypeSize DestBits = DestTy->getPrimitiveSizeInBits(); // 0 for ptr
 
   // Run through the possibilities ...
   if (DestTy->isIntegerTy()) {               // Casting to integral
@@ -3045,8 +3045,8 @@ bool CastInst::isBitCastable(Type *SrcTy
     }
   }
 
-  auto SrcBits = SrcTy->getPrimitiveSizeInBits();   // 0 for ptr
-  auto DestBits = DestTy->getPrimitiveSizeInBits(); // 0 for ptr
+  TypeSize SrcBits = SrcTy->getPrimitiveSizeInBits();   // 0 for ptr
+  TypeSize DestBits = DestTy->getPrimitiveSizeInBits(); // 0 for ptr
 
   // Could still have vectors of pointers if the number of elements doesn't
   // match




More information about the llvm-commits mailing list