Author: Christopher Tetreault
Date: 2020-04-22T08:59:01-07:00
New Revision: 2dea3f129878e929e5d1f00b91a622eb1ec8be4e
URL:
https://github.com/llvm/llvm-project/commit/2dea3f129878e929e5d1f00b91a622eb1ec8be4e
DIFF:
https://github.com/llvm/llvm-project/commit/2dea3f129878e929e5d1f00b91a622eb1ec8be4e.diff
LOG: [SVE] Add new VectorType subclasses
Summary:
Introduce new types for fixed width and scalable vectors.
Does not remove getNumElements yet so as to not break code during transition
period.
Reviewers: deadalnix, efriedma, sdesmalen, craig.topper, huntergr
Reviewed By: sdesmalen
Subscribers: jholewinski, arsenm, jvesely, nhaehnle, mehdi_amini, rriddle,
jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, csigg,
arpith-jacob, mgester, lucyrfox, liufengdb, kerbowa, Joonsoo, grosul1,
frgossen, lldb-commits, tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm, #lldb
Differential Revision: https://reviews.llvm.org/D77587
Added:
Modified:
lldb/source/Expression/IRInterpreter.cpp
llvm/include/llvm-c/Core.h
llvm/include/llvm/IR/DataLayout.h
llvm/include/llvm/IR/DerivedTypes.h
llvm/include/llvm/IR/Type.h
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/lib/CodeGen/ValueTypes.cpp
llvm/lib/ExecutionEngine/ExecutionEngine.cpp
llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
llvm/lib/IR/AsmWriter.cpp
llvm/lib/IR/Constants.cpp
llvm/lib/IR/Core.cpp
llvm/lib/IR/DataLayout.cpp
llvm/lib/IR/Type.cpp
llvm/lib/Linker/IRMover.cpp
llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp
llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
llvm/lib/Transforms/IPO/GlobalOpt.cpp
llvm/lib/Transforms/Utils/FunctionComparator.cpp
llvm/tools/llvm-c-test/echo.cpp
mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
Removed:
diff --git a/lldb/source/Expression/IRInterpreter.cpp
b/lldb/source/Expression/IRInterpreter.cpp
index 3ae843f69d70..ddb2d975d554 100644
--- a/lldb/source/Expression/IRInterpreter.cpp
+++ b/lldb/source/Expression/IRInterpreter.cpp
@@ -597,7 +597,8 @@ bool IRInterpreter::CanInterpret(llvm::Module &module,
llvm::Function &function,
switch (operand_type->getTypeID()) {
default:
break;
-case Type::VectorTyID: {
+case Type::FixedVectorTyID:
+case Type::ScalableVectorTyID: {
LLDB_LOGF(log, "Unsupported operand type: %s",
PrintType(operand_type).c_str());
error.SetErrorString(unsupported_operand_error);
diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h
index 852e16400f3a..2d6490dcbcf1 100644
--- a/llvm/include/llvm-c/Core.h
+++ b/llvm/include/llvm-c/Core.h
@@ -157,10 +157,11 @@ typedef enum {
LLVMStructTypeKind, /**< Structures */
LLVMArrayTypeKind, /**< Arrays */
LLVMPointerTypeKind, /**< Pointers */
- LLVMVectorTypeKind, /**< SIMD 'packed' format, or other vector type */
LLVMMetadataTypeKind,/**< Metadata */
LLVMX86_MMXTypeKind, /**< X86 MMX */
- LLVMTokenTypeKind/**< Tokens */
+ LLVMTokenTypeKind, /**< Tokens */
+ LLVMFixedVectorTypeKind, /**< Fixed width SIMD vector type */
+ LLVMScalableVectorTypeKind /**< Scalable SIMD vector type */
} LLVMTypeKind;
typedef enum {
diff --git a/llvm/include/llvm/IR/DataLayout.h
b/llvm/include/llvm/IR/DataLayout.h
index 98bdf30f5a46..010469c8107b 100644
--- a/llvm/include/llvm/IR/DataLayout.h
+++ b/llvm/include/llvm/IR/DataLayout.h
@@ -664,7 +664,8 @@ inline TypeSize DataLayout::getTypeSizeInBits(Type *Ty)
const {
// only 80 bits contain information.
case Type::X86_FP80TyID:
return TypeSize::Fixed(80);
- case Type::VectorTyID: {
+ case Type::FixedVectorTyID:
+ case Type::ScalableVectorTyID: {
VectorType *VTy = cast(Ty);
auto EltCnt = VTy->getElementCount();
uint64_t MinBits = EltCnt.Min *
diff --git a/llvm/include/llvm/IR/DerivedTypes.h
b/llvm/include/llvm/IR/DerivedTypes.h
index 306d388cb8a7..75c48f301026 100644
--- a/llvm/include/llvm/IR/DerivedTypes.h
+++ b/llvm/include/llvm/IR/DerivedTypes.h
@@ -386,7 +386,7 @@ uint64_t Type::getArrayNumElements() const {
return cast(this)->getNumElements();
}
-/// Class to represent vector types.
+/// Base class of all SIMD vector types
class VectorType : public Type {
/// A fully specified VectorType is of the form . 'n' is the
/// minimum number of elements of type Ty contained within the vector, and
@@ -403,24 +403,22 @@ class VectorType : public Type {
/// The element type of the vector.
Type *ContainedType;
- /// Minumum number of elements in the vector.
- uint64_t NumElements;
- VectorType(Type *ElType, unsigned NumEl, bool Scalable = false);
- VectorType(Type *ElType, ElementCount EC);
+ /// The