aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
authorChristopher Tetreault <ctetreau@quicinc.com>2020-04-23 09:52:49 -0700
committerChristopher Tetreault <ctetreau@quicinc.com>2020-04-23 10:47:38 -0700
commit3d178581ac7f5336b1ac75e31001de074ecca937 (patch)
treea57960fa8706cb0c198c97cb0baa5dba21c6ad6f /llvm/lib/IR/Function.cpp
parentceb7f308b8aeffe610bcfb0324447cffd26d45a1 (diff)
downloadllvm-3d178581ac7f5336b1ac75e31001de074ecca937.zip
llvm-3d178581ac7f5336b1ac75e31001de074ecca937.tar.gz
llvm-3d178581ac7f5336b1ac75e31001de074ecca937.tar.bz2
[SVE] Make VectorType::getNumElements() complain for scalable vectors
Summary: Piggy-back off of TypeSize's STRICT_FIXED_SIZE_VECTORS flag and: - if it is defined, assert that the vector is not scalable - if it is not defined, complain if the vector is scalable Reviewers: efriedma, sdesmalen, c-rhodes Reviewed By: sdesmalen Subscribers: hiraditya, mgorny, tschuett, rkruppe, psnobl, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D78576
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r--llvm/lib/IR/Function.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index ec390b3..972fe0e 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -644,10 +644,10 @@ static std::string getMangledTypeStr(Type* Ty) {
// Ensure nested function types are distinguishable.
Result += "f";
} else if (VectorType* VTy = dyn_cast<VectorType>(Ty)) {
- if (VTy->isScalable())
+ ElementCount EC = VTy->getElementCount();
+ if (EC.Scalable)
Result += "nx";
- Result += "v" + utostr(VTy->getNumElements()) +
- getMangledTypeStr(VTy->getElementType());
+ Result += "v" + utostr(EC.Min) + getMangledTypeStr(VTy->getElementType());
} else if (Ty) {
switch (Ty->getTypeID()) {
default: llvm_unreachable("Unhandled type");