diff options
author | Christopher Tetreault <ctetreau@quicinc.com> | 2020-06-30 10:56:36 -0700 |
---|---|---|
committer | Christopher Tetreault <ctetreau@quicinc.com> | 2020-06-30 11:05:38 -0700 |
commit | 9b500e564a74f297567a791e77249c608ad39466 (patch) | |
tree | 86dbc7cbf649761d0c8391304b8b08d1232c5de2 /llvm/lib/ExecutionEngine/ExecutionEngine.cpp | |
parent | 8164f69e4cb4358d5b40c054175b92b6e5f2408f (diff) | |
download | llvm-9b500e564a74f297567a791e77249c608ad39466.zip llvm-9b500e564a74f297567a791e77249c608ad39466.tar.gz llvm-9b500e564a74f297567a791e77249c608ad39466.tar.bz2 |
[SVE] Remove calls to VectorType::getNumElements from ExecutionEngine
Reviewers: efriedma, lhames, sdesmalen, fpetrogalli
Reviewed By: lhames, sdesmalen
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82211
Diffstat (limited to 'llvm/lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp index 6b384f1..d8bd671 100644 --- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp @@ -9,6 +9,8 @@ // This file defines the common interface used by the various execution engine // subclasses. // +// FIXME: This file needs to be updated to support scalable vectors +// //===----------------------------------------------------------------------===// #include "llvm/ExecutionEngine/ExecutionEngine.h" @@ -624,10 +626,12 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) { } } break; - case Type::FixedVectorTyID: case Type::ScalableVectorTyID: + report_fatal_error( + "Scalable vector support not yet implemented in ExecutionEngine"); + case Type::FixedVectorTyID: // if the whole vector is 'undef' just reserve memory for the value. - auto *VTy = cast<VectorType>(C->getType()); + auto *VTy = cast<FixedVectorType>(C->getType()); Type *ElemTy = VTy->getElementType(); unsigned int elemNum = VTy->getNumElements(); Result.AggregateVal.resize(elemNum); @@ -915,8 +919,10 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) { else llvm_unreachable("Unknown constant pointer type!"); break; - case Type::FixedVectorTyID: - case Type::ScalableVectorTyID: { + case Type::ScalableVectorTyID: + report_fatal_error( + "Scalable vector support not yet implemented in ExecutionEngine"); + case Type::FixedVectorTyID: { unsigned elemNum; Type* ElemTy; const ConstantDataVector *CDV = dyn_cast<ConstantDataVector>(C); @@ -927,9 +933,9 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) { elemNum = CDV->getNumElements(); ElemTy = CDV->getElementType(); } else if (CV || CAZ) { - auto* VTy = cast<VectorType>(C->getType()); - elemNum = VTy->getNumElements(); - ElemTy = VTy->getElementType(); + auto *VTy = cast<FixedVectorType>(C->getType()); + elemNum = VTy->getNumElements(); + ElemTy = VTy->getElementType(); } else { llvm_unreachable("Unknown constant vector type!"); } @@ -1098,9 +1104,11 @@ void ExecutionEngine::LoadValueFromMemory(GenericValue &Result, Result.IntVal = APInt(80, y); break; } - case Type::FixedVectorTyID: - case Type::ScalableVectorTyID: { - auto *VT = cast<VectorType>(Ty); + case Type::ScalableVectorTyID: + report_fatal_error( + "Scalable vector support not yet implemented in ExecutionEngine"); + case Type::FixedVectorTyID: { + auto *VT = cast<FixedVectorType>(Ty); Type *ElemT = VT->getElementType(); const unsigned numElems = VT->getNumElements(); if (ElemT->isFloatTy()) { |