]> granicus.if.org Git - llvm/commitdiff
[SVE][IR] Small TypeSize improvements left out of initial commit
authorGraham Hunter <graham.hunter@arm.com>
Wed, 16 Oct 2019 16:33:41 +0000 (16:33 +0000)
committerGraham Hunter <graham.hunter@arm.com>
Wed, 16 Oct 2019 16:33:41 +0000 (16:33 +0000)
The commit for D53137 left out the last round of improvements
requested by reviewers. Adding those in now.

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

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

index 022d2e944b5afd26453953f3f7adeb48afb5865e..08fd269807a850cc79c2d0c1a4c7a1ea566c6754 100644 (file)
@@ -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() };
   }
 
index ea08358485ad7c3ba7ec7d8be8f917b94fdb71a5..711679cdcacb475900851ebab5e5f9785ad08356 100644 (file)
@@ -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 };
index 20331803f604ed0b030a95db744217e2260f1ad3..579e38e30a06e6ba04bfe5c48c9e3d8b37d35330 100644 (file)
@@ -2983,8 +2983,8 @@ bool CastInst::isCastable(Type *SrcTy, Type *DestTy) {
       }
 
   // 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, Type *DestTy) {
     }
   }
 
-  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