aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/ValueTypes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/ValueTypes.cpp')
-rw-r--r--llvm/lib/CodeGen/ValueTypes.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/ValueTypes.cpp b/llvm/lib/CodeGen/ValueTypes.cpp
index 0c42bef82005..f577aff39ea7 100644
--- a/llvm/lib/CodeGen/ValueTypes.cpp
+++ b/llvm/lib/CodeGen/ValueTypes.cpp
@@ -12,6 +12,7 @@
#include "llvm/IR/Type.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/TypeSize.h"
+#include "llvm/Support/WithColor.h"
using namespace llvm;
EVT EVT::changeExtendedTypeToInteger() const {
@@ -179,19 +180,22 @@ std::string EVT::getEVTString() const {
/// specified EVT. For integer types, this returns an unsigned type. Note
/// that this will abort for types that cannot be represented.
Type *EVT::getTypeForEVT(LLVMContext &Context) const {
+ // clang-format off
switch (V.SimpleTy) {
default:
assert(isExtended() && "Type is not extended!");
return LLVMTy;
case MVT::isVoid: return Type::getVoidTy(Context);
case MVT::i1: return Type::getInt1Ty(Context);
+ case MVT::i2: return Type::getIntNTy(Context, 2);
+ case MVT::i4: return Type::getIntNTy(Context, 4);
case MVT::i8: return Type::getInt8Ty(Context);
case MVT::i16: return Type::getInt16Ty(Context);
case MVT::i32: return Type::getInt32Ty(Context);
case MVT::i64: return Type::getInt64Ty(Context);
case MVT::i128: return IntegerType::get(Context, 128);
case MVT::f16: return Type::getHalfTy(Context);
- case MVT::bf16: return Type::getBFloatTy(Context);
+ case MVT::bf16: return Type::getBFloatTy(Context);
case MVT::f32: return Type::getFloatTy(Context);
case MVT::f64: return Type::getDoubleTy(Context);
case MVT::f80: return Type::getX86_FP80Ty(Context);
@@ -228,6 +232,10 @@ Type *EVT::getTypeForEVT(LLVMContext &Context) const {
return FixedVectorType::get(Type::getInt1Ty(Context), 512);
case MVT::v1024i1:
return FixedVectorType::get(Type::getInt1Ty(Context), 1024);
+ case MVT::v128i2:
+ return FixedVectorType::get(Type::getIntNTy(Context, 2), 128);
+ case MVT::v64i4:
+ return FixedVectorType::get(Type::getIntNTy(Context, 4), 64);
case MVT::v1i8:
return FixedVectorType::get(Type::getInt8Ty(Context), 1);
case MVT::v2i8:
@@ -500,6 +508,10 @@ Type *EVT::getTypeForEVT(LLVMContext &Context) const {
return ScalableVectorType::get(Type::getBFloatTy(Context), 4);
case MVT::nxv8bf16:
return ScalableVectorType::get(Type::getBFloatTy(Context), 8);
+ case MVT::nxv16bf16:
+ return ScalableVectorType::get(Type::getBFloatTy(Context), 16);
+ case MVT::nxv32bf16:
+ return ScalableVectorType::get(Type::getBFloatTy(Context), 32);
case MVT::nxv1f32:
return ScalableVectorType::get(Type::getFloatTy(Context), 1);
case MVT::nxv2f32:
@@ -520,6 +532,7 @@ Type *EVT::getTypeForEVT(LLVMContext &Context) const {
return ScalableVectorType::get(Type::getDoubleTy(Context), 8);
case MVT::Metadata: return Type::getMetadataTy(Context);
}
+ // clang-format on
}
/// Return the value type corresponding to the specified type. This returns all