1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

[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
This commit is contained in:
Christopher Tetreault 2020-06-30 10:56:36 -07:00
parent 4e74268d23
commit b0b0a7801d

View File

@ -9,6 +9,8 @@
// This file defines the common interface used by the various execution engine // This file defines the common interface used by the various execution engine
// subclasses. // subclasses.
// //
// FIXME: This file needs to be updated to support scalable vectors
//
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/ExecutionEngine.h"
@ -624,10 +626,12 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
} }
} }
break; break;
case Type::FixedVectorTyID:
case Type::ScalableVectorTyID: 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. // 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(); Type *ElemTy = VTy->getElementType();
unsigned int elemNum = VTy->getNumElements(); unsigned int elemNum = VTy->getNumElements();
Result.AggregateVal.resize(elemNum); Result.AggregateVal.resize(elemNum);
@ -915,8 +919,10 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
else else
llvm_unreachable("Unknown constant pointer type!"); llvm_unreachable("Unknown constant pointer type!");
break; 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; unsigned elemNum;
Type* ElemTy; Type* ElemTy;
const ConstantDataVector *CDV = dyn_cast<ConstantDataVector>(C); const ConstantDataVector *CDV = dyn_cast<ConstantDataVector>(C);
@ -927,7 +933,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
elemNum = CDV->getNumElements(); elemNum = CDV->getNumElements();
ElemTy = CDV->getElementType(); ElemTy = CDV->getElementType();
} else if (CV || CAZ) { } else if (CV || CAZ) {
auto* VTy = cast<VectorType>(C->getType()); auto *VTy = cast<FixedVectorType>(C->getType());
elemNum = VTy->getNumElements(); elemNum = VTy->getNumElements();
ElemTy = VTy->getElementType(); ElemTy = VTy->getElementType();
} else { } else {
@ -1098,9 +1104,11 @@ void ExecutionEngine::LoadValueFromMemory(GenericValue &Result,
Result.IntVal = APInt(80, y); Result.IntVal = APInt(80, y);
break; break;
} }
case Type::FixedVectorTyID: case Type::ScalableVectorTyID:
case Type::ScalableVectorTyID: { report_fatal_error(
auto *VT = cast<VectorType>(Ty); "Scalable vector support not yet implemented in ExecutionEngine");
case Type::FixedVectorTyID: {
auto *VT = cast<FixedVectorType>(Ty);
Type *ElemT = VT->getElementType(); Type *ElemT = VT->getElementType();
const unsigned numElems = VT->getNumElements(); const unsigned numElems = VT->getNumElements();
if (ElemT->isFloatTy()) { if (ElemT->isFloatTy()) {