aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
authorChristopher Tetreault <ctetreau@quicinc.com>2020-04-28 12:39:59 -0700
committerChristopher Tetreault <ctetreau@quicinc.com>2020-04-28 12:59:26 -0700
commit2e214baed929ab4e38feb34fd1451d759821e4f5 (patch)
treeda071ce326c86634e92f90b0d10a4bb26221aeee /llvm/lib/IR/Function.cpp
parent95e570725a1423fcb7d6c1aa7eeed64c4a806436 (diff)
downloadllvm-2e214baed929ab4e38feb34fd1451d759821e4f5.zip
llvm-2e214baed929ab4e38feb34fd1451d759821e4f5.tar.gz
llvm-2e214baed929ab4e38feb34fd1451d759821e4f5.tar.bz2
[SVE] Remove invalid usage of VectorType::getNumElements in Function
Summary: Removes usage of VectorType::getNumElements identified by test located at CodeGen/aarch64-sve-intrinsics/acle_sve_dot.c. This code explicitly converts a potentially fixed length vector to scalable vector by constructing the ElementCount = {getNumElements(), true} Reviewers: rengolin, efriedma, kmclaughlin, c-rhodes, sdesmalen Reviewed By: efriedma Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D78967
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r--llvm/lib/IR/Function.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index 53ab117..77e0f3f 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -1074,8 +1074,8 @@ static Type *DecodeFixedType(ArrayRef<Intrinsic::IITDescriptor> &Infos,
// Return the overloaded type (which determines the pointers address space)
return Tys[D.getOverloadArgNumber()];
case IITDescriptor::ScalableVecArgument: {
- auto *Ty = cast<VectorType>(DecodeFixedType(Infos, Tys, Context));
- return VectorType::get(Ty->getElementType(), {Ty->getNumElements(), true});
+ auto *Ty = cast<FixedVectorType>(DecodeFixedType(Infos, Tys, Context));
+ return ScalableVectorType::get(Ty->getElementType(), Ty->getNumElements());
}
}
llvm_unreachable("unhandled");