summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGraham Hunter <graham.hunter@arm.com>2019-10-16 16:33:41 +0000
committerGraham Hunter <graham.hunter@arm.com>2019-10-16 16:33:41 +0000
commitf998fa2924c736e5b5c2cc6ddc222a36d0171470 (patch)
treec04c94cb7019304ff33b9162d85cacefedfc3660
parenta9cfde1f6ab5ca52467c9e8695c64ddd247bd4ef (diff)
downloadbcm5719-llvm-f998fa2924c736e5b5c2cc6ddc222a36d0171470.tar.gz
bcm5719-llvm-f998fa2924c736e5b5c2cc6ddc222a36d0171470.zip
[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. llvm-svn: 375013
-rw-r--r--llvm/include/llvm/IR/DataLayout.h2
-rw-r--r--llvm/include/llvm/Support/TypeSize.h6
-rw-r--r--llvm/lib/IR/Instructions.cpp8
3 files changed, 8 insertions, 8 deletions
diff --git a/llvm/include/llvm/IR/DataLayout.h b/llvm/include/llvm/IR/DataLayout.h
index 022d2e944b5..08fd269807a 100644
--- a/llvm/include/llvm/IR/DataLayout.h
+++ b/llvm/include/llvm/IR/DataLayout.h
@@ -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() };
}
diff --git a/llvm/include/llvm/Support/TypeSize.h b/llvm/include/llvm/Support/TypeSize.h
index ea08358485a..711679cdcac 100644
--- a/llvm/include/llvm/Support/TypeSize.h
+++ b/llvm/include/llvm/Support/TypeSize.h
@@ -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 };
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index 20331803f60..579e38e30a0 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -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
OpenPOWER on IntegriCloud