diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h b/mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h --- a/mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h +++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h @@ -14,6 +14,7 @@ #ifndef MLIR_DIALECT_LLVMIR_LLVMDIALECT_H_ #define MLIR_DIALECT_LLVMIR_LLVMDIALECT_H_ +#include "mlir/Dialect/LLVMIR/LLVMTypes.h" #include "mlir/IR/Dialect.h" #include "mlir/IR/Function.h" #include "mlir/IR/OpDefinition.h" @@ -47,187 +48,12 @@ struct LLVMDialectImpl; } // namespace detail -class LLVMType; - /// Converts an MLIR LLVM dialect type to LLVM IR type. Note that this function /// exists exclusively for the purpose of gradual transition to the first-party /// modeling of LLVM types. It should not be used outside MLIR-to-LLVM /// translation. llvm::Type *convertLLVMType(LLVMType type); -class LLVMType : public mlir::Type::TypeBase { -public: - enum Kind { - LLVM_TYPE = FIRST_LLVM_TYPE, - }; - - using Base::Base; - - static bool kindof(unsigned kind) { return kind == LLVM_TYPE; } - - LLVMDialect &getDialect(); - - /// Utilities to identify types. - bool isBFloatTy() { return getUnderlyingType()->isBFloatTy(); } - bool isHalfTy() { return getUnderlyingType()->isHalfTy(); } - bool isFloatTy() { return getUnderlyingType()->isFloatTy(); } - bool isDoubleTy() { return getUnderlyingType()->isDoubleTy(); } - bool isFloatingPointTy() { return getUnderlyingType()->isFloatingPointTy(); } - - /// Array type utilities. - LLVMType getArrayElementType(); - unsigned getArrayNumElements(); - bool isArrayTy(); - - /// Integer type utilities. - unsigned getIntegerBitWidth() { - return getUnderlyingType()->getIntegerBitWidth(); - } - bool isIntegerTy() { return getUnderlyingType()->isIntegerTy(); } - bool isIntegerTy(unsigned bitwidth) { - return getUnderlyingType()->isIntegerTy(bitwidth); - } - - /// Vector type utilities. - LLVMType getVectorElementType(); - unsigned getVectorNumElements(); - llvm::ElementCount getVectorElementCount(); - bool isVectorTy(); - - /// Function type utilities. - LLVMType getFunctionParamType(unsigned argIdx); - unsigned getFunctionNumParams(); - LLVMType getFunctionResultType(); - bool isFunctionTy(); - bool isFunctionVarArg(); - - /// Pointer type utilities. - LLVMType getPointerTo(unsigned addrSpace = 0); - LLVMType getPointerElementTy(); - bool isPointerTy(); - static bool isValidPointerElementType(LLVMType type); - - /// Struct type utilities. - LLVMType getStructElementType(unsigned i); - unsigned getStructNumElements(); - bool isStructTy(); - - /// Utilities used to generate floating point types. - static LLVMType getDoubleTy(LLVMDialect *dialect); - static LLVMType getFloatTy(LLVMDialect *dialect); - static LLVMType getBFloatTy(LLVMDialect *dialect); - static LLVMType getHalfTy(LLVMDialect *dialect); - static LLVMType getFP128Ty(LLVMDialect *dialect); - static LLVMType getX86_FP80Ty(LLVMDialect *dialect); - - /// Utilities used to generate integer types. - static LLVMType getIntNTy(LLVMDialect *dialect, unsigned numBits); - static LLVMType getInt1Ty(LLVMDialect *dialect) { - return getIntNTy(dialect, /*numBits=*/1); - } - static LLVMType getInt8Ty(LLVMDialect *dialect) { - return getIntNTy(dialect, /*numBits=*/8); - } - static LLVMType getInt8PtrTy(LLVMDialect *dialect) { - return getInt8Ty(dialect).getPointerTo(); - } - static LLVMType getInt16Ty(LLVMDialect *dialect) { - return getIntNTy(dialect, /*numBits=*/16); - } - static LLVMType getInt32Ty(LLVMDialect *dialect) { - return getIntNTy(dialect, /*numBits=*/32); - } - static LLVMType getInt64Ty(LLVMDialect *dialect) { - return getIntNTy(dialect, /*numBits=*/64); - } - - /// Utilities used to generate other miscellaneous types. - static LLVMType getArrayTy(LLVMType elementType, uint64_t numElements); - static LLVMType getFunctionTy(LLVMType result, ArrayRef params, - bool isVarArg); - static LLVMType getFunctionTy(LLVMType result, bool isVarArg) { - return getFunctionTy(result, llvm::None, isVarArg); - } - static LLVMType getStructTy(LLVMDialect *dialect, ArrayRef elements, - bool isPacked = false); - static LLVMType getStructTy(LLVMDialect *dialect, bool isPacked = false) { - return getStructTy(dialect, llvm::None, isPacked); - } - template - static typename std::enable_if::value, - LLVMType>::type - getStructTy(LLVMType elt1, Args... elts) { - SmallVector fields({elt1, elts...}); - return getStructTy(&elt1.getDialect(), fields); - } - static LLVMType getVectorTy(LLVMType elementType, unsigned numElements); - - /// Void type utilities. - static LLVMType getVoidTy(LLVMDialect *dialect); - bool isVoidTy(); - - // Creation and setting of LLVM's identified struct types - static LLVMType createStructTy(LLVMDialect *dialect, - ArrayRef elements, - Optional name, - bool isPacked = false); - - static LLVMType createStructTy(LLVMDialect *dialect, - Optional name) { - return createStructTy(dialect, llvm::None, name); - } - - static LLVMType createStructTy(ArrayRef elements, - Optional name, - bool isPacked = false) { - assert(!elements.empty() && - "This method may not be invoked with an empty list"); - LLVMType ele0 = elements.front(); - return createStructTy(&ele0.getDialect(), elements, name, isPacked); - } - - template - static typename std::enable_if_t::value, - LLVMType> - createStructTy(StringRef name, LLVMType elt1, Args... elts) { - SmallVector fields({elt1, elts...}); - Optional opt_name(name); - return createStructTy(&elt1.getDialect(), fields, opt_name); - } - - static LLVMType setStructTyBody(LLVMType structType, - ArrayRef elements, - bool isPacked = false); - - template - static typename std::enable_if_t::value, - LLVMType> - setStructTyBody(LLVMType structType, LLVMType elt1, Args... elts) { - SmallVector fields({elt1, elts...}); - return setStructTyBody(structType, fields); - } - -private: - friend LLVMDialect; - friend llvm::Type *convertLLVMType(LLVMType type); - - /// Get the underlying LLVM IR type. - llvm::Type *getUnderlyingType() const; - - /// Get the underlying LLVM IR types for the given array of types. - static void getUnderlyingTypes(ArrayRef types, - SmallVectorImpl &result); - - /// Get an LLVMType with a pre-existing llvm type. - static LLVMType get(MLIRContext *context, llvm::Type *llvmType); - - /// Get an LLVMType with an llvm type that may cause changes to the underlying - /// llvm context when constructed. - static LLVMType getLocked(LLVMDialect *dialect, - function_ref typeBuilder); -}; - ///// Ops ///// #define GET_OP_CLASSES #include "mlir/Dialect/LLVMIR/LLVMOps.h.inc" diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h b/mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h --- a/mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h +++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h @@ -43,7 +43,7 @@ class LLVMIntegerType; //===----------------------------------------------------------------------===// -// LLVMTypeNew. +// LLVMType. //===----------------------------------------------------------------------===// /// Base class for LLVM dialect types. @@ -61,7 +61,7 @@ /// Similarly to other MLIR types, LLVM dialect types are owned by the MLIR /// context, have an immutable identifier (for most types except identified /// structs, the entire type is the identifier) and are thread-safe. -class LLVMTypeNew : public Type::TypeBase { +class LLVMType : public Type::TypeBase { public: enum Kind { // Keep non-parametric types contiguous in the enum. @@ -96,8 +96,8 @@ /// Support for PointerLikeTypeTraits. using Type::getAsOpaquePointer; - static LLVMTypeNew getFromOpaquePointer(const void *ptr) { - return LLVMTypeNew(static_cast(const_cast(ptr))); + static LLVMType getFromOpaquePointer(const void *ptr) { + return LLVMType(static_cast(const_cast(ptr))); } /// Support for isa/cast. @@ -118,7 +118,7 @@ } /// Array type utilities. - LLVMTypeNew getArrayElementType(); + LLVMType getArrayElementType(); unsigned getArrayNumElements(); bool isArrayTy(); @@ -128,124 +128,121 @@ unsigned getIntegerBitWidth(); /// Vector type utilities. - LLVMTypeNew getVectorElementType(); + LLVMType getVectorElementType(); unsigned getVectorNumElements(); llvm::ElementCount getVectorElementCount(); bool isVectorTy(); /// Function type utilities. - LLVMTypeNew getFunctionParamType(unsigned argIdx); + LLVMType getFunctionParamType(unsigned argIdx); unsigned getFunctionNumParams(); - LLVMTypeNew getFunctionResultType(); + LLVMType getFunctionResultType(); bool isFunctionTy(); bool isFunctionVarArg(); /// Pointer type utilities. - LLVMTypeNew getPointerTo(unsigned addrSpace = 0); - LLVMTypeNew getPointerElementTy(); + LLVMType getPointerTo(unsigned addrSpace = 0); + LLVMType getPointerElementTy(); bool isPointerTy(); - static bool isValidPointerElementType(LLVMTypeNew type); + static bool isValidPointerElementType(LLVMType type); /// Struct type utilities. - LLVMTypeNew getStructElementType(unsigned i); + LLVMType getStructElementType(unsigned i); unsigned getStructNumElements(); bool isStructTy(); /// Utilities used to generate floating point types. - static LLVMTypeNew getDoubleTy(LLVMDialect *dialect); - static LLVMTypeNew getFloatTy(LLVMDialect *dialect); - static LLVMTypeNew getBFloatTy(LLVMDialect *dialect); - static LLVMTypeNew getHalfTy(LLVMDialect *dialect); - static LLVMTypeNew getFP128Ty(LLVMDialect *dialect); - static LLVMTypeNew getX86_FP80Ty(LLVMDialect *dialect); + static LLVMType getDoubleTy(LLVMDialect *dialect); + static LLVMType getFloatTy(LLVMDialect *dialect); + static LLVMType getBFloatTy(LLVMDialect *dialect); + static LLVMType getHalfTy(LLVMDialect *dialect); + static LLVMType getFP128Ty(LLVMDialect *dialect); + static LLVMType getX86_FP80Ty(LLVMDialect *dialect); /// Utilities used to generate integer types. - static LLVMTypeNew getIntNTy(LLVMDialect *dialect, unsigned numBits); - static LLVMTypeNew getInt1Ty(LLVMDialect *dialect) { + static LLVMType getIntNTy(LLVMDialect *dialect, unsigned numBits); + static LLVMType getInt1Ty(LLVMDialect *dialect) { return getIntNTy(dialect, /*numBits=*/1); } - static LLVMTypeNew getInt8Ty(LLVMDialect *dialect) { + static LLVMType getInt8Ty(LLVMDialect *dialect) { return getIntNTy(dialect, /*numBits=*/8); } - static LLVMTypeNew getInt8PtrTy(LLVMDialect *dialect) { + static LLVMType getInt8PtrTy(LLVMDialect *dialect) { return getInt8Ty(dialect).getPointerTo(); } - static LLVMTypeNew getInt16Ty(LLVMDialect *dialect) { + static LLVMType getInt16Ty(LLVMDialect *dialect) { return getIntNTy(dialect, /*numBits=*/16); } - static LLVMTypeNew getInt32Ty(LLVMDialect *dialect) { + static LLVMType getInt32Ty(LLVMDialect *dialect) { return getIntNTy(dialect, /*numBits=*/32); } - static LLVMTypeNew getInt64Ty(LLVMDialect *dialect) { + static LLVMType getInt64Ty(LLVMDialect *dialect) { return getIntNTy(dialect, /*numBits=*/64); } /// Utilities used to generate other miscellaneous types. - static LLVMTypeNew getArrayTy(LLVMTypeNew elementType, uint64_t numElements); - static LLVMTypeNew getFunctionTy(LLVMTypeNew result, - ArrayRef params, bool isVarArg); - static LLVMTypeNew getFunctionTy(LLVMTypeNew result, bool isVarArg) { + static LLVMType getArrayTy(LLVMType elementType, uint64_t numElements); + static LLVMType getFunctionTy(LLVMType result, ArrayRef params, + bool isVarArg); + static LLVMType getFunctionTy(LLVMType result, bool isVarArg) { return getFunctionTy(result, llvm::None, isVarArg); } - static LLVMTypeNew getStructTy(LLVMDialect *dialect, - ArrayRef elements, - bool isPacked = false); - static LLVMTypeNew getStructTy(LLVMDialect *dialect, bool isPacked = false) { + static LLVMType getStructTy(LLVMDialect *dialect, ArrayRef elements, + bool isPacked = false); + static LLVMType getStructTy(LLVMDialect *dialect, bool isPacked = false) { return getStructTy(dialect, llvm::None, isPacked); } template - static typename std::enable_if::value, - LLVMTypeNew>::type - getStructTy(LLVMTypeNew elt1, Args... elts) { - SmallVector fields({elt1, elts...}); + static typename std::enable_if::value, + LLVMType>::type + getStructTy(LLVMType elt1, Args... elts) { + SmallVector fields({elt1, elts...}); return getStructTy(&elt1.getDialect(), fields); } - static LLVMTypeNew getVectorTy(LLVMTypeNew elementType, unsigned numElements); + static LLVMType getVectorTy(LLVMType elementType, unsigned numElements); /// Void type utilities. - static LLVMTypeNew getVoidTy(LLVMDialect *dialect); + static LLVMType getVoidTy(LLVMDialect *dialect); bool isVoidTy(); // Creation and setting of LLVM's identified struct types - static LLVMTypeNew createStructTy(LLVMDialect *dialect, - ArrayRef elements, - Optional name, - bool isPacked = false); + static LLVMType createStructTy(LLVMDialect *dialect, + ArrayRef elements, + Optional name, + bool isPacked = false); - static LLVMTypeNew createStructTy(LLVMDialect *dialect, - Optional name) { + static LLVMType createStructTy(LLVMDialect *dialect, + Optional name) { return createStructTy(dialect, llvm::None, name); } - static LLVMTypeNew createStructTy(ArrayRef elements, - Optional name, - bool isPacked = false) { + static LLVMType createStructTy(ArrayRef elements, + Optional name, + bool isPacked = false) { assert(!elements.empty() && "This method may not be invoked with an empty list"); - LLVMTypeNew ele0 = elements.front(); + LLVMType ele0 = elements.front(); return createStructTy(&ele0.getDialect(), elements, name, isPacked); } template - static - typename std::enable_if_t::value, - LLVMTypeNew> - createStructTy(StringRef name, LLVMTypeNew elt1, Args... elts) { - SmallVector fields({elt1, elts...}); + static typename std::enable_if_t::value, + LLVMType> + createStructTy(StringRef name, LLVMType elt1, Args... elts) { + SmallVector fields({elt1, elts...}); Optional opt_name(name); return createStructTy(&elt1.getDialect(), fields, opt_name); } - static LLVMTypeNew setStructTyBody(LLVMTypeNew structType, - ArrayRef elements, - bool isPacked = false); + static LLVMType setStructTyBody(LLVMType structType, + ArrayRef elements, + bool isPacked = false); template - static - typename std::enable_if_t::value, - LLVMTypeNew> - setStructTyBody(LLVMTypeNew structType, LLVMTypeNew elt1, Args... elts) { - SmallVector fields({elt1, elts...}); + static typename std::enable_if_t::value, + LLVMType> + setStructTyBody(LLVMType structType, LLVMType elt1, Args... elts) { + SmallVector fields({elt1, elts...}); return setStructTyBody(structType, fields); } }; @@ -256,8 +253,7 @@ // Batch-define trivial types. #define DEFINE_TRIVIAL_LLVM_TYPE(ClassName, Kind) \ - class ClassName \ - : public Type::TypeBase { \ + class ClassName : public Type::TypeBase { \ public: \ using Base::Base; \ static bool kindof(unsigned kind) { return kind == Kind; } \ @@ -266,18 +262,18 @@ } \ } -DEFINE_TRIVIAL_LLVM_TYPE(LLVMVoidType, LLVMTypeNew::VoidType); -DEFINE_TRIVIAL_LLVM_TYPE(LLVMHalfType, LLVMTypeNew::HalfType); -DEFINE_TRIVIAL_LLVM_TYPE(LLVMBFloatType, LLVMTypeNew::BFloatType); -DEFINE_TRIVIAL_LLVM_TYPE(LLVMFloatType, LLVMTypeNew::FloatType); -DEFINE_TRIVIAL_LLVM_TYPE(LLVMDoubleType, LLVMTypeNew::DoubleType); -DEFINE_TRIVIAL_LLVM_TYPE(LLVMFP128Type, LLVMTypeNew::FP128Type); -DEFINE_TRIVIAL_LLVM_TYPE(LLVMX86FP80Type, LLVMTypeNew::X86FP80Type); -DEFINE_TRIVIAL_LLVM_TYPE(LLVMPPCFP128Type, LLVMTypeNew::PPCFP128Type); -DEFINE_TRIVIAL_LLVM_TYPE(LLVMX86MMXType, LLVMTypeNew::X86MMXType); -DEFINE_TRIVIAL_LLVM_TYPE(LLVMTokenType, LLVMTypeNew::TokenType); -DEFINE_TRIVIAL_LLVM_TYPE(LLVMLabelType, LLVMTypeNew::LabelType); -DEFINE_TRIVIAL_LLVM_TYPE(LLVMMetadataType, LLVMTypeNew::MetadataType); +DEFINE_TRIVIAL_LLVM_TYPE(LLVMVoidType, LLVMType::VoidType); +DEFINE_TRIVIAL_LLVM_TYPE(LLVMHalfType, LLVMType::HalfType); +DEFINE_TRIVIAL_LLVM_TYPE(LLVMBFloatType, LLVMType::BFloatType); +DEFINE_TRIVIAL_LLVM_TYPE(LLVMFloatType, LLVMType::FloatType); +DEFINE_TRIVIAL_LLVM_TYPE(LLVMDoubleType, LLVMType::DoubleType); +DEFINE_TRIVIAL_LLVM_TYPE(LLVMFP128Type, LLVMType::FP128Type); +DEFINE_TRIVIAL_LLVM_TYPE(LLVMX86FP80Type, LLVMType::X86FP80Type); +DEFINE_TRIVIAL_LLVM_TYPE(LLVMPPCFP128Type, LLVMType::PPCFP128Type); +DEFINE_TRIVIAL_LLVM_TYPE(LLVMX86MMXType, LLVMType::X86MMXType); +DEFINE_TRIVIAL_LLVM_TYPE(LLVMTokenType, LLVMType::TokenType); +DEFINE_TRIVIAL_LLVM_TYPE(LLVMLabelType, LLVMType::LabelType); +DEFINE_TRIVIAL_LLVM_TYPE(LLVMMetadataType, LLVMType::MetadataType); #undef DEFINE_TRIVIAL_LLVM_TYPE @@ -288,21 +284,21 @@ /// LLVM dialect array type. It is an aggregate type representing consecutive /// elements in memory, parameterized by the number of elements and the element /// type. -class LLVMArrayType : public Type::TypeBase { public: /// Inherit base constructors. using Base::Base; /// Support for isa/cast. - static bool kindof(unsigned kind) { return kind == LLVMTypeNew::ArrayType; } + static bool kindof(unsigned kind) { return kind == LLVMType::ArrayType; } /// Gets or creates an instance of LLVM dialect array type containing /// `numElements` of `elementType`, in the same context as `elementType`. - static LLVMArrayType get(LLVMTypeNew elementType, unsigned numElements); + static LLVMArrayType get(LLVMType elementType, unsigned numElements); /// Returns the element type of the array. - LLVMTypeNew getElementType(); + LLVMType getElementType(); /// Returns the number of elements in the array type. unsigned getNumElements(); @@ -316,38 +312,35 @@ /// which can have multiple), a list of parameter types and can optionally be /// variadic. class LLVMFunctionType - : public Type::TypeBase { public: /// Inherit base constructors. using Base::Base; /// Support for isa/cast. - static bool kindof(unsigned kind) { - return kind == LLVMTypeNew::FunctionType; - } + static bool kindof(unsigned kind) { return kind == LLVMType::FunctionType; } /// Gets or creates an instance of LLVM dialect function in the same context /// as the `result` type. - static LLVMFunctionType get(LLVMTypeNew result, - ArrayRef arguments, + static LLVMFunctionType get(LLVMType result, ArrayRef arguments, bool isVarArg = false); /// Returns the result type of the function. - LLVMTypeNew getReturnType(); + LLVMType getReturnType(); /// Returns the number of arguments to the function. unsigned getNumParams(); /// Returns `i`-th argument of the function. Asserts on out-of-bounds. - LLVMTypeNew getParamType(unsigned i); + LLVMType getParamType(unsigned i); /// Returns whether the function is variadic. bool isVarArg(); /// Returns a list of argument types of the function. - ArrayRef getParams(); - ArrayRef params() { return getParams(); } + ArrayRef getParams(); + ArrayRef params() { return getParams(); } }; //===----------------------------------------------------------------------===// @@ -355,14 +348,14 @@ //===----------------------------------------------------------------------===// /// LLVM dialect signless integer type parameterized by bitwidth. -class LLVMIntegerType : public Type::TypeBase { public: /// Inherit base constructor. using Base::Base; /// Support for isa/cast. - static bool kindof(unsigned kind) { return kind == LLVMTypeNew::IntegerType; } + static bool kindof(unsigned kind) { return kind == LLVMType::IntegerType; } /// Gets or creates an instance of the integer of the specified `bitwidth` in /// the given context. @@ -379,22 +372,22 @@ /// LLVM dialect pointer type. This type typically represents a reference to an /// object in memory. It is parameterized by the element type and the address /// space. -class LLVMPointerType : public Type::TypeBase { public: /// Inherit base constructors. using Base::Base; /// Support for isa/cast. - static bool kindof(unsigned kind) { return kind == LLVMTypeNew::PointerType; } + static bool kindof(unsigned kind) { return kind == LLVMType::PointerType; } /// Gets or creates an instance of LLVM dialect pointer type pointing to an /// object of `pointee` type in the given address space. The pointer type is /// created in the same context as `pointee`. - static LLVMPointerType get(LLVMTypeNew pointee, unsigned addressSpace = 0); + static LLVMPointerType get(LLVMType pointee, unsigned addressSpace = 0); /// Returns the pointed-to type. - LLVMTypeNew getElementType(); + LLVMType getElementType(); /// Returns the address space of the pointer. unsigned getAddressSpace(); @@ -428,14 +421,14 @@ /// /// Note that the packedness of the struct takes place in uniquing of literal /// structs, but does not in uniquing of identified structs. -class LLVMStructType : public Type::TypeBase { public: /// Inherit base construtors. using Base::Base; /// Support for isa/cast. - static bool kindof(unsigned kind) { return kind == LLVMTypeNew::StructType; } + static bool kindof(unsigned kind) { return kind == LLVMType::StructType; } /// Gets or creates an identified struct with the given name in the provided /// context. Note that unlike llvm::StructType::create, this function will @@ -447,7 +440,7 @@ /// Gets or creates a literal struct with the given body in the provided /// context. static LLVMStructType getLiteral(MLIRContext *context, - ArrayRef types, + ArrayRef types, bool isPacked = false); /// Gets or creates an intentionally-opaque identified struct. Such a struct @@ -464,7 +457,7 @@ /// different thread modified the struct after it was created. Most callers /// are likely to assert this always succeeds, but it is possible to implement /// a local renaming scheme based on the result of this call. - LogicalResult setBody(ArrayRef types, bool isPacked); + LogicalResult setBody(ArrayRef types, bool isPacked); /// Checks if a struct is packed. bool isPacked(); @@ -482,7 +475,7 @@ StringRef getName(); /// Returns the list of element types contained in a non-opaque struct. - ArrayRef getBody(); + ArrayRef getBody(); }; //===----------------------------------------------------------------------===// @@ -492,7 +485,7 @@ /// LLVM dialect vector type, represents a sequence of elements that can be /// processed as one, typically in SIMD context. This is a base class for fixed /// and scalable vectors. -class LLVMVectorType : public Type::TypeBase { public: /// Inherit base constructor. @@ -500,12 +493,12 @@ /// Support for isa/cast. static bool kindof(unsigned kind) { - return kind == LLVMTypeNew::FixedVectorType || - kind == LLVMTypeNew::ScalableVectorType; + return kind == LLVMType::FixedVectorType || + kind == LLVMType::ScalableVectorType; } /// Returns the element type of the vector. - LLVMTypeNew getElementType(); + LLVMType getElementType(); /// Returns the number of elements in the vector. llvm::ElementCount getElementCount(); @@ -526,12 +519,12 @@ /// Support for isa/cast. static bool kindof(unsigned kind) { - return kind == LLVMTypeNew::FixedVectorType; + return kind == LLVMType::FixedVectorType; } /// Gets or creates a fixed vector type containing `numElements` of /// `elementType` in the same context as `elementType`. - static LLVMFixedVectorType get(LLVMTypeNew elementType, unsigned numElements); + static LLVMFixedVectorType get(LLVMType elementType, unsigned numElements); /// Returns the number of elements in the fixed vector. unsigned getNumElements(); @@ -553,12 +546,12 @@ /// Support for isa/cast. static bool kindof(unsigned kind) { - return kind == LLVMTypeNew::ScalableVectorType; + return kind == LLVMType::ScalableVectorType; } /// Gets or creates a scalable vector type containing a non-zero multiple of /// `minNumElements` of `elementType` in the same context as `elementType`. - static LLVMScalableVectorType get(LLVMTypeNew elementType, + static LLVMScalableVectorType get(LLVMType elementType, unsigned minNumElements); /// Returns the scaling factor of the number of elements in the vector. The @@ -573,10 +566,10 @@ namespace detail { /// Parses an LLVM dialect type. -LLVMTypeNew parseType(DialectAsmParser &parser); +LLVMType parseType(DialectAsmParser &parser); /// Prints an LLVM Dialect type. -void printType(LLVMTypeNew type, DialectAsmPrinter &printer); +void printType(LLVMType type, DialectAsmPrinter &printer); } // namespace detail } // namespace LLVM @@ -588,34 +581,35 @@ namespace llvm { -// LLVMTypeNew instances hash just like pointers. -template <> struct DenseMapInfo { - static mlir::LLVM::LLVMTypeNew getEmptyKey() { +// LLVMType instances hash just like pointers. +template <> +struct DenseMapInfo { + static mlir::LLVM::LLVMType getEmptyKey() { void *pointer = llvm::DenseMapInfo::getEmptyKey(); - return mlir::LLVM::LLVMTypeNew( - static_cast(pointer)); + return mlir::LLVM::LLVMType( + static_cast(pointer)); } - static mlir::LLVM::LLVMTypeNew getTombstoneKey() { + static mlir::LLVM::LLVMType getTombstoneKey() { void *pointer = llvm::DenseMapInfo::getTombstoneKey(); - return mlir::LLVM::LLVMTypeNew( - static_cast(pointer)); + return mlir::LLVM::LLVMType( + static_cast(pointer)); } - static unsigned getHashValue(mlir::LLVM::LLVMTypeNew val) { + static unsigned getHashValue(mlir::LLVM::LLVMType val) { return mlir::hash_value(val); } - static bool isEqual(mlir::LLVM::LLVMTypeNew lhs, - mlir::LLVM::LLVMTypeNew rhs) { + static bool isEqual(mlir::LLVM::LLVMType lhs, mlir::LLVM::LLVMType rhs) { return lhs == rhs; } }; -// LLVMTypeNew behaves like a pointer similarly to mlir::Type. -template <> struct PointerLikeTypeTraits { - static inline void *getAsVoidPointer(mlir::LLVM::LLVMTypeNew type) { +// LLVMType behaves like a pointer similarly to mlir::Type. +template <> +struct PointerLikeTypeTraits { + static inline void *getAsVoidPointer(mlir::LLVM::LLVMType type) { return const_cast(type.getAsOpaquePointer()); } - static inline mlir::LLVM::LLVMTypeNew getFromVoidPointer(void *ptr) { - return mlir::LLVM::LLVMTypeNew::getFromOpaquePointer(ptr); + static inline mlir::LLVM::LLVMType getFromVoidPointer(void *ptr) { + return mlir::LLVM::LLVMType::getFromOpaquePointer(ptr); } static constexpr int NumLowBitsAvailable = PointerLikeTypeTraits::NumLowBitsAvailable; diff --git a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td --- a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td +++ b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td @@ -112,7 +112,8 @@ if (!type.isStructTy() || type.getStructNumElements() != 2 || !type.getStructElementType(1).isIntegerTy( /*Bitwidth=*/1)) - return emitError("expected return type !llvm<\"{ ?, i1 }\">"); + return emitError("expected return type to be a two-element struct with " + "i1 as the second element"); return success(); }]; } diff --git a/mlir/include/mlir/Target/LLVMIR/TypeTranslation.h b/mlir/include/mlir/Target/LLVMIR/TypeTranslation.h --- a/mlir/include/mlir/Target/LLVMIR/TypeTranslation.h +++ b/mlir/include/mlir/Target/LLVMIR/TypeTranslation.h @@ -25,10 +25,10 @@ namespace LLVM { -class LLVMTypeNew; +class LLVMType; -llvm::Type *translateTypeToLLVMIR(LLVMTypeNew type, llvm::LLVMContext &context); -LLVMTypeNew translateTypeFromLLVMIR(llvm::Type *type, MLIRContext &context); +llvm::Type *translateTypeToLLVMIR(LLVMType type, llvm::LLVMContext &context); +LLVMType translateTypeFromLLVMIR(llvm::Type *type, MLIRContext &context); } // namespace LLVM } // namespace mlir diff --git a/mlir/integration_test/Dialect/LLVMIR/CPU/test-vector-reductions-fp.mlir b/mlir/integration_test/Dialect/LLVMIR/CPU/test-vector-reductions-fp.mlir --- a/mlir/integration_test/Dialect/LLVMIR/CPU/test-vector-reductions-fp.mlir +++ b/mlir/integration_test/Dialect/LLVMIR/CPU/test-vector-reductions-fp.mlir @@ -12,74 +12,74 @@ %1 = llvm.mlir.constant(2.000000e+00 : f32) : !llvm.float %2 = llvm.mlir.constant(3.000000e+00 : f32) : !llvm.float %3 = llvm.mlir.constant(4.000000e+00 : f32) : !llvm.float - %4 = llvm.mlir.undef : !llvm<"<4 x float>"> + %4 = llvm.mlir.undef : !llvm.vec<4 x float> %5 = llvm.mlir.constant(0 : index) : !llvm.i64 - %6 = llvm.insertelement %0, %4[%5 : !llvm.i64] : !llvm<"<4 x float>"> + %6 = llvm.insertelement %0, %4[%5 : !llvm.i64] : !llvm.vec<4 x float> %7 = llvm.shufflevector %6, %4 [0 : i32, 0 : i32, 0 : i32, 0 : i32] - : !llvm<"<4 x float>">, !llvm<"<4 x float>"> + : !llvm.vec<4 x float>, !llvm.vec<4 x float> %8 = llvm.mlir.constant(1 : i64) : !llvm.i64 - %9 = llvm.insertelement %1, %7[%8 : !llvm.i64] : !llvm<"<4 x float>"> + %9 = llvm.insertelement %1, %7[%8 : !llvm.i64] : !llvm.vec<4 x float> %10 = llvm.mlir.constant(2 : i64) : !llvm.i64 - %11 = llvm.insertelement %2, %9[%10 : !llvm.i64] : !llvm<"<4 x float>"> + %11 = llvm.insertelement %2, %9[%10 : !llvm.i64] : !llvm.vec<4 x float> %12 = llvm.mlir.constant(3 : i64) : !llvm.i64 - %v = llvm.insertelement %3, %11[%12 : !llvm.i64] : !llvm<"<4 x float>"> + %v = llvm.insertelement %3, %11[%12 : !llvm.i64] : !llvm.vec<4 x float> %max = "llvm.intr.experimental.vector.reduce.fmax"(%v) - : (!llvm<"<4 x float>">) -> !llvm.float + : (!llvm.vec<4 x float>) -> !llvm.float llvm.call @print_f32(%max) : (!llvm.float) -> () llvm.call @print_newline() : () -> () // CHECK: 4 %min = "llvm.intr.experimental.vector.reduce.fmin"(%v) - : (!llvm<"<4 x float>">) -> !llvm.float + : (!llvm.vec<4 x float>) -> !llvm.float llvm.call @print_f32(%min) : (!llvm.float) -> () llvm.call @print_newline() : () -> () // CHECK: 1 %add1 = "llvm.intr.experimental.vector.reduce.v2.fadd"(%0, %v) - : (!llvm.float, !llvm<"<4 x float>">) -> !llvm.float + : (!llvm.float, !llvm.vec<4 x float>) -> !llvm.float llvm.call @print_f32(%add1) : (!llvm.float) -> () llvm.call @print_newline() : () -> () // CHECK: 11 %add1r = "llvm.intr.experimental.vector.reduce.v2.fadd"(%0, %v) - {reassoc = true} : (!llvm.float, !llvm<"<4 x float>">) -> !llvm.float + {reassoc = true} : (!llvm.float, !llvm.vec<4 x float>) -> !llvm.float llvm.call @print_f32(%add1r) : (!llvm.float) -> () llvm.call @print_newline() : () -> () // CHECK: 11 %add2 = "llvm.intr.experimental.vector.reduce.v2.fadd"(%1, %v) - : (!llvm.float, !llvm<"<4 x float>">) -> !llvm.float + : (!llvm.float, !llvm.vec<4 x float>) -> !llvm.float llvm.call @print_f32(%add2) : (!llvm.float) -> () llvm.call @print_newline() : () -> () // CHECK: 12 %add2r = "llvm.intr.experimental.vector.reduce.v2.fadd"(%1, %v) - {reassoc = true} : (!llvm.float, !llvm<"<4 x float>">) -> !llvm.float + {reassoc = true} : (!llvm.float, !llvm.vec<4 x float>) -> !llvm.float llvm.call @print_f32(%add2r) : (!llvm.float) -> () llvm.call @print_newline() : () -> () // CHECK: 12 %mul1 = "llvm.intr.experimental.vector.reduce.v2.fmul"(%0, %v) - : (!llvm.float, !llvm<"<4 x float>">) -> !llvm.float + : (!llvm.float, !llvm.vec<4 x float>) -> !llvm.float llvm.call @print_f32(%mul1) : (!llvm.float) -> () llvm.call @print_newline() : () -> () // CHECK: 24 %mul1r = "llvm.intr.experimental.vector.reduce.v2.fmul"(%0, %v) - {reassoc = true} : (!llvm.float, !llvm<"<4 x float>">) -> !llvm.float + {reassoc = true} : (!llvm.float, !llvm.vec<4 x float>) -> !llvm.float llvm.call @print_f32(%mul1r) : (!llvm.float) -> () llvm.call @print_newline() : () -> () // CHECK: 24 %mul2 = "llvm.intr.experimental.vector.reduce.v2.fmul"(%1, %v) - : (!llvm.float, !llvm<"<4 x float>">) -> !llvm.float + : (!llvm.float, !llvm.vec<4 x float>) -> !llvm.float llvm.call @print_f32(%mul2) : (!llvm.float) -> () llvm.call @print_newline() : () -> () // CHECK: 48 %mul2r = "llvm.intr.experimental.vector.reduce.v2.fmul"(%1, %v) - {reassoc = true} : (!llvm.float, !llvm<"<4 x float>">) -> !llvm.float + {reassoc = true} : (!llvm.float, !llvm.vec<4 x float>) -> !llvm.float llvm.call @print_f32(%mul2r) : (!llvm.float) -> () llvm.call @print_newline() : () -> () // CHECK: 48 diff --git a/mlir/integration_test/Dialect/LLVMIR/CPU/test-vector-reductions-int.mlir b/mlir/integration_test/Dialect/LLVMIR/CPU/test-vector-reductions-int.mlir --- a/mlir/integration_test/Dialect/LLVMIR/CPU/test-vector-reductions-int.mlir +++ b/mlir/integration_test/Dialect/LLVMIR/CPU/test-vector-reductions-int.mlir @@ -12,68 +12,68 @@ %1 = llvm.mlir.constant(2 : i32) : !llvm.i32 %2 = llvm.mlir.constant(3 : i32) : !llvm.i32 %3 = llvm.mlir.constant(4 : i32) : !llvm.i32 - %4 = llvm.mlir.undef : !llvm<"<4 x i32>"> + %4 = llvm.mlir.undef : !llvm.vec<4 x i32> %5 = llvm.mlir.constant(0 : index) : !llvm.i64 - %6 = llvm.insertelement %0, %4[%5 : !llvm.i64] : !llvm<"<4 x i32>"> + %6 = llvm.insertelement %0, %4[%5 : !llvm.i64] : !llvm.vec<4 x i32> %7 = llvm.shufflevector %6, %4 [0 : i32, 0 : i32, 0 : i32, 0 : i32] - : !llvm<"<4 x i32>">, !llvm<"<4 x i32>"> + : !llvm.vec<4 x i32>, !llvm.vec<4 x i32> %8 = llvm.mlir.constant(1 : i64) : !llvm.i64 - %9 = llvm.insertelement %1, %7[%8 : !llvm.i64] : !llvm<"<4 x i32>"> + %9 = llvm.insertelement %1, %7[%8 : !llvm.i64] : !llvm.vec<4 x i32> %10 = llvm.mlir.constant(2 : i64) : !llvm.i64 - %11 = llvm.insertelement %2, %9[%10 : !llvm.i64] : !llvm<"<4 x i32>"> + %11 = llvm.insertelement %2, %9[%10 : !llvm.i64] : !llvm.vec<4 x i32> %12 = llvm.mlir.constant(3 : i64) : !llvm.i64 - %v = llvm.insertelement %3, %11[%12 : !llvm.i64] : !llvm<"<4 x i32>"> + %v = llvm.insertelement %3, %11[%12 : !llvm.i64] : !llvm.vec<4 x i32> %add = "llvm.intr.experimental.vector.reduce.add"(%v) - : (!llvm<"<4 x i32>">) -> !llvm.i32 + : (!llvm.vec<4 x i32>) -> !llvm.i32 llvm.call @print_i32(%add) : (!llvm.i32) -> () llvm.call @print_newline() : () -> () // CHECK: 10 %and = "llvm.intr.experimental.vector.reduce.and"(%v) - : (!llvm<"<4 x i32>">) -> !llvm.i32 + : (!llvm.vec<4 x i32>) -> !llvm.i32 llvm.call @print_i32(%and) : (!llvm.i32) -> () llvm.call @print_newline() : () -> () // CHECK: 0 %mul = "llvm.intr.experimental.vector.reduce.mul"(%v) - : (!llvm<"<4 x i32>">) -> !llvm.i32 + : (!llvm.vec<4 x i32>) -> !llvm.i32 llvm.call @print_i32(%mul) : (!llvm.i32) -> () llvm.call @print_newline() : () -> () // CHECK: 24 %or = "llvm.intr.experimental.vector.reduce.or"(%v) - : (!llvm<"<4 x i32>">) -> !llvm.i32 + : (!llvm.vec<4 x i32>) -> !llvm.i32 llvm.call @print_i32(%or) : (!llvm.i32) -> () llvm.call @print_newline() : () -> () // CHECK: 7 %smax = "llvm.intr.experimental.vector.reduce.smax"(%v) - : (!llvm<"<4 x i32>">) -> !llvm.i32 + : (!llvm.vec<4 x i32>) -> !llvm.i32 llvm.call @print_i32(%smax) : (!llvm.i32) -> () llvm.call @print_newline() : () -> () // CHECK: 4 %smin = "llvm.intr.experimental.vector.reduce.smin"(%v) - : (!llvm<"<4 x i32>">) -> !llvm.i32 + : (!llvm.vec<4 x i32>) -> !llvm.i32 llvm.call @print_i32(%smin) : (!llvm.i32) -> () llvm.call @print_newline() : () -> () // CHECK: 1 %umax = "llvm.intr.experimental.vector.reduce.umax"(%v) - : (!llvm<"<4 x i32>">) -> !llvm.i32 + : (!llvm.vec<4 x i32>) -> !llvm.i32 llvm.call @print_i32(%umax) : (!llvm.i32) -> () llvm.call @print_newline() : () -> () // CHECK: 4 %umin = "llvm.intr.experimental.vector.reduce.umin"(%v) - : (!llvm<"<4 x i32>">) -> !llvm.i32 + : (!llvm.vec<4 x i32>) -> !llvm.i32 llvm.call @print_i32(%umin) : (!llvm.i32) -> () llvm.call @print_newline() : () -> () // CHECK: 1 %xor = "llvm.intr.experimental.vector.reduce.xor"(%v) - : (!llvm<"<4 x i32>">) -> !llvm.i32 + : (!llvm.vec<4 x i32>) -> !llvm.i32 llvm.call @print_i32(%xor) : (!llvm.i32) -> () llvm.call @print_newline() : () -> () // CHECK: 4 diff --git a/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp b/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp --- a/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp +++ b/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp @@ -23,6 +23,7 @@ #include "mlir/IR/PatternMatch.h" #include "mlir/IR/StandardTypes.h" #include "mlir/IR/Types.h" +#include "mlir/Target/LLVMIR/TypeTranslation.h" #include "mlir/Transforms/DialectConversion.h" #include "mlir/Transforms/Passes.h" #include "llvm/IR/DerivedTypes.h" @@ -126,8 +127,10 @@ return failure(); auto dataLayout = typeConverter.getDialect()->getLLVMModule().getDataLayout(); - align = dataLayout.getPrefTypeAlignment( - LLVM::convertLLVMType(elementTy.cast())); + // TODO: this should be abstracted away to avoid depending on translation. + align = dataLayout.getPrefTypeAlignment(LLVM::translateTypeToLLVMIR( + elementTy.cast(), + typeConverter.getDialect()->getLLVMContext())); return success(); } diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp --- a/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp +++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp @@ -11,6 +11,7 @@ // //===----------------------------------------------------------------------===// #include "mlir/Dialect/LLVMIR/LLVMDialect.h" +#include "mlir/Dialect/LLVMIR/LLVMTypes.h" #include "mlir/IR/Builders.h" #include "mlir/IR/DialectImplementation.h" #include "mlir/IR/FunctionImplementation.h" @@ -1691,12 +1692,6 @@ llvm::LLVMContext llvmContext; llvm::Module module; - /// A set of LLVMTypes that are cached on construction to avoid any lookups or - /// locking. - LLVMType int1Ty, int8Ty, int16Ty, int32Ty, int64Ty, int128Ty; - LLVMType doubleTy, floatTy, bfloatTy, halfTy, fp128Ty, x86_fp80Ty; - LLVMType voidTy; - /// A smart mutex to lock access to the llvm context. Unlike MLIR, LLVM is not /// multi-threaded and requires locked access to prevent race conditions. llvm::sys::SmartMutex mutex; @@ -1708,7 +1703,27 @@ LLVMDialect::LLVMDialect(MLIRContext *context) : Dialect(getDialectNamespace(), context), impl(new detail::LLVMDialectImpl()) { - addTypes(); + // clang-format off + addTypes(); + // clang-format on addOperations< #define GET_OP_LIST #include "mlir/Dialect/LLVMIR/LLVMOps.cpp.inc" @@ -1716,26 +1731,6 @@ // Support unknown operations because not all LLVM operations are registered. allowUnknownOperations(); - - // Cache some of the common LLVM types to avoid the need for lookups/locking. - auto &llvmContext = impl->llvmContext; - /// Integer Types. - impl->int1Ty = LLVMType::get(context, llvm::Type::getInt1Ty(llvmContext)); - impl->int8Ty = LLVMType::get(context, llvm::Type::getInt8Ty(llvmContext)); - impl->int16Ty = LLVMType::get(context, llvm::Type::getInt16Ty(llvmContext)); - impl->int32Ty = LLVMType::get(context, llvm::Type::getInt32Ty(llvmContext)); - impl->int64Ty = LLVMType::get(context, llvm::Type::getInt64Ty(llvmContext)); - impl->int128Ty = LLVMType::get(context, llvm::Type::getInt128Ty(llvmContext)); - /// Float Types. - impl->doubleTy = LLVMType::get(context, llvm::Type::getDoubleTy(llvmContext)); - impl->floatTy = LLVMType::get(context, llvm::Type::getFloatTy(llvmContext)); - impl->bfloatTy = LLVMType::get(context, llvm::Type::getBFloatTy(llvmContext)); - impl->halfTy = LLVMType::get(context, llvm::Type::getHalfTy(llvmContext)); - impl->fp128Ty = LLVMType::get(context, llvm::Type::getFP128Ty(llvmContext)); - impl->x86_fp80Ty = - LLVMType::get(context, llvm::Type::getX86_FP80Ty(llvmContext)); - /// Other Types. - impl->voidTy = LLVMType::get(context, llvm::Type::getVoidTy(llvmContext)); } LLVMDialect::~LLVMDialect() {} @@ -1751,25 +1746,12 @@ /// Parse a type registered to this dialect. Type LLVMDialect::parseType(DialectAsmParser &parser) const { - StringRef tyData = parser.getFullSymbolSpec(); - - // LLVM is not thread-safe, so lock access to it. - llvm::sys::SmartScopedLock lock(impl->mutex); - - llvm::SMDiagnostic errorMessage; - llvm::Type *type = llvm::parseType(tyData, errorMessage, impl->module); - if (!type) - return (parser.emitError(parser.getNameLoc(), errorMessage.getMessage()), - nullptr); - return LLVMType::get(getContext(), type); + return detail::parseType(parser); } /// Print a type registered to this dialect. void LLVMDialect::printType(Type type, DialectAsmPrinter &os) const { - auto llvmType = type.dyn_cast(); - assert(llvmType && "printing wrong type"); - assert(llvmType.getUnderlyingType() && "no underlying LLVM type"); - llvmType.getUnderlyingType()->print(os.getStream()); + return detail::printType(type.cast(), os); } /// Verify LLVMIR function argument attributes. @@ -1788,242 +1770,6 @@ return success(); } -//===----------------------------------------------------------------------===// -// LLVMType. -//===----------------------------------------------------------------------===// - -namespace mlir { -namespace LLVM { -namespace detail { -struct LLVMTypeStorage : public ::mlir::TypeStorage { - LLVMTypeStorage(llvm::Type *ty) : underlyingType(ty) {} - - // LLVM types are pointer-unique. - using KeyTy = llvm::Type *; - bool operator==(const KeyTy &key) const { return key == underlyingType; } - - static LLVMTypeStorage *construct(TypeStorageAllocator &allocator, - llvm::Type *ty) { - return new (allocator.allocate()) LLVMTypeStorage(ty); - } - - llvm::Type *underlyingType; -}; -} // end namespace detail -} // end namespace LLVM -} // end namespace mlir - -LLVMType LLVMType::get(MLIRContext *context, llvm::Type *llvmType) { - return Base::get(context, FIRST_LLVM_TYPE, llvmType); -} - -/// Get an LLVMType with an llvm type that may cause changes to the underlying -/// llvm context when constructed. -LLVMType LLVMType::getLocked(LLVMDialect *dialect, - function_ref typeBuilder) { - // Lock access to the llvm context and build the type. - llvm::sys::SmartScopedLock lock(dialect->impl->mutex); - return get(dialect->getContext(), typeBuilder()); -} - -LLVMDialect &LLVMType::getDialect() { - return static_cast(Type::getDialect()); -} - -llvm::Type *LLVMType::getUnderlyingType() const { - return getImpl()->underlyingType; -} - -void LLVMType::getUnderlyingTypes(ArrayRef types, - SmallVectorImpl &result) { - result.reserve(result.size() + types.size()); - for (LLVMType ty : types) - result.push_back(ty.getUnderlyingType()); -} - -/// Array type utilities. -LLVMType LLVMType::getArrayElementType() { - return get(getContext(), getUnderlyingType()->getArrayElementType()); -} -unsigned LLVMType::getArrayNumElements() { - return getUnderlyingType()->getArrayNumElements(); -} -bool LLVMType::isArrayTy() { return getUnderlyingType()->isArrayTy(); } - -/// Vector type utilities. -LLVMType LLVMType::getVectorElementType() { - return get( - getContext(), - llvm::cast(getUnderlyingType())->getElementType()); -} -unsigned LLVMType::getVectorNumElements() { - return llvm::cast(getUnderlyingType()) - ->getNumElements(); -} -llvm::ElementCount LLVMType::getVectorElementCount() { - return llvm::cast(getUnderlyingType())->getElementCount(); -} -bool LLVMType::isVectorTy() { return getUnderlyingType()->isVectorTy(); } - -/// Function type utilities. -LLVMType LLVMType::getFunctionParamType(unsigned argIdx) { - return get(getContext(), getUnderlyingType()->getFunctionParamType(argIdx)); -} -unsigned LLVMType::getFunctionNumParams() { - return getUnderlyingType()->getFunctionNumParams(); -} -LLVMType LLVMType::getFunctionResultType() { - return get( - getContext(), - llvm::cast(getUnderlyingType())->getReturnType()); -} -bool LLVMType::isFunctionTy() { return getUnderlyingType()->isFunctionTy(); } -bool LLVMType::isFunctionVarArg() { - return getUnderlyingType()->isFunctionVarArg(); -} - -/// Pointer type utilities. -LLVMType LLVMType::getPointerTo(unsigned addrSpace) { - // Lock access to the dialect as this may modify the LLVM context. - return getLocked(&getDialect(), [=] { - return getUnderlyingType()->getPointerTo(addrSpace); - }); -} -LLVMType LLVMType::getPointerElementTy() { - return get(getContext(), getUnderlyingType()->getPointerElementType()); -} -bool LLVMType::isPointerTy() { return getUnderlyingType()->isPointerTy(); } -bool LLVMType::isValidPointerElementType(LLVMType type) { - return llvm::PointerType::isValidElementType(type.getUnderlyingType()); -} - -/// Struct type utilities. -LLVMType LLVMType::getStructElementType(unsigned i) { - return get(getContext(), getUnderlyingType()->getStructElementType(i)); -} -unsigned LLVMType::getStructNumElements() { - return getUnderlyingType()->getStructNumElements(); -} -bool LLVMType::isStructTy() { return getUnderlyingType()->isStructTy(); } - -/// Utilities used to generate floating point types. -LLVMType LLVMType::getDoubleTy(LLVMDialect *dialect) { - return dialect->impl->doubleTy; -} -LLVMType LLVMType::getFloatTy(LLVMDialect *dialect) { - return dialect->impl->floatTy; -} -LLVMType LLVMType::getBFloatTy(LLVMDialect *dialect) { - return dialect->impl->bfloatTy; -} -LLVMType LLVMType::getHalfTy(LLVMDialect *dialect) { - return dialect->impl->halfTy; -} -LLVMType LLVMType::getFP128Ty(LLVMDialect *dialect) { - return dialect->impl->fp128Ty; -} -LLVMType LLVMType::getX86_FP80Ty(LLVMDialect *dialect) { - return dialect->impl->x86_fp80Ty; -} - -/// Utilities used to generate integer types. -LLVMType LLVMType::getIntNTy(LLVMDialect *dialect, unsigned numBits) { - switch (numBits) { - case 1: - return dialect->impl->int1Ty; - case 8: - return dialect->impl->int8Ty; - case 16: - return dialect->impl->int16Ty; - case 32: - return dialect->impl->int32Ty; - case 64: - return dialect->impl->int64Ty; - case 128: - return dialect->impl->int128Ty; - default: - break; - } - - // Lock access to the dialect as this may modify the LLVM context. - return getLocked(dialect, [=] { - return llvm::Type::getIntNTy(dialect->getLLVMContext(), numBits); - }); -} - -/// Utilities used to generate other miscellaneous types. -LLVMType LLVMType::getArrayTy(LLVMType elementType, uint64_t numElements) { - // Lock access to the dialect as this may modify the LLVM context. - return getLocked(&elementType.getDialect(), [=] { - return llvm::ArrayType::get(elementType.getUnderlyingType(), numElements); - }); -} -LLVMType LLVMType::getFunctionTy(LLVMType result, ArrayRef params, - bool isVarArg) { - SmallVector llvmParams; - for (auto param : params) - llvmParams.push_back(param.getUnderlyingType()); - - // Lock access to the dialect as this may modify the LLVM context. - return getLocked(&result.getDialect(), [=] { - return llvm::FunctionType::get(result.getUnderlyingType(), llvmParams, - isVarArg); - }); -} -LLVMType LLVMType::getStructTy(LLVMDialect *dialect, - ArrayRef elements, bool isPacked) { - SmallVector llvmElements; - for (auto elt : elements) - llvmElements.push_back(elt.getUnderlyingType()); - - // Lock access to the dialect as this may modify the LLVM context. - return getLocked(dialect, [=] { - return llvm::StructType::get(dialect->getLLVMContext(), llvmElements, - isPacked); - }); -} -LLVMType LLVMType::createStructTy(LLVMDialect *dialect, - ArrayRef elements, - Optional name, bool isPacked) { - StringRef sr = name.hasValue() ? *name : ""; - SmallVector llvmElements; - getUnderlyingTypes(elements, llvmElements); - return getLocked(dialect, [=] { - auto *rv = llvm::StructType::create(dialect->getLLVMContext(), sr); - if (!llvmElements.empty()) - rv->setBody(llvmElements, isPacked); - return rv; - }); -} -LLVMType LLVMType::setStructTyBody(LLVMType structType, - ArrayRef elements, bool isPacked) { - llvm::StructType *st = - llvm::cast(structType.getUnderlyingType()); - SmallVector llvmElements; - getUnderlyingTypes(elements, llvmElements); - return getLocked(&structType.getDialect(), [=] { - st->setBody(llvmElements, isPacked); - return st; - }); -} -LLVMType LLVMType::getVectorTy(LLVMType elementType, unsigned numElements) { - // Lock access to the dialect as this may modify the LLVM context. - return getLocked(&elementType.getDialect(), [=] { - return llvm::FixedVectorType::get(elementType.getUnderlyingType(), - numElements); - }); -} - -LLVMType LLVMType::getVoidTy(LLVMDialect *dialect) { - return dialect->impl->voidTy; -} - -bool LLVMType::isVoidTy() { return getUnderlyingType()->isVoidTy(); } - -llvm::Type *mlir::LLVM::convertLLVMType(LLVMType type) { - return type.getUnderlyingType(); -} - //===----------------------------------------------------------------------===// // Utility functions. //===----------------------------------------------------------------------===// diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp --- a/mlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp +++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp @@ -18,48 +18,48 @@ // Printing. //===----------------------------------------------------------------------===// -static void printTypeImpl(llvm::raw_ostream &os, LLVMTypeNew type, +static void printTypeImpl(llvm::raw_ostream &os, LLVMType type, llvm::SetVector &stack); /// Returns the keyword to use for the given type. -static StringRef getTypeKeyword(LLVMTypeNew type) { +static StringRef getTypeKeyword(LLVMType type) { switch (type.getKind()) { - case LLVMTypeNew::VoidType: + case LLVMType::VoidType: return "void"; - case LLVMTypeNew::HalfType: + case LLVMType::HalfType: return "half"; - case LLVMTypeNew::BFloatType: + case LLVMType::BFloatType: return "bfloat"; - case LLVMTypeNew::FloatType: + case LLVMType::FloatType: return "float"; - case LLVMTypeNew::DoubleType: + case LLVMType::DoubleType: return "double"; - case LLVMTypeNew::FP128Type: + case LLVMType::FP128Type: return "fp128"; - case LLVMTypeNew::X86FP80Type: + case LLVMType::X86FP80Type: return "x86_fp80"; - case LLVMTypeNew::PPCFP128Type: + case LLVMType::PPCFP128Type: return "ppc_fp128"; - case LLVMTypeNew::X86MMXType: + case LLVMType::X86MMXType: return "x86_mmx"; - case LLVMTypeNew::TokenType: + case LLVMType::TokenType: return "token"; - case LLVMTypeNew::LabelType: + case LLVMType::LabelType: return "label"; - case LLVMTypeNew::MetadataType: + case LLVMType::MetadataType: return "metadata"; - case LLVMTypeNew::FunctionType: + case LLVMType::FunctionType: return "func"; - case LLVMTypeNew::IntegerType: + case LLVMType::IntegerType: return "i"; - case LLVMTypeNew::PointerType: + case LLVMType::PointerType: return "ptr"; - case LLVMTypeNew::FixedVectorType: - case LLVMTypeNew::ScalableVectorType: + case LLVMType::FixedVectorType: + case LLVMType::ScalableVectorType: return "vec"; - case LLVMTypeNew::ArrayType: + case LLVMType::ArrayType: return "array"; - case LLVMTypeNew::StructType: + case LLVMType::StructType: return "struct"; } llvm_unreachable("unhandled type kind"); @@ -81,7 +81,7 @@ os << '('; if (type.isIdentified()) stack.insert(type.getName()); - llvm::interleaveComma(type.getBody(), os, [&](LLVMTypeNew subtype) { + llvm::interleaveComma(type.getBody(), os, [&](LLVMType subtype) { printTypeImpl(os, subtype, stack); }); if (type.isIdentified()) @@ -126,10 +126,9 @@ os << '<'; printTypeImpl(os, funcType.getReturnType(), stack); os << " ("; - llvm::interleaveComma(funcType.getParams(), os, - [&os, &stack](LLVMTypeNew subtype) { - printTypeImpl(os, subtype, stack); - }); + llvm::interleaveComma( + funcType.getParams(), os, + [&os, &stack](LLVMType subtype) { printTypeImpl(os, subtype, stack); }); if (funcType.isVarArg()) { if (funcType.getNumParams() != 0) os << ", "; @@ -147,7 +146,7 @@ /// struct<"c", (ptr>)>>, /// ptr>)>>)> /// note that "b" is printed twice. -static void printTypeImpl(llvm::raw_ostream &os, LLVMTypeNew type, +static void printTypeImpl(llvm::raw_ostream &os, LLVMType type, llvm::SetVector &stack) { if (!type) { os << "<>"; @@ -158,8 +157,8 @@ os << getTypeKeyword(type); // Trivial types only consist of their keyword. - if (LLVMTypeNew::FIRST_TRIVIAL_TYPE <= kind && - kind <= LLVMTypeNew::LAST_TRIVIAL_TYPE) + if (LLVMType::FIRST_TRIVIAL_TYPE <= kind && + kind <= LLVMType::LAST_TRIVIAL_TYPE) return; if (auto intType = type.dyn_cast()) { @@ -194,8 +193,7 @@ printFunctionType(os, type.cast(), stack); } -void mlir::LLVM::detail::printType(LLVMTypeNew type, - DialectAsmPrinter &printer) { +void mlir::LLVM::detail::printType(LLVMType type, DialectAsmPrinter &printer) { llvm::SetVector stack; return printTypeImpl(printer.getStream(), type, stack); } @@ -204,13 +202,13 @@ // Parsing. //===----------------------------------------------------------------------===// -static LLVMTypeNew parseTypeImpl(DialectAsmParser &parser, - llvm::SetVector &stack); +static LLVMType parseTypeImpl(DialectAsmParser &parser, + llvm::SetVector &stack); /// Helper to be chained with other parsing functions. static ParseResult parseTypeImpl(DialectAsmParser &parser, llvm::SetVector &stack, - LLVMTypeNew &result) { + LLVMType &result) { result = parseTypeImpl(parser, stack); return success(result != nullptr); } @@ -219,7 +217,7 @@ /// llvm-type :: = `func<` llvm-type `(` llvm-type-list `...`? `)>` static LLVMFunctionType parseFunctionType(DialectAsmParser &parser, llvm::SetVector &stack) { - LLVMTypeNew returnType; + LLVMType returnType; if (parser.parseLess() || parseTypeImpl(parser, stack, returnType) || parser.parseLParen()) return LLVMFunctionType(); @@ -232,7 +230,7 @@ } // Parse arguments. - SmallVector argTypes; + SmallVector argTypes; do { if (succeeded(parser.parseOptionalEllipsis())) { if (parser.parseOptionalRParen() || parser.parseOptionalGreater()) @@ -254,7 +252,7 @@ /// llvm-type ::= `ptr<` llvm-type (`,` integer)? `>` static LLVMPointerType parsePointerType(DialectAsmParser &parser, llvm::SetVector &stack) { - LLVMTypeNew elementType; + LLVMType elementType; if (parser.parseLess() || parseTypeImpl(parser, stack, elementType)) return LLVMPointerType(); @@ -274,7 +272,7 @@ llvm::SetVector &stack) { SmallVector dims; llvm::SMLoc dimPos; - LLVMTypeNew elementType; + LLVMType elementType; if (parser.parseLess() || parser.getCurrentLocation(&dimPos) || parser.parseDimensionList(dims, /*allowDynamic=*/true) || parseTypeImpl(parser, stack, elementType) || parser.parseGreater()) @@ -304,7 +302,7 @@ llvm::SetVector &stack) { SmallVector dims; llvm::SMLoc sizePos; - LLVMTypeNew elementType; + LLVMType elementType; if (parser.parseLess() || parser.getCurrentLocation(&sizePos) || parser.parseDimensionList(dims, /*allowDynamic=*/false) || parseTypeImpl(parser, stack, elementType) || parser.parseGreater()) @@ -322,7 +320,7 @@ /// error at `subtypesLoc` in case of failure, uses `stack` to make sure the /// types printed in the error message look like they did when parsed. static LLVMStructType trySetStructBody(LLVMStructType type, - ArrayRef subtypes, + ArrayRef subtypes, bool isPacked, DialectAsmParser &parser, llvm::SMLoc subtypesLoc, llvm::SetVector &stack) { @@ -398,12 +396,12 @@ // Parse subtypes. For identified structs, put the identifier of the struct on // the stack to support self-references in the recursive calls. - SmallVector subtypes; + SmallVector subtypes; llvm::SMLoc subtypesLoc = parser.getCurrentLocation(); do { if (isIdentified) stack.insert(name); - LLVMTypeNew type = parseTypeImpl(parser, stack); + LLVMType type = parseTypeImpl(parser, stack); if (!type) return LLVMStructType(); subtypes.push_back(type); @@ -422,8 +420,8 @@ } /// Parses one of the LLVM dialect types. -static LLVMTypeNew parseTypeImpl(DialectAsmParser &parser, - llvm::SetVector &stack) { +static LLVMType parseTypeImpl(DialectAsmParser &parser, + llvm::SetVector &stack) { // Special case for integers (i[1-9][0-9]*) that are literals rather than // keywords for the parser, so they are not caught by the main dispatch below. // Try parsing it a built-in integer type instead. @@ -433,11 +431,11 @@ OptionalParseResult result = parser.parseOptionalType(maybeIntegerType); if (result.hasValue()) { if (failed(*result)) - return LLVMTypeNew(); + return LLVMType(); if (!maybeIntegerType.isSignlessInteger()) { parser.emitError(keyLoc) << "unexpected type, expected i* or keyword"; - return LLVMTypeNew(); + return LLVMType(); } return LLVMIntegerType::get(ctx, maybeIntegerType.getIntOrFloatBitWidth()); } @@ -445,9 +443,9 @@ // Dispatch to concrete functions. StringRef key; if (failed(parser.parseKeyword(&key))) - return LLVMTypeNew(); + return LLVMType(); - return llvm::StringSwitch>(key) + return llvm::StringSwitch>(key) .Case("void", [&] { return LLVMVoidType::get(ctx); }) .Case("half", [&] { return LLVMHalfType::get(ctx); }) .Case("bfloat", [&] { return LLVMBFloatType::get(ctx); }) @@ -467,11 +465,11 @@ .Case("struct", [&] { return parseStructType(parser, stack); }) .Default([&] { parser.emitError(keyLoc) << "unknown LLVM type: " << key; - return LLVMTypeNew(); + return LLVMType(); })(); } -LLVMTypeNew mlir::LLVM::detail::parseType(DialectAsmParser &parser) { +LLVMType mlir::LLVM::detail::parseType(DialectAsmParser &parser) { llvm::SetVector stack; return parseTypeImpl(parser, stack); } diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp --- a/mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp +++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp @@ -24,90 +24,89 @@ using namespace mlir::LLVM; //===----------------------------------------------------------------------===// -// LLVMTypeNew. +// LLVMType. //===----------------------------------------------------------------------===// -LLVMDialect &LLVMTypeNew::getDialect() { +LLVMDialect &LLVMType::getDialect() { return *getContext()->getRegisteredDialect(); } //----------------------------------------------------------------------------// // Integer type utilities. -bool LLVMTypeNew::isIntegerTy(unsigned bitwidth) { +bool LLVMType::isIntegerTy(unsigned bitwidth) { if (auto intType = dyn_cast()) return intType.getBitWidth() == bitwidth; return false; } - -unsigned LLVMTypeNew::getIntegerBitWidth() { +unsigned LLVMType::getIntegerBitWidth() { return cast().getBitWidth(); } -LLVMTypeNew LLVMTypeNew::getArrayElementType() { +LLVMType LLVMType::getArrayElementType() { return cast().getElementType(); } //----------------------------------------------------------------------------// // Array type utilities. -unsigned LLVMTypeNew::getArrayNumElements() { +unsigned LLVMType::getArrayNumElements() { return cast().getNumElements(); } -bool LLVMTypeNew::isArrayTy() { return isa(); } +bool LLVMType::isArrayTy() { return isa(); } //----------------------------------------------------------------------------// // Vector type utilities. -LLVMTypeNew LLVMTypeNew::getVectorElementType() { +LLVMType LLVMType::getVectorElementType() { return cast().getElementType(); } -unsigned LLVMTypeNew::getVectorNumElements() { +unsigned LLVMType::getVectorNumElements() { return cast().getNumElements(); } -llvm::ElementCount LLVMTypeNew::getVectorElementCount() { +llvm::ElementCount LLVMType::getVectorElementCount() { return cast().getElementCount(); } -bool LLVMTypeNew::isVectorTy() { return isa(); } +bool LLVMType::isVectorTy() { return isa(); } //----------------------------------------------------------------------------// // Function type utilities. -LLVMTypeNew LLVMTypeNew::getFunctionParamType(unsigned argIdx) { +LLVMType LLVMType::getFunctionParamType(unsigned argIdx) { return cast().getParamType(argIdx); } -unsigned LLVMTypeNew::getFunctionNumParams() { +unsigned LLVMType::getFunctionNumParams() { return cast().getNumParams(); } -LLVMTypeNew LLVMTypeNew::getFunctionResultType() { +LLVMType LLVMType::getFunctionResultType() { return cast().getReturnType(); } -bool LLVMTypeNew::isFunctionTy() { return isa(); } +bool LLVMType::isFunctionTy() { return isa(); } -bool LLVMTypeNew::isFunctionVarArg() { +bool LLVMType::isFunctionVarArg() { return cast().isVarArg(); } //----------------------------------------------------------------------------// // Pointer type utilities. -LLVMTypeNew LLVMTypeNew::getPointerTo(unsigned addrSpace) { +LLVMType LLVMType::getPointerTo(unsigned addrSpace) { return LLVMPointerType::get(*this, addrSpace); } -LLVMTypeNew LLVMTypeNew::getPointerElementTy() { +LLVMType LLVMType::getPointerElementTy() { return cast().getElementType(); } -bool LLVMTypeNew::isPointerTy() { return isa(); } +bool LLVMType::isPointerTy() { return isa(); } -bool LLVMTypeNew::isValidPointerElementType(LLVMTypeNew type) { +bool LLVMType::isValidPointerElementType(LLVMType type) { return !type.isa() && !type.isa() && !type.isa() && !type.isa(); } @@ -115,91 +114,86 @@ //----------------------------------------------------------------------------// // Struct type utilities. -LLVMTypeNew LLVMTypeNew::getStructElementType(unsigned i) { +LLVMType LLVMType::getStructElementType(unsigned i) { return cast().getBody()[i]; } -unsigned LLVMTypeNew::getStructNumElements() { +unsigned LLVMType::getStructNumElements() { return cast().getBody().size(); } -bool LLVMTypeNew::isStructTy() { return isa(); } +bool LLVMType::isStructTy() { return isa(); } //----------------------------------------------------------------------------// // Utilities used to generate floating point types. -LLVMTypeNew LLVMTypeNew::getDoubleTy(LLVMDialect *dialect) { +LLVMType LLVMType::getDoubleTy(LLVMDialect *dialect) { return LLVMDoubleType::get(dialect->getContext()); } -LLVMTypeNew LLVMTypeNew::getFloatTy(LLVMDialect *dialect) { +LLVMType LLVMType::getFloatTy(LLVMDialect *dialect) { return LLVMFloatType::get(dialect->getContext()); } -LLVMTypeNew LLVMTypeNew::getBFloatTy(LLVMDialect *dialect) { +LLVMType LLVMType::getBFloatTy(LLVMDialect *dialect) { return LLVMBFloatType::get(dialect->getContext()); } -LLVMTypeNew LLVMTypeNew::getHalfTy(LLVMDialect *dialect) { +LLVMType LLVMType::getHalfTy(LLVMDialect *dialect) { return LLVMHalfType::get(dialect->getContext()); } -LLVMTypeNew LLVMTypeNew::getFP128Ty(LLVMDialect *dialect) { +LLVMType LLVMType::getFP128Ty(LLVMDialect *dialect) { return LLVMFP128Type::get(dialect->getContext()); } -LLVMTypeNew LLVMTypeNew::getX86_FP80Ty(LLVMDialect *dialect) { +LLVMType LLVMType::getX86_FP80Ty(LLVMDialect *dialect) { return LLVMX86FP80Type::get(dialect->getContext()); } //----------------------------------------------------------------------------// // Utilities used to generate integer types. -LLVMTypeNew LLVMTypeNew::getIntNTy(LLVMDialect *dialect, unsigned numBits) { +LLVMType LLVMType::getIntNTy(LLVMDialect *dialect, unsigned numBits) { return LLVMIntegerType::get(dialect->getContext(), numBits); } //----------------------------------------------------------------------------// // Utilities used to generate other miscellaneous types. -LLVMTypeNew LLVMTypeNew::getArrayTy(LLVMTypeNew elementType, - uint64_t numElements) { +LLVMType LLVMType::getArrayTy(LLVMType elementType, uint64_t numElements) { return LLVMArrayType::get(elementType, numElements); } -LLVMTypeNew LLVMTypeNew::getFunctionTy(LLVMTypeNew result, - ArrayRef params, - bool isVarArg) { +LLVMType LLVMType::getFunctionTy(LLVMType result, ArrayRef params, + bool isVarArg) { return LLVMFunctionType::get(result, params, isVarArg); } -LLVMTypeNew LLVMTypeNew::getStructTy(LLVMDialect *dialect, - ArrayRef elements, - bool isPacked) { +LLVMType LLVMType::getStructTy(LLVMDialect *dialect, + ArrayRef elements, bool isPacked) { return LLVMStructType::getLiteral(dialect->getContext(), elements, isPacked); } -LLVMTypeNew LLVMTypeNew::getVectorTy(LLVMTypeNew elementType, - unsigned numElements) { +LLVMType LLVMType::getVectorTy(LLVMType elementType, unsigned numElements) { return LLVMFixedVectorType::get(elementType, numElements); } //----------------------------------------------------------------------------// // Void type utilities. -LLVMTypeNew LLVMTypeNew::getVoidTy(LLVMDialect *dialect) { +LLVMType LLVMType::getVoidTy(LLVMDialect *dialect) { return LLVMVoidType::get(dialect->getContext()); } -bool LLVMTypeNew::isVoidTy() { return isa(); } +bool LLVMType::isVoidTy() { return isa(); } //----------------------------------------------------------------------------// // Creation and setting of LLVM's identified struct types -LLVMTypeNew LLVMTypeNew::createStructTy(LLVMDialect *dialect, - ArrayRef elements, - Optional name, - bool isPacked) { +LLVMType LLVMType::createStructTy(LLVMDialect *dialect, + ArrayRef elements, + Optional name, bool isPacked) { assert(name.hasValue() && "identified structs with no identifier not supported"); StringRef stringNameBase = name.getValueOr(""); @@ -220,9 +214,8 @@ } while (true); } -LLVMTypeNew LLVMTypeNew::setStructTyBody(LLVMTypeNew structType, - ArrayRef elements, - bool isPacked) { +LLVMType LLVMType::setStructTyBody(LLVMType structType, + ArrayRef elements, bool isPacked) { LogicalResult couldSet = structType.cast().setBody(elements, isPacked); assert(succeeded(couldSet) && "failed to set the body"); @@ -233,29 +226,28 @@ //===----------------------------------------------------------------------===// // Array type. -LLVMArrayType LLVMArrayType::get(LLVMTypeNew elementType, - unsigned numElements) { +LLVMArrayType LLVMArrayType::get(LLVMType elementType, unsigned numElements) { assert(elementType && "expected non-null subtype"); - return Base::get(elementType.getContext(), LLVMTypeNew::ArrayType, - elementType, numElements); + return Base::get(elementType.getContext(), LLVMType::ArrayType, elementType, + numElements); } -LLVMTypeNew LLVMArrayType::getElementType() { return getImpl()->elementType; } +LLVMType LLVMArrayType::getElementType() { return getImpl()->elementType; } unsigned LLVMArrayType::getNumElements() { return getImpl()->numElements; } //===----------------------------------------------------------------------===// // Function type. -LLVMFunctionType LLVMFunctionType::get(LLVMTypeNew result, - ArrayRef arguments, +LLVMFunctionType LLVMFunctionType::get(LLVMType result, + ArrayRef arguments, bool isVarArg) { assert(result && "expected non-null result"); - return Base::get(result.getContext(), LLVMTypeNew::FunctionType, result, + return Base::get(result.getContext(), LLVMType::FunctionType, result, arguments, isVarArg); } -LLVMTypeNew LLVMFunctionType::getReturnType() { +LLVMType LLVMFunctionType::getReturnType() { return getImpl()->getReturnType(); } @@ -263,13 +255,13 @@ return getImpl()->getArgumentTypes().size(); } -LLVMTypeNew LLVMFunctionType::getParamType(unsigned i) { +LLVMType LLVMFunctionType::getParamType(unsigned i) { return getImpl()->getArgumentTypes()[i]; } bool LLVMFunctionType::isVarArg() { return getImpl()->isVariadic(); } -ArrayRef LLVMFunctionType::getParams() { +ArrayRef LLVMFunctionType::getParams() { return getImpl()->getArgumentTypes(); } @@ -277,7 +269,7 @@ // Integer type. LLVMIntegerType LLVMIntegerType::get(MLIRContext *ctx, unsigned bitwidth) { - return Base::get(ctx, LLVMTypeNew::IntegerType, bitwidth); + return Base::get(ctx, LLVMType::IntegerType, bitwidth); } unsigned LLVMIntegerType::getBitWidth() { return getImpl()->bitwidth; } @@ -285,14 +277,13 @@ //===----------------------------------------------------------------------===// // Pointer type. -LLVMPointerType LLVMPointerType::get(LLVMTypeNew pointee, - unsigned addressSpace) { +LLVMPointerType LLVMPointerType::get(LLVMType pointee, unsigned addressSpace) { assert(pointee && "expected non-null subtype"); - return Base::get(pointee.getContext(), LLVMTypeNew::PointerType, pointee, + return Base::get(pointee.getContext(), LLVMType::PointerType, pointee, addressSpace); } -LLVMTypeNew LLVMPointerType::getElementType() { return getImpl()->pointeeType; } +LLVMType LLVMPointerType::getElementType() { return getImpl()->pointeeType; } unsigned LLVMPointerType::getAddressSpace() { return getImpl()->addressSpace; } @@ -301,21 +292,20 @@ LLVMStructType LLVMStructType::getIdentified(MLIRContext *context, StringRef name) { - return Base::get(context, LLVMTypeNew::StructType, name, /*opaque=*/false); + return Base::get(context, LLVMType::StructType, name, /*opaque=*/false); } LLVMStructType LLVMStructType::getLiteral(MLIRContext *context, - ArrayRef types, + ArrayRef types, bool isPacked) { - return Base::get(context, LLVMTypeNew::StructType, types, isPacked); + return Base::get(context, LLVMType::StructType, types, isPacked); } LLVMStructType LLVMStructType::getOpaque(StringRef name, MLIRContext *context) { - return Base::get(context, LLVMTypeNew::StructType, name, /*opaque=*/true); + return Base::get(context, LLVMType::StructType, name, /*opaque=*/true); } -LogicalResult LLVMStructType::setBody(ArrayRef types, - bool isPacked) { +LogicalResult LLVMStructType::setBody(ArrayRef types, bool isPacked) { assert(isIdentified() && "can only set bodies of identified structs"); return Base::mutate(types, isPacked); } @@ -327,7 +317,7 @@ } bool LLVMStructType::isInitialized() { return getImpl()->isInitialized(); } StringRef LLVMStructType::getName() { return getImpl()->getIdentifier(); } -ArrayRef LLVMStructType::getBody() { +ArrayRef LLVMStructType::getBody() { return isIdentified() ? getImpl()->getIdentifiedStructBody() : getImpl()->getTypeList(); } @@ -335,7 +325,7 @@ //===----------------------------------------------------------------------===// // Vector types. -LLVMTypeNew LLVMVectorType::getElementType() { +LLVMType LLVMVectorType::getElementType() { // Both derived classes share the implementation type. return static_cast(impl)->elementType; } @@ -347,10 +337,10 @@ this->isa()); } -LLVMFixedVectorType LLVMFixedVectorType::get(LLVMTypeNew elementType, +LLVMFixedVectorType LLVMFixedVectorType::get(LLVMType elementType, unsigned numElements) { assert(elementType && "expected non-null subtype"); - return Base::get(elementType.getContext(), LLVMTypeNew::FixedVectorType, + return Base::get(elementType.getContext(), LLVMType::FixedVectorType, elementType, numElements) .cast(); } @@ -359,10 +349,10 @@ return getImpl()->numElements; } -LLVMScalableVectorType LLVMScalableVectorType::get(LLVMTypeNew elementType, +LLVMScalableVectorType LLVMScalableVectorType::get(LLVMType elementType, unsigned minNumElements) { assert(elementType && "expected non-null subtype"); - return Base::get(elementType.getContext(), LLVMTypeNew::ScalableVectorType, + return Base::get(elementType.getContext(), LLVMType::ScalableVectorType, elementType, minNumElements) .cast(); } diff --git a/mlir/lib/Dialect/LLVMIR/IR/TypeDetail.h b/mlir/lib/Dialect/LLVMIR/IR/TypeDetail.h --- a/mlir/lib/Dialect/LLVMIR/IR/TypeDetail.h +++ b/mlir/lib/Dialect/LLVMIR/IR/TypeDetail.h @@ -72,7 +72,7 @@ Key(StringRef name, bool opaque) : name(name), identified(true), packed(false), opaque(opaque) {} /// Constructs a key for a literal struct. - Key(ArrayRef types, bool packed) + Key(ArrayRef types, bool packed) : types(types), identified(false), packed(packed), opaque(false) {} /// Checks a specific property of the struct. @@ -96,7 +96,7 @@ } /// Returns the list of type contained in the key of a literal struct. - ArrayRef getTypeList() const { + ArrayRef getTypeList() const { assert(!isIdentified() && "identified struct key cannot have a type list"); return types; @@ -138,7 +138,7 @@ } private: - ArrayRef types; + ArrayRef types; StringRef name; bool identified; bool packed; @@ -153,19 +153,18 @@ } /// Returns the list of types (partially) identifying a literal struct. - ArrayRef getTypeList() const { + ArrayRef getTypeList() const { // If this triggers, use getIdentifiedStructBody() instead. assert(!isIdentified() && "requested typelist on an identified struct"); - return ArrayRef(static_cast(keyPtr), - keySize()); + return ArrayRef(static_cast(keyPtr), keySize()); } /// Returns the list of types contained in an identified struct. - ArrayRef getIdentifiedStructBody() const { + ArrayRef getIdentifiedStructBody() const { // If this triggers, use getTypeList() instead. assert(isIdentified() && "requested struct body on a non-identified struct"); - return ArrayRef(identifiedBodyArray, identifiedBodySize()); + return ArrayRef(identifiedBodyArray, identifiedBodySize()); } /// Checks whether the struct is identified. @@ -200,7 +199,7 @@ /// as initalized and can no longer be mutated. LLVMStructTypeStorage(const KeyTy &key) { if (!key.isIdentified()) { - ArrayRef types = key.getTypeList(); + ArrayRef types = key.getTypeList(); keyPtr = static_cast(types.data()); setKeySize(types.size()); llvm::Bitfield::set(keySizeAndFlags, key.isPacked()); @@ -233,8 +232,8 @@ /// initialized, succeeds only if the body is equal to the current body. Fails /// if the struct is marked as intentionally opaque. The struct will be marked /// as initialized as a result of this operation and can no longer be changed. - LogicalResult mutate(TypeStorageAllocator &allocator, - ArrayRef body, bool packed) { + LogicalResult mutate(TypeStorageAllocator &allocator, ArrayRef body, + bool packed) { if (!isIdentified()) return failure(); if (isInitialized()) @@ -245,7 +244,7 @@ true); llvm::Bitfield::set(identifiedBodySizeAndFlags, packed); - ArrayRef typesInAllocator = allocator.copyInto(body); + ArrayRef typesInAllocator = allocator.copyInto(body); identifiedBodyArray = typesInAllocator.data(); setIdentifiedBodySize(typesInAllocator.size()); @@ -311,7 +310,7 @@ const void *keyPtr = nullptr; /// Pointer to the first type contained in an identified struct. - const LLVMTypeNew *identifiedBodyArray = nullptr; + const LLVMType *identifiedBodyArray = nullptr; /// Size of the uniquing key combined with identified/literal and /// packedness bits. Must only be used through the Key* bitfields. @@ -329,11 +328,11 @@ /// Type storage for LLVM dialect function types. These are uniqued using the /// list of types they contain and the vararg bit. struct LLVMFunctionTypeStorage : public TypeStorage { - using KeyTy = std::tuple, bool>; + using KeyTy = std::tuple, bool>; /// Construct a storage from the given components. The list is expected to be /// allocated in the context. - LLVMFunctionTypeStorage(LLVMTypeNew result, ArrayRef arguments, + LLVMFunctionTypeStorage(LLVMType result, ArrayRef arguments, bool variadic) : argumentTypes(arguments) { returnTypeAndVariadic.setPointerAndInt(result, variadic); @@ -360,21 +359,19 @@ } /// Returns the list of function argument types. - ArrayRef getArgumentTypes() const { return argumentTypes; } + ArrayRef getArgumentTypes() const { return argumentTypes; } /// Checks whether the function type is variadic. bool isVariadic() const { return returnTypeAndVariadic.getInt(); } /// Returns the function result type. - LLVMTypeNew getReturnType() const { - return returnTypeAndVariadic.getPointer(); - } + LLVMType getReturnType() const { return returnTypeAndVariadic.getPointer(); } private: /// Function result type packed with the variadic bit. - llvm::PointerIntPair returnTypeAndVariadic; + llvm::PointerIntPair returnTypeAndVariadic; /// Argument types. - ArrayRef argumentTypes; + ArrayRef argumentTypes; }; //===----------------------------------------------------------------------===// @@ -405,7 +402,7 @@ /// Storage type for LLVM dialect pointer types. These are uniqued by a pair of /// element type and address space. struct LLVMPointerTypeStorage : public TypeStorage { - using KeyTy = std::tuple; + using KeyTy = std::tuple; LLVMPointerTypeStorage(const KeyTy &key) : pointeeType(std::get<0>(key)), addressSpace(std::get<1>(key)) {} @@ -420,7 +417,7 @@ return std::make_tuple(pointeeType, addressSpace) == key; } - LLVMTypeNew pointeeType; + LLVMType pointeeType; unsigned addressSpace; }; @@ -432,7 +429,7 @@ /// number: arrays, fixed and scalable vectors. The actual semantics of the /// type is defined by its kind. struct LLVMTypeAndSizeStorage : public TypeStorage { - using KeyTy = std::tuple; + using KeyTy = std::tuple; LLVMTypeAndSizeStorage(const KeyTy &key) : elementType(std::get<0>(key)), numElements(std::get<1>(key)) {} @@ -447,7 +444,7 @@ return std::make_tuple(elementType, numElements) == key; } - LLVMTypeNew elementType; + LLVMType elementType; unsigned numElements; }; diff --git a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp --- a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp @@ -20,6 +20,7 @@ #include "mlir/IR/Module.h" #include "mlir/IR/StandardTypes.h" #include "mlir/Support/LLVM.h" +#include "mlir/Target/LLVMIR/TypeTranslation.h" #include "llvm/ADT/TypeSwitch.h" #include "llvm/ADT/SetVector.h" @@ -933,7 +934,9 @@ } llvm::Type *ModuleTranslation::convertType(LLVMType type) { - return LLVM::convertLLVMType(type); + // Lock the LLVM context as we create types in it. + llvm::sys::SmartScopedLock lock(llvmDialect->getLLVMContextMutex()); + return LLVM::translateTypeToLLVMIR(type, llvmDialect->getLLVMContext()); } /// A helper to look up remapped operands in the value remapping table.` diff --git a/mlir/lib/Target/LLVMIR/TypeTranslation.cpp b/mlir/lib/Target/LLVMIR/TypeTranslation.cpp --- a/mlir/lib/Target/LLVMIR/TypeTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/TypeTranslation.cpp @@ -24,14 +24,14 @@ TypeToLLVMIRTranslator(llvm::LLVMContext &context) : context(context) {} /// Translates a single type. - llvm::Type *translateType(LLVM::LLVMTypeNew type) { + llvm::Type *translateType(LLVM::LLVMType type) { // If the conversion is already known, just return it. if (knownTranslations.count(type)) return knownTranslations.lookup(type); // Dispatch to an appropriate function. llvm::Type *translated = - llvm::TypeSwitch(type) + llvm::TypeSwitch(type) .Case([this](LLVM::LLVMVoidType) { return llvm::Type::getVoidTy(context); }) @@ -89,7 +89,7 @@ .Case([this](LLVM::LLVMScalableVectorType vector) { return translateScalableVectorType(vector); }) - .Default([](LLVM::LLVMTypeNew) -> llvm::Type * { + .Default([](LLVM::LLVMType) -> llvm::Type * { llvm_unreachable("unknown LLVM dialect type"); }); @@ -160,7 +160,7 @@ } /// Translates a list of types. - void translateTypes(ArrayRef types, + void translateTypes(ArrayRef types, SmallVectorImpl &result) { result.reserve(result.size() + types.size()); for (auto type : types) @@ -174,14 +174,14 @@ /// results to avoid repeated recursive calls and makes sure identified /// structs with the same name (that is, equal) are resolved to an existing /// type instead of creating a new type. - llvm::DenseMap knownTranslations; + llvm::DenseMap knownTranslations; }; } // end namespace /// Translates a type from MLIR LLVM dialect to LLVM IR. This does not maintain /// the mapping for identified structs so new structs will be created with /// auto-renaming on each call. This is intended exclusively for testing. -llvm::Type *mlir::LLVM::translateTypeToLLVMIR(LLVM::LLVMTypeNew type, +llvm::Type *mlir::LLVM::translateTypeToLLVMIR(LLVM::LLVMType type, llvm::LLVMContext &context) { return TypeToLLVMIRTranslator(context).translateType(type); } @@ -194,12 +194,12 @@ TypeFromLLVMIRTranslator(MLIRContext &context) : context(context) {} /// Translates the given type. - LLVM::LLVMTypeNew translateType(llvm::Type *type) { + LLVM::LLVMType translateType(llvm::Type *type) { if (knownTranslations.count(type)) return knownTranslations.lookup(type); - LLVM::LLVMTypeNew translated = - llvm::TypeSwitch(type) + LLVM::LLVMType translated = + llvm::TypeSwitch(type) .Case([this](llvm::ArrayType *type) { return translateArrayType(type); }) @@ -231,7 +231,7 @@ private: /// Translates the given primitive, i.e. non-parametric in MLIR nomenclature, /// type. - LLVM::LLVMTypeNew translatePrimitiveType(llvm::Type *type) { + LLVM::LLVMType translatePrimitiveType(llvm::Type *type) { if (type->isVoidTy()) return LLVM::LLVMVoidType::get(&context); if (type->isHalfTy()) @@ -258,33 +258,33 @@ } /// Translates the given array type. - LLVM::LLVMTypeNew translateArrayType(llvm::ArrayType *type) { + LLVM::LLVMType translateArrayType(llvm::ArrayType *type) { return LLVM::LLVMArrayType::get(translateType(type->getElementType()), type->getNumElements()); } /// Translates the given function type. - LLVM::LLVMTypeNew translateFunctionType(llvm::FunctionType *type) { - SmallVector paramTypes; + LLVM::LLVMType translateFunctionType(llvm::FunctionType *type) { + SmallVector paramTypes; translateTypes(type->params(), paramTypes); return LLVM::LLVMFunctionType::get(translateType(type->getReturnType()), paramTypes, type->isVarArg()); } /// Translates the given integer type. - LLVM::LLVMTypeNew translateIntegerType(llvm::IntegerType *type) { + LLVM::LLVMType translateIntegerType(llvm::IntegerType *type) { return LLVM::LLVMIntegerType::get(&context, type->getBitWidth()); } /// Translates the given pointer type. - LLVM::LLVMTypeNew translatePointerType(llvm::PointerType *type) { + LLVM::LLVMType translatePointerType(llvm::PointerType *type) { return LLVM::LLVMPointerType::get(translateType(type->getElementType()), type->getAddressSpace()); } /// Translates the given structure type. - LLVM::LLVMTypeNew translateStructType(llvm::StructType *type) { - SmallVector subtypes; + LLVM::LLVMType translateStructType(llvm::StructType *type) { + SmallVector subtypes; if (type->isLiteral()) { translateTypes(type->subtypes(), subtypes); return LLVM::LLVMStructType::getLiteral(&context, subtypes, @@ -306,21 +306,20 @@ } /// Translates the given fixed-vector type. - LLVM::LLVMTypeNew translateFixedVectorType(llvm::FixedVectorType *type) { + LLVM::LLVMType translateFixedVectorType(llvm::FixedVectorType *type) { return LLVM::LLVMFixedVectorType::get(translateType(type->getElementType()), type->getNumElements()); } /// Translates the given scalable-vector type. - LLVM::LLVMTypeNew - translateScalableVectorType(llvm::ScalableVectorType *type) { + LLVM::LLVMType translateScalableVectorType(llvm::ScalableVectorType *type) { return LLVM::LLVMScalableVectorType::get( translateType(type->getElementType()), type->getMinNumElements()); } /// Translates a list of types. void translateTypes(ArrayRef types, - SmallVectorImpl &result) { + SmallVectorImpl &result) { result.reserve(result.size() + types.size()); for (llvm::Type *type : types) result.push_back(translateType(type)); @@ -328,7 +327,7 @@ /// Map of known translations. Serves as a cache and as recursion stopper for /// translating recursive structs. - llvm::DenseMap knownTranslations; + llvm::DenseMap knownTranslations; /// The context in which MLIR types are created. MLIRContext &context; @@ -337,7 +336,7 @@ /// Translates a type from LLVM IR to MLIR LLVM dialect. This is intended /// exclusively for testing. -LLVM::LLVMTypeNew mlir::LLVM::translateTypeFromLLVMIR(llvm::Type *type, - MLIRContext &context) { +LLVM::LLVMType mlir::LLVM::translateTypeFromLLVMIR(llvm::Type *type, + MLIRContext &context) { return TypeFromLLVMIRTranslator(context).translateType(type); } diff --git a/mlir/test/Conversion/GPUCommon/lower-launch-func-to-gpu-runtime-calls.mlir b/mlir/test/Conversion/GPUCommon/lower-launch-func-to-gpu-runtime-calls.mlir --- a/mlir/test/Conversion/GPUCommon/lower-launch-func-to-gpu-runtime-calls.mlir +++ b/mlir/test/Conversion/GPUCommon/lower-launch-func-to-gpu-runtime-calls.mlir @@ -8,27 +8,27 @@ // ROCDL: llvm.mlir.global internal constant @[[global:.*]]("HSACO") gpu.module @kernel_module attributes {nvvm.cubin = "CUBIN", rocdl.hsaco = "HSACO"} { - llvm.func @kernel(%arg0: !llvm.float, %arg1: !llvm<"float*">) attributes {gpu.kernel} { + llvm.func @kernel(%arg0: !llvm.float, %arg1: !llvm.ptr) attributes {gpu.kernel} { llvm.return } } llvm.func @foo() { %0 = "op"() : () -> (!llvm.float) - %1 = "op"() : () -> (!llvm<"float*">) + %1 = "op"() : () -> (!llvm.ptr) %cst = llvm.mlir.constant(8 : index) : !llvm.i64 // CHECK: %[[addressof:.*]] = llvm.mlir.addressof @[[global]] // CHECK: %[[c0:.*]] = llvm.mlir.constant(0 : index) // CHECK: %[[binary:.*]] = llvm.getelementptr %[[addressof]][%[[c0]], %[[c0]]] - // CHECK-SAME: -> !llvm<"i8*"> - // CHECK: %[[module:.*]] = llvm.call @mgpuModuleLoad(%[[binary]]) : (!llvm<"i8*">) -> !llvm<"i8*"> - // CHECK: %[[func:.*]] = llvm.call @mgpuModuleGetFunction(%[[module]], {{.*}}) : (!llvm<"i8*">, !llvm<"i8*">) -> !llvm<"i8*"> + // CHECK-SAME: -> !llvm.ptr + // CHECK: %[[module:.*]] = llvm.call @mgpuModuleLoad(%[[binary]]) : (!llvm.ptr) -> !llvm.ptr + // CHECK: %[[func:.*]] = llvm.call @mgpuModuleGetFunction(%[[module]], {{.*}}) : (!llvm.ptr, !llvm.ptr) -> !llvm.ptr // CHECK: llvm.call @mgpuStreamCreate // CHECK: llvm.call @mgpuLaunchKernel // CHECK: llvm.call @mgpuStreamSynchronize "gpu.launch_func"(%cst, %cst, %cst, %cst, %cst, %cst, %0, %1) { kernel = @kernel_module::@kernel } - : (!llvm.i64, !llvm.i64, !llvm.i64, !llvm.i64, !llvm.i64, !llvm.i64, !llvm.float, !llvm<"float*">) -> () + : (!llvm.i64, !llvm.i64, !llvm.i64, !llvm.i64, !llvm.i64, !llvm.i64, !llvm.float, !llvm.ptr) -> () llvm.return } diff --git a/mlir/test/Conversion/GPUCommon/memory-attrbution.mlir b/mlir/test/Conversion/GPUCommon/memory-attrbution.mlir --- a/mlir/test/Conversion/GPUCommon/memory-attrbution.mlir +++ b/mlir/test/Conversion/GPUCommon/memory-attrbution.mlir @@ -6,13 +6,13 @@ gpu.func @private(%arg0: f32) private(%arg1: memref<4xf32, 5>) { // Allocate private memory inside the function. // NVVM: %[[size:.*]] = llvm.mlir.constant(4 : i64) : !llvm.i64 - // NVVM: %[[raw:.*]] = llvm.alloca %[[size]] x !llvm.float : (!llvm.i64) -> !llvm<"float*"> + // NVVM: %[[raw:.*]] = llvm.alloca %[[size]] x !llvm.float : (!llvm.i64) -> !llvm.ptr // ROCDL: %[[size:.*]] = llvm.mlir.constant(4 : i64) : !llvm.i64 - // ROCDL: %[[raw:.*]] = llvm.alloca %[[size]] x !llvm.float : (!llvm.i64) -> !llvm<"float addrspace(5)*"> + // ROCDL: %[[raw:.*]] = llvm.alloca %[[size]] x !llvm.float : (!llvm.i64) -> !llvm.ptr // Populate the memref descriptor. - // NVVM: %[[descr1:.*]] = llvm.mlir.undef : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> + // NVVM: %[[descr1:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> // NVVM: %[[descr2:.*]] = llvm.insertvalue %[[raw]], %[[descr1]][0] // NVVM: %[[descr3:.*]] = llvm.insertvalue %[[raw]], %[[descr2]][1] // NVVM: %[[c0:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 @@ -22,7 +22,7 @@ // NVVM: %[[c1:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 // NVVM: %[[descr6:.*]] = llvm.insertvalue %[[c1]], %[[descr5]][4, 0] - // ROCDL: %[[descr1:.*]] = llvm.mlir.undef : !llvm<"{ float addrspace(5)*, float addrspace(5)*, i64, [1 x i64], [1 x i64] }"> + // ROCDL: %[[descr1:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> // ROCDL: %[[descr2:.*]] = llvm.insertvalue %[[raw]], %[[descr1]][0] // ROCDL: %[[descr3:.*]] = llvm.insertvalue %[[raw]], %[[descr2]][1] // ROCDL: %[[c0:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 @@ -54,11 +54,11 @@ // Workgroup buffers are allocated as globals. // NVVM: llvm.mlir.global internal @[[$buffer:.*]]() // NVVM-SAME: addr_space = 3 - // NVVM-SAME: !llvm<"[4 x float]"> + // NVVM-SAME: !llvm.array<4 x float> // ROCDL: llvm.mlir.global internal @[[$buffer:.*]]() // ROCDL-SAME: addr_space = 3 - // ROCDL-SAME: !llvm<"[4 x float]"> + // ROCDL-SAME: !llvm.array<4 x float> // NVVM-LABEL: llvm.func @workgroup // NVVM-SAME: { @@ -68,17 +68,17 @@ gpu.func @workgroup(%arg0: f32) workgroup(%arg1: memref<4xf32, 3>) { // Get the address of the first element in the global array. // NVVM: %[[c0:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 - // NVVM: %[[addr:.*]] = llvm.mlir.addressof @[[$buffer]] : !llvm<"[4 x float] addrspace(3)*"> + // NVVM: %[[addr:.*]] = llvm.mlir.addressof @[[$buffer]] : !llvm.ptr, 3> // NVVM: %[[raw:.*]] = llvm.getelementptr %[[addr]][%[[c0]], %[[c0]]] - // NVVM-SAME: !llvm<"float addrspace(3)*"> + // NVVM-SAME: !llvm.ptr // ROCDL: %[[c0:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 - // ROCDL: %[[addr:.*]] = llvm.mlir.addressof @[[$buffer]] : !llvm<"[4 x float] addrspace(3)*"> + // ROCDL: %[[addr:.*]] = llvm.mlir.addressof @[[$buffer]] : !llvm.ptr, 3> // ROCDL: %[[raw:.*]] = llvm.getelementptr %[[addr]][%[[c0]], %[[c0]]] - // ROCDL-SAME: !llvm<"float addrspace(3)*"> + // ROCDL-SAME: !llvm.ptr // Populate the memref descriptor. - // NVVM: %[[descr1:.*]] = llvm.mlir.undef : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i64, [1 x i64], [1 x i64] }"> + // NVVM: %[[descr1:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> // NVVM: %[[descr2:.*]] = llvm.insertvalue %[[raw]], %[[descr1]][0] // NVVM: %[[descr3:.*]] = llvm.insertvalue %[[raw]], %[[descr2]][1] // NVVM: %[[c0:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 @@ -88,7 +88,7 @@ // NVVM: %[[c1:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 // NVVM: %[[descr6:.*]] = llvm.insertvalue %[[c1]], %[[descr5]][4, 0] - // ROCDL: %[[descr1:.*]] = llvm.mlir.undef : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i64, [1 x i64], [1 x i64] }"> + // ROCDL: %[[descr1:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> // ROCDL: %[[descr2:.*]] = llvm.insertvalue %[[raw]], %[[descr1]][0] // ROCDL: %[[descr3:.*]] = llvm.insertvalue %[[raw]], %[[descr2]][1] // ROCDL: %[[c0:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 @@ -120,28 +120,28 @@ // Check that the total size was computed correctly. // NVVM: llvm.mlir.global internal @[[$buffer:.*]]() // NVVM-SAME: addr_space = 3 - // NVVM-SAME: !llvm<"[48 x float]"> + // NVVM-SAME: !llvm.array<48 x float> // ROCDL: llvm.mlir.global internal @[[$buffer:.*]]() // ROCDL-SAME: addr_space = 3 - // ROCDL-SAME: !llvm<"[48 x float]"> + // ROCDL-SAME: !llvm.array<48 x float> // NVVM-LABEL: llvm.func @workgroup3d // ROCDL-LABEL: llvm.func @workgroup3d gpu.func @workgroup3d(%arg0: f32) workgroup(%arg1: memref<4x2x6xf32, 3>) { // Get the address of the first element in the global array. // NVVM: %[[c0:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 - // NVVM: %[[addr:.*]] = llvm.mlir.addressof @[[$buffer]] : !llvm<"[48 x float] addrspace(3)*"> + // NVVM: %[[addr:.*]] = llvm.mlir.addressof @[[$buffer]] : !llvm.ptr, 3> // NVVM: %[[raw:.*]] = llvm.getelementptr %[[addr]][%[[c0]], %[[c0]]] - // NVVM-SAME: !llvm<"float addrspace(3)*"> + // NVVM-SAME: !llvm.ptr // ROCDL: %[[c0:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 - // ROCDL: %[[addr:.*]] = llvm.mlir.addressof @[[$buffer]] : !llvm<"[48 x float] addrspace(3)*"> + // ROCDL: %[[addr:.*]] = llvm.mlir.addressof @[[$buffer]] : !llvm.ptr, 3> // ROCDL: %[[raw:.*]] = llvm.getelementptr %[[addr]][%[[c0]], %[[c0]]] - // ROCDL-SAME: !llvm<"float addrspace(3)*"> + // ROCDL-SAME: !llvm.ptr // Populate the memref descriptor. - // NVVM: %[[descr1:.*]] = llvm.mlir.undef : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i64, [3 x i64], [3 x i64] }"> + // NVVM: %[[descr1:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> // NVVM: %[[descr2:.*]] = llvm.insertvalue %[[raw]], %[[descr1]][0] // NVVM: %[[descr3:.*]] = llvm.insertvalue %[[raw]], %[[descr2]][1] // NVVM: %[[c0:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 @@ -159,7 +159,7 @@ // NVVM: %[[c1:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 // NVVM: %[[descr10:.*]] = llvm.insertvalue %[[c1]], %[[descr9]][4, 2] - // ROCDL: %[[descr1:.*]] = llvm.mlir.undef : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i64, [3 x i64], [3 x i64] }"> + // ROCDL: %[[descr1:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> // ROCDL: %[[descr2:.*]] = llvm.insertvalue %[[raw]], %[[descr1]][0] // ROCDL: %[[descr3:.*]] = llvm.insertvalue %[[raw]], %[[descr2]][1] // ROCDL: %[[c0:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 @@ -188,14 +188,14 @@ gpu.module @kernel { // Check that several buffers are defined. // NVVM: llvm.mlir.global internal @[[$buffer1:.*]]() - // NVVM-SAME: !llvm<"[1 x float]"> + // NVVM-SAME: !llvm.array<1 x float> // NVVM: llvm.mlir.global internal @[[$buffer2:.*]]() - // NVVM-SAME: !llvm<"[2 x float]"> + // NVVM-SAME: !llvm.array<2 x float> // ROCDL: llvm.mlir.global internal @[[$buffer1:.*]]() - // ROCDL-SAME: !llvm<"[1 x float]"> + // ROCDL-SAME: !llvm.array<1 x float> // ROCDL: llvm.mlir.global internal @[[$buffer2:.*]]() - // ROCDL-SAME: !llvm<"[2 x float]"> + // ROCDL-SAME: !llvm.array<2 x float> // NVVM-LABEL: llvm.func @multiple // ROCDL-LABEL: llvm.func @multiple @@ -212,14 +212,14 @@ // Private buffers. // NVVM: %[[c3:.*]] = llvm.mlir.constant(3 : i64) - // NVVM: llvm.alloca %[[c3]] x !llvm.float : (!llvm.i64) -> !llvm<"float*"> + // NVVM: llvm.alloca %[[c3]] x !llvm.float : (!llvm.i64) -> !llvm.ptr // NVVM: %[[c4:.*]] = llvm.mlir.constant(4 : i64) - // NVVM: llvm.alloca %[[c4]] x !llvm.float : (!llvm.i64) -> !llvm<"float*"> + // NVVM: llvm.alloca %[[c4]] x !llvm.float : (!llvm.i64) -> !llvm.ptr // ROCDL: %[[c3:.*]] = llvm.mlir.constant(3 : i64) - // ROCDL: llvm.alloca %[[c3]] x !llvm.float : (!llvm.i64) -> !llvm<"float addrspace(5)*"> + // ROCDL: llvm.alloca %[[c3]] x !llvm.float : (!llvm.i64) -> !llvm.ptr // ROCDL: %[[c4:.*]] = llvm.mlir.constant(4 : i64) - // ROCDL: llvm.alloca %[[c4]] x !llvm.float : (!llvm.i64) -> !llvm<"float addrspace(5)*"> + // ROCDL: llvm.alloca %[[c4]] x !llvm.float : (!llvm.i64) -> !llvm.ptr %c0 = constant 0 : index store %arg0, %arg1[%c0] : memref<1xf32, 3> diff --git a/mlir/test/Conversion/GPUToCUDA/lower-nvvm-kernel-to-cubin.mlir b/mlir/test/Conversion/GPUToCUDA/lower-nvvm-kernel-to-cubin.mlir --- a/mlir/test/Conversion/GPUToCUDA/lower-nvvm-kernel-to-cubin.mlir +++ b/mlir/test/Conversion/GPUToCUDA/lower-nvvm-kernel-to-cubin.mlir @@ -2,7 +2,7 @@ // CHECK: attributes {nvvm.cubin = "CUBIN"} gpu.module @foo { - llvm.func @kernel(%arg0 : !llvm.float, %arg1 : !llvm<"float*">) + llvm.func @kernel(%arg0 : !llvm.float, %arg1 : !llvm.ptr) // CHECK: attributes {gpu.kernel} attributes { gpu.kernel } { llvm.return diff --git a/mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir b/mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir --- a/mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir +++ b/mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir @@ -120,9 +120,9 @@ // CHECK: %[[#SHL:]] = llvm.shl %[[#ONE]], %[[#WIDTH]] : !llvm.i32 // CHECK: %[[#MASK:]] = llvm.sub %[[#SHL]], %[[#ONE]] : !llvm.i32 // CHECK: %[[#CLAMP:]] = llvm.sub %[[#WIDTH]], %[[#ONE]] : !llvm.i32 - // CHECK: %[[#SHFL:]] = nvvm.shfl.sync.bfly %[[#MASK]], %[[#VALUE]], %[[#OFFSET]], %[[#CLAMP]] : !llvm<"{ float, i1 }"> - // CHECK: llvm.extractvalue %[[#SHFL]][0 : index] : !llvm<"{ float, i1 }"> - // CHECK: llvm.extractvalue %[[#SHFL]][1 : index] : !llvm<"{ float, i1 }"> + // CHECK: %[[#SHFL:]] = nvvm.shfl.sync.bfly %[[#MASK]], %[[#VALUE]], %[[#OFFSET]], %[[#CLAMP]] : !llvm.struct<(float, i1)> + // CHECK: llvm.extractvalue %[[#SHFL]][0 : index] : !llvm.struct<(float, i1)> + // CHECK: llvm.extractvalue %[[#SHFL]][1 : index] : !llvm.struct<(float, i1)> %shfl, %pred = "gpu.shuffle"(%arg0, %arg1, %arg2) { mode = "xor" } : (f32, i32, i32) -> (f32, i1) std.return %shfl : f32 diff --git a/mlir/test/Conversion/GPUToROCm/lower-rocdl-kernel-to-hsaco.mlir b/mlir/test/Conversion/GPUToROCm/lower-rocdl-kernel-to-hsaco.mlir --- a/mlir/test/Conversion/GPUToROCm/lower-rocdl-kernel-to-hsaco.mlir +++ b/mlir/test/Conversion/GPUToROCm/lower-rocdl-kernel-to-hsaco.mlir @@ -2,7 +2,7 @@ // CHECK: attributes {rocdl.hsaco = "HSACO"} gpu.module @foo { - llvm.func @kernel(%arg0 : !llvm.float, %arg1 : !llvm<"float*">) + llvm.func @kernel(%arg0 : !llvm.float, %arg1 : !llvm.ptr) // CHECK: attributes {gpu.kernel} attributes { gpu.kernel } { llvm.return diff --git a/mlir/test/Conversion/GPUToVulkan/invoke-vulkan.mlir b/mlir/test/Conversion/GPUToVulkan/invoke-vulkan.mlir --- a/mlir/test/Conversion/GPUToVulkan/invoke-vulkan.mlir +++ b/mlir/test/Conversion/GPUToVulkan/invoke-vulkan.mlir @@ -2,60 +2,60 @@ // CHECK: llvm.mlir.global internal constant @kernel_spv_entry_point_name // CHECK: llvm.mlir.global internal constant @SPIRV_BIN -// CHECK: %[[Vulkan_Runtime_ptr:.*]] = llvm.call @initVulkan() : () -> !llvm<"i8*"> +// CHECK: %[[Vulkan_Runtime_ptr:.*]] = llvm.call @initVulkan() : () -> !llvm.ptr // CHECK: %[[addressof_SPIRV_BIN:.*]] = llvm.mlir.addressof @SPIRV_BIN // CHECK: %[[SPIRV_BIN_ptr:.*]] = llvm.getelementptr %[[addressof_SPIRV_BIN]] // CHECK: %[[SPIRV_BIN_size:.*]] = llvm.mlir.constant -// CHECK: llvm.call @bindMemRef1DFloat(%[[Vulkan_Runtime_ptr]], %{{.*}}, %{{.*}}, %{{.*}}) : (!llvm<"i8*">, !llvm.i32, !llvm.i32, !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }*">) -> !llvm.void -// CHECK: llvm.call @setBinaryShader(%[[Vulkan_Runtime_ptr]], %[[SPIRV_BIN_ptr]], %[[SPIRV_BIN_size]]) : (!llvm<"i8*">, !llvm<"i8*">, !llvm.i32) -> !llvm.void +// CHECK: llvm.call @bindMemRef1DFloat(%[[Vulkan_Runtime_ptr]], %{{.*}}, %{{.*}}, %{{.*}}) : (!llvm.ptr, !llvm.i32, !llvm.i32, !llvm.ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>>) -> !llvm.void +// CHECK: llvm.call @setBinaryShader(%[[Vulkan_Runtime_ptr]], %[[SPIRV_BIN_ptr]], %[[SPIRV_BIN_size]]) : (!llvm.ptr, !llvm.ptr, !llvm.i32) -> !llvm.void // CHECK: %[[addressof_entry_point:.*]] = llvm.mlir.addressof @kernel_spv_entry_point_name // CHECK: %[[entry_point_ptr:.*]] = llvm.getelementptr %[[addressof_entry_point]] -// CHECK: llvm.call @setEntryPoint(%[[Vulkan_Runtime_ptr]], %[[entry_point_ptr]]) : (!llvm<"i8*">, !llvm<"i8*">) -> !llvm.void -// CHECK: llvm.call @setNumWorkGroups(%[[Vulkan_Runtime_ptr]], %{{.*}}, %{{.*}}, %{{.*}}) : (!llvm<"i8*">, !llvm.i64, !llvm.i64, !llvm.i64) -> !llvm.void -// CHECK: llvm.call @runOnVulkan(%[[Vulkan_Runtime_ptr]]) : (!llvm<"i8*">) -> !llvm.void -// CHECK: llvm.call @deinitVulkan(%[[Vulkan_Runtime_ptr]]) : (!llvm<"i8*">) -> !llvm.void +// CHECK: llvm.call @setEntryPoint(%[[Vulkan_Runtime_ptr]], %[[entry_point_ptr]]) : (!llvm.ptr, !llvm.ptr) -> !llvm.void +// CHECK: llvm.call @setNumWorkGroups(%[[Vulkan_Runtime_ptr]], %{{.*}}, %{{.*}}, %{{.*}}) : (!llvm.ptr, !llvm.i64, !llvm.i64, !llvm.i64) -> !llvm.void +// CHECK: llvm.call @runOnVulkan(%[[Vulkan_Runtime_ptr]]) : (!llvm.ptr) -> !llvm.void +// CHECK: llvm.call @deinitVulkan(%[[Vulkan_Runtime_ptr]]) : (!llvm.ptr) -> !llvm.void module attributes {gpu.container_module} { - llvm.func @malloc(!llvm.i64) -> !llvm<"i8*"> + llvm.func @malloc(!llvm.i64) -> !llvm.ptr llvm.func @foo() { %0 = llvm.mlir.constant(12 : index) : !llvm.i64 - %1 = llvm.mlir.null : !llvm<"float*"> + %1 = llvm.mlir.null : !llvm.ptr %2 = llvm.mlir.constant(1 : index) : !llvm.i64 - %3 = llvm.getelementptr %1[%2] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - %4 = llvm.ptrtoint %3 : !llvm<"float*"> to !llvm.i64 + %3 = llvm.getelementptr %1[%2] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + %4 = llvm.ptrtoint %3 : !llvm.ptr to !llvm.i64 %5 = llvm.mul %0, %4 : !llvm.i64 - %6 = llvm.call @malloc(%5) : (!llvm.i64) -> !llvm<"i8*"> - %7 = llvm.bitcast %6 : !llvm<"i8*"> to !llvm<"float*"> - %8 = llvm.mlir.undef : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %9 = llvm.insertvalue %7, %8[0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %10 = llvm.insertvalue %7, %9[1] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> + %6 = llvm.call @malloc(%5) : (!llvm.i64) -> !llvm.ptr + %7 = llvm.bitcast %6 : !llvm.ptr to !llvm.ptr + %8 = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %9 = llvm.insertvalue %7, %8[0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %10 = llvm.insertvalue %7, %9[1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> %11 = llvm.mlir.constant(0 : index) : !llvm.i64 - %12 = llvm.insertvalue %11, %10[2] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> + %12 = llvm.insertvalue %11, %10[2] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> %13 = llvm.mlir.constant(1 : index) : !llvm.i64 - %14 = llvm.insertvalue %0, %12[3, 0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %15 = llvm.insertvalue %13, %14[4, 0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> + %14 = llvm.insertvalue %0, %12[3, 0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %15 = llvm.insertvalue %13, %14[4, 0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> %16 = llvm.mlir.constant(1 : index) : !llvm.i64 - %17 = llvm.extractvalue %15[0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %18 = llvm.extractvalue %15[1] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %19 = llvm.extractvalue %15[2] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %20 = llvm.extractvalue %15[3, 0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %21 = llvm.extractvalue %15[4, 0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> + %17 = llvm.extractvalue %15[0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %18 = llvm.extractvalue %15[1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %19 = llvm.extractvalue %15[2] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %20 = llvm.extractvalue %15[3, 0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %21 = llvm.extractvalue %15[4, 0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> llvm.call @vulkanLaunch(%16, %16, %16, %17, %18, %19, %20, %21) {spirv_blob = "\03\02#\07\00", spirv_entry_point = "kernel"} - : (!llvm.i64, !llvm.i64, !llvm.i64, !llvm<"float*">, !llvm<"float*">, !llvm.i64, !llvm.i64, !llvm.i64) -> () + : (!llvm.i64, !llvm.i64, !llvm.i64, !llvm.ptr, !llvm.ptr, !llvm.i64, !llvm.i64, !llvm.i64) -> () llvm.return } - llvm.func @vulkanLaunch(%arg0: !llvm.i64, %arg1: !llvm.i64, %arg2: !llvm.i64, %arg6: !llvm<"float*">, %arg7: !llvm<"float*">, %arg8: !llvm.i64, %arg9: !llvm.i64, %arg10: !llvm.i64) { - %0 = llvm.mlir.undef : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %1 = llvm.insertvalue %arg6, %0[0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %2 = llvm.insertvalue %arg7, %1[1] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %3 = llvm.insertvalue %arg8, %2[2] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %4 = llvm.insertvalue %arg9, %3[3, 0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %5 = llvm.insertvalue %arg10, %4[4, 0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> + llvm.func @vulkanLaunch(%arg0: !llvm.i64, %arg1: !llvm.i64, %arg2: !llvm.i64, %arg6: !llvm.ptr, %arg7: !llvm.ptr, %arg8: !llvm.i64, %arg9: !llvm.i64, %arg10: !llvm.i64) { + %0 = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %1 = llvm.insertvalue %arg6, %0[0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %2 = llvm.insertvalue %arg7, %1[1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %3 = llvm.insertvalue %arg8, %2[2] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %4 = llvm.insertvalue %arg9, %3[3, 0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %5 = llvm.insertvalue %arg10, %4[4, 0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> %6 = llvm.mlir.constant(1 : index) : !llvm.i64 - %7 = llvm.alloca %6 x !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> : (!llvm.i64) -> !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }*"> - llvm.store %5, %7 : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }*"> - llvm.call @_mlir_ciface_vulkanLaunch(%arg0, %arg1, %arg2, %7) : (!llvm.i64, !llvm.i64, !llvm.i64, !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }*">) -> () + %7 = llvm.alloca %6 x !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> : (!llvm.i64) -> !llvm.ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>> + llvm.store %5, %7 : !llvm.ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>> + llvm.call @_mlir_ciface_vulkanLaunch(%arg0, %arg1, %arg2, %7) : (!llvm.i64, !llvm.i64, !llvm.i64, !llvm.ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>>) -> () llvm.return } - llvm.func @_mlir_ciface_vulkanLaunch(!llvm.i64, !llvm.i64, !llvm.i64, !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }*">) + llvm.func @_mlir_ciface_vulkanLaunch(!llvm.i64, !llvm.i64, !llvm.i64, !llvm.ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>>) } diff --git a/mlir/test/Conversion/SPIRVToLLVM/arithmetic-ops-to-llvm.mlir b/mlir/test/Conversion/SPIRVToLLVM/arithmetic-ops-to-llvm.mlir --- a/mlir/test/Conversion/SPIRVToLLVM/arithmetic-ops-to-llvm.mlir +++ b/mlir/test/Conversion/SPIRVToLLVM/arithmetic-ops-to-llvm.mlir @@ -11,7 +11,7 @@ } func @iadd_vector(%arg0: vector<4xi64>, %arg1: vector<4xi64>) { - // CHECK: %{{.*}} = llvm.add %{{.*}}, %{{.*}} : !llvm<"<4 x i64>"> + // CHECK: %{{.*}} = llvm.add %{{.*}}, %{{.*}} : !llvm.vec<4 x i64> %0 = spv.IAdd %arg0, %arg1 : vector<4xi64> return } @@ -27,7 +27,7 @@ } func @isub_vector(%arg0: vector<2xi16>, %arg1: vector<2xi16>) { - // CHECK: %{{.*}} = llvm.sub %{{.*}}, %{{.*}} : !llvm<"<2 x i16>"> + // CHECK: %{{.*}} = llvm.sub %{{.*}}, %{{.*}} : !llvm.vec<2 x i16> %0 = spv.ISub %arg0, %arg1 : vector<2xi16> return } @@ -43,7 +43,7 @@ } func @imul_vector(%arg0: vector<3xi32>, %arg1: vector<3xi32>) { - // CHECK: %{{.*}} = llvm.mul %{{.*}}, %{{.*}} : !llvm<"<3 x i32>"> + // CHECK: %{{.*}} = llvm.mul %{{.*}}, %{{.*}} : !llvm.vec<3 x i32> %0 = spv.IMul %arg0, %arg1 : vector<3xi32> return } @@ -59,7 +59,7 @@ } func @fadd_vector(%arg0: vector<4xf32>, %arg1: vector<4xf32>) { - // CHECK: %{{.*}} = llvm.fadd %{{.*}}, %{{.*}} : !llvm<"<4 x float>"> + // CHECK: %{{.*}} = llvm.fadd %{{.*}}, %{{.*}} : !llvm.vec<4 x float> %0 = spv.FAdd %arg0, %arg1 : vector<4xf32> return } @@ -75,7 +75,7 @@ } func @fsub_vector(%arg0: vector<2xf32>, %arg1: vector<2xf32>) { - // CHECK: %{{.*}} = llvm.fsub %{{.*}}, %{{.*}} : !llvm<"<2 x float>"> + // CHECK: %{{.*}} = llvm.fsub %{{.*}}, %{{.*}} : !llvm.vec<2 x float> %0 = spv.FSub %arg0, %arg1 : vector<2xf32> return } @@ -91,7 +91,7 @@ } func @fdiv_vector(%arg0: vector<3xf64>, %arg1: vector<3xf64>) { - // CHECK: %{{.*}} = llvm.fdiv %{{.*}}, %{{.*}} : !llvm<"<3 x double>"> + // CHECK: %{{.*}} = llvm.fdiv %{{.*}}, %{{.*}} : !llvm.vec<3 x double> %0 = spv.FDiv %arg0, %arg1 : vector<3xf64> return } @@ -107,7 +107,7 @@ } func @fmul_vector(%arg0: vector<2xf32>, %arg1: vector<2xf32>) { - // CHECK: %{{.*}} = llvm.fmul %{{.*}}, %{{.*}} : !llvm<"<2 x float>"> + // CHECK: %{{.*}} = llvm.fmul %{{.*}}, %{{.*}} : !llvm.vec<2 x float> %0 = spv.FMul %arg0, %arg1 : vector<2xf32> return } @@ -123,7 +123,7 @@ } func @frem_vector(%arg0: vector<3xf64>, %arg1: vector<3xf64>) { - // CHECK: %{{.*}} = llvm.frem %{{.*}}, %{{.*}} : !llvm<"<3 x double>"> + // CHECK: %{{.*}} = llvm.frem %{{.*}}, %{{.*}} : !llvm.vec<3 x double> %0 = spv.FRem %arg0, %arg1 : vector<3xf64> return } @@ -139,7 +139,7 @@ } func @fneg_vector(%arg: vector<2xf32>) { - // CHECK: %{{.*}} = llvm.fneg %{{.*}} : !llvm<"<2 x float>"> + // CHECK: %{{.*}} = llvm.fneg %{{.*}} : !llvm.vec<2 x float> %0 = spv.FNegate %arg : vector<2xf32> return } @@ -155,7 +155,7 @@ } func @udiv_vector(%arg0: vector<3xi64>, %arg1: vector<3xi64>) { - // CHECK: %{{.*}} = llvm.udiv %{{.*}}, %{{.*}} : !llvm<"<3 x i64>"> + // CHECK: %{{.*}} = llvm.udiv %{{.*}}, %{{.*}} : !llvm.vec<3 x i64> %0 = spv.UDiv %arg0, %arg1 : vector<3xi64> return } @@ -171,7 +171,7 @@ } func @umod_vector(%arg0: vector<3xi64>, %arg1: vector<3xi64>) { - // CHECK: %{{.*}} = llvm.urem %{{.*}}, %{{.*}} : !llvm<"<3 x i64>"> + // CHECK: %{{.*}} = llvm.urem %{{.*}}, %{{.*}} : !llvm.vec<3 x i64> %0 = spv.UMod %arg0, %arg1 : vector<3xi64> return } @@ -187,7 +187,7 @@ } func @sdiv_vector(%arg0: vector<2xi64>, %arg1: vector<2xi64>) { - // CHECK: %{{.*}} = llvm.sdiv %{{.*}}, %{{.*}} : !llvm<"<2 x i64>"> + // CHECK: %{{.*}} = llvm.sdiv %{{.*}}, %{{.*}} : !llvm.vec<2 x i64> %0 = spv.SDiv %arg0, %arg1 : vector<2xi64> return } @@ -203,7 +203,7 @@ } func @srem_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) { - // CHECK: %{{.*}} = llvm.srem %{{.*}}, %{{.*}} : !llvm<"<4 x i32>"> + // CHECK: %{{.*}} = llvm.srem %{{.*}}, %{{.*}} : !llvm.vec<4 x i32> %0 = spv.SRem %arg0, %arg1 : vector<4xi32> return } diff --git a/mlir/test/Conversion/SPIRVToLLVM/bitwise-ops-to-llvm.mlir b/mlir/test/Conversion/SPIRVToLLVM/bitwise-ops-to-llvm.mlir --- a/mlir/test/Conversion/SPIRVToLLVM/bitwise-ops-to-llvm.mlir +++ b/mlir/test/Conversion/SPIRVToLLVM/bitwise-ops-to-llvm.mlir @@ -11,7 +11,7 @@ } func @bitcount_vector(%arg0: vector<3xi32>) { - // CHECK: %{{.*}} = "llvm.intr.ctpop"(%{{.*}}) : (!llvm<"<3 x i32>">) -> !llvm<"<3 x i32>"> + // CHECK: %{{.*}} = "llvm.intr.ctpop"(%{{.*}}) : (!llvm.vec<3 x i32>) -> !llvm.vec<3 x i32> %0 = spv.BitCount %arg0: vector<3xi32> return } @@ -27,7 +27,7 @@ } func @bitreverse_vector(%arg0: vector<4xi32>) { - // CHECK: %{{.*}} = "llvm.intr.bitreverse"(%{{.*}}) : (!llvm<"<4 x i32>">) -> !llvm<"<4 x i32>"> + // CHECK: %{{.*}} = "llvm.intr.bitreverse"(%{{.*}}) : (!llvm.vec<4 x i32>) -> !llvm.vec<4 x i32> %0 = spv.BitReverse %arg0: vector<4xi32> return } @@ -86,26 +86,26 @@ } // CHECK-LABEL: func @bitfield_insert_vector -// CHECK-SAME: %[[BASE:.*]]: !llvm<"<2 x i32>">, %[[INSERT:.*]]: !llvm<"<2 x i32>">, %[[OFFSET:.*]]: !llvm.i32, %[[COUNT:.*]]: !llvm.i32 +// CHECK-SAME: %[[BASE:.*]]: !llvm.vec<2 x i32>, %[[INSERT:.*]]: !llvm.vec<2 x i32>, %[[OFFSET:.*]]: !llvm.i32, %[[COUNT:.*]]: !llvm.i32 func @bitfield_insert_vector(%base: vector<2xi32>, %insert: vector<2xi32>, %offset: i32, %count: i32) { - // CHECK: %[[OFFSET_V0:.*]] = llvm.mlir.undef : !llvm<"<2 x i32>"> + // CHECK: %[[OFFSET_V0:.*]] = llvm.mlir.undef : !llvm.vec<2 x i32> // CHECK: %[[ZERO:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 - // CHECK: %[[OFFSET_V1:.*]] = llvm.insertelement %[[OFFSET]], %[[OFFSET_V0]][%[[ZERO]] : !llvm.i32] : !llvm<"<2 x i32>"> + // CHECK: %[[OFFSET_V1:.*]] = llvm.insertelement %[[OFFSET]], %[[OFFSET_V0]][%[[ZERO]] : !llvm.i32] : !llvm.vec<2 x i32> // CHECK: %[[ONE:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32 - // CHECK: %[[OFFSET_V2:.*]] = llvm.insertelement %[[OFFSET]], %[[OFFSET_V1]][%[[ONE]] : !llvm.i32] : !llvm<"<2 x i32>"> - // CHECK: %[[COUNT_V0:.*]] = llvm.mlir.undef : !llvm<"<2 x i32>"> + // CHECK: %[[OFFSET_V2:.*]] = llvm.insertelement %[[OFFSET]], %[[OFFSET_V1]][%[[ONE]] : !llvm.i32] : !llvm.vec<2 x i32> + // CHECK: %[[COUNT_V0:.*]] = llvm.mlir.undef : !llvm.vec<2 x i32> // CHECK: %[[ZERO:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 - // CHECK: %[[COUNT_V1:.*]] = llvm.insertelement %[[COUNT]], %[[COUNT_V0]][%[[ZERO]] : !llvm.i32] : !llvm<"<2 x i32>"> + // CHECK: %[[COUNT_V1:.*]] = llvm.insertelement %[[COUNT]], %[[COUNT_V0]][%[[ZERO]] : !llvm.i32] : !llvm.vec<2 x i32> // CHECK: %[[ONE:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32 - // CHECK: %[[COUNT_V2:.*]] = llvm.insertelement %[[COUNT]], %[[COUNT_V1]][%[[ONE]] : !llvm.i32] : !llvm<"<2 x i32>"> - // CHECK: %[[MINUS_ONE:.*]] = llvm.mlir.constant(dense<-1> : vector<2xi32>) : !llvm<"<2 x i32>"> - // CHECK: %[[T0:.*]] = llvm.shl %[[MINUS_ONE]], %[[COUNT_V2]] : !llvm<"<2 x i32>"> - // CHECK: %[[T1:.*]] = llvm.xor %[[T0]], %[[MINUS_ONE]] : !llvm<"<2 x i32>"> - // CHECK: %[[T2:.*]] = llvm.shl %[[T1]], %[[OFFSET_V2]] : !llvm<"<2 x i32>"> - // CHECK: %[[MASK:.*]] = llvm.xor %[[T2]], %[[MINUS_ONE]] : !llvm<"<2 x i32>"> - // CHECK: %[[NEW_BASE:.*]] = llvm.and %[[BASE]], %[[MASK]] : !llvm<"<2 x i32>"> - // CHECK: %[[SHIFTED_INSERT:.*]] = llvm.shl %[[INSERT]], %[[OFFSET_V2]] : !llvm<"<2 x i32>"> - // CHECK: %{{.*}} = llvm.or %[[NEW_BASE]], %[[SHIFTED_INSERT]] : !llvm<"<2 x i32>"> + // CHECK: %[[COUNT_V2:.*]] = llvm.insertelement %[[COUNT]], %[[COUNT_V1]][%[[ONE]] : !llvm.i32] : !llvm.vec<2 x i32> + // CHECK: %[[MINUS_ONE:.*]] = llvm.mlir.constant(dense<-1> : vector<2xi32>) : !llvm.vec<2 x i32> + // CHECK: %[[T0:.*]] = llvm.shl %[[MINUS_ONE]], %[[COUNT_V2]] : !llvm.vec<2 x i32> + // CHECK: %[[T1:.*]] = llvm.xor %[[T0]], %[[MINUS_ONE]] : !llvm.vec<2 x i32> + // CHECK: %[[T2:.*]] = llvm.shl %[[T1]], %[[OFFSET_V2]] : !llvm.vec<2 x i32> + // CHECK: %[[MASK:.*]] = llvm.xor %[[T2]], %[[MINUS_ONE]] : !llvm.vec<2 x i32> + // CHECK: %[[NEW_BASE:.*]] = llvm.and %[[BASE]], %[[MASK]] : !llvm.vec<2 x i32> + // CHECK: %[[SHIFTED_INSERT:.*]] = llvm.shl %[[INSERT]], %[[OFFSET_V2]] : !llvm.vec<2 x i32> + // CHECK: %{{.*}} = llvm.or %[[NEW_BASE]], %[[SHIFTED_INSERT]] : !llvm.vec<2 x i32> %0 = spv.BitFieldInsert %base, %insert, %offset, %count : vector<2xi32>, i32, i32 return } @@ -158,24 +158,24 @@ } // CHECK-LABEL: func @bitfield_sextract_vector -// CHECK-SAME: %[[BASE:.*]]: !llvm<"<2 x i32>">, %[[OFFSET:.*]]: !llvm.i32, %[[COUNT:.*]]: !llvm.i32 +// CHECK-SAME: %[[BASE:.*]]: !llvm.vec<2 x i32>, %[[OFFSET:.*]]: !llvm.i32, %[[COUNT:.*]]: !llvm.i32 func @bitfield_sextract_vector(%base: vector<2xi32>, %offset: i32, %count: i32) { - // CHECK: %[[OFFSET_V0:.*]] = llvm.mlir.undef : !llvm<"<2 x i32>"> + // CHECK: %[[OFFSET_V0:.*]] = llvm.mlir.undef : !llvm.vec<2 x i32> // CHECK: %[[ZERO:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 - // CHECK: %[[OFFSET_V1:.*]] = llvm.insertelement %[[OFFSET]], %[[OFFSET_V0]][%[[ZERO]] : !llvm.i32] : !llvm<"<2 x i32>"> + // CHECK: %[[OFFSET_V1:.*]] = llvm.insertelement %[[OFFSET]], %[[OFFSET_V0]][%[[ZERO]] : !llvm.i32] : !llvm.vec<2 x i32> // CHECK: %[[ONE:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32 - // CHECK: %[[OFFSET_V2:.*]] = llvm.insertelement %[[OFFSET]], %[[OFFSET_V1]][%[[ONE]] : !llvm.i32] : !llvm<"<2 x i32>"> - // CHECK: %[[COUNT_V0:.*]] = llvm.mlir.undef : !llvm<"<2 x i32>"> + // CHECK: %[[OFFSET_V2:.*]] = llvm.insertelement %[[OFFSET]], %[[OFFSET_V1]][%[[ONE]] : !llvm.i32] : !llvm.vec<2 x i32> + // CHECK: %[[COUNT_V0:.*]] = llvm.mlir.undef : !llvm.vec<2 x i32> // CHECK: %[[ZERO:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 - // CHECK: %[[COUNT_V1:.*]] = llvm.insertelement %[[COUNT]], %[[COUNT_V0]][%[[ZERO]] : !llvm.i32] : !llvm<"<2 x i32>"> + // CHECK: %[[COUNT_V1:.*]] = llvm.insertelement %[[COUNT]], %[[COUNT_V0]][%[[ZERO]] : !llvm.i32] : !llvm.vec<2 x i32> // CHECK: %[[ONE:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32 - // CHECK: %[[COUNT_V2:.*]] = llvm.insertelement %[[COUNT]], %[[COUNT_V1]][%[[ONE]] : !llvm.i32] : !llvm<"<2 x i32>"> - // CHECK: %[[SIZE:.*]] = llvm.mlir.constant(dense<32> : vector<2xi32>) : !llvm<"<2 x i32>"> - // CHECK: %[[T0:.*]] = llvm.add %[[COUNT_V2]], %[[OFFSET_V2]] : !llvm<"<2 x i32>"> - // CHECK: %[[T1:.*]] = llvm.sub %[[SIZE]], %[[T0]] : !llvm<"<2 x i32>"> - // CHECK: %[[SHIFTED_LEFT:.*]] = llvm.shl %[[BASE]], %[[T1]] : !llvm<"<2 x i32>"> - // CHECK: %[[T2:.*]] = llvm.add %[[OFFSET_V2]], %[[T1]] : !llvm<"<2 x i32>"> - // CHECK: %{{.*}} = llvm.ashr %[[SHIFTED_LEFT]], %[[T2]] : !llvm<"<2 x i32>"> + // CHECK: %[[COUNT_V2:.*]] = llvm.insertelement %[[COUNT]], %[[COUNT_V1]][%[[ONE]] : !llvm.i32] : !llvm.vec<2 x i32> + // CHECK: %[[SIZE:.*]] = llvm.mlir.constant(dense<32> : vector<2xi32>) : !llvm.vec<2 x i32> + // CHECK: %[[T0:.*]] = llvm.add %[[COUNT_V2]], %[[OFFSET_V2]] : !llvm.vec<2 x i32> + // CHECK: %[[T1:.*]] = llvm.sub %[[SIZE]], %[[T0]] : !llvm.vec<2 x i32> + // CHECK: %[[SHIFTED_LEFT:.*]] = llvm.shl %[[BASE]], %[[T1]] : !llvm.vec<2 x i32> + // CHECK: %[[T2:.*]] = llvm.add %[[OFFSET_V2]], %[[T1]] : !llvm.vec<2 x i32> + // CHECK: %{{.*}} = llvm.ashr %[[SHIFTED_LEFT]], %[[T2]] : !llvm.vec<2 x i32> %0 = spv.BitFieldSExtract %base, %offset, %count : vector<2xi32>, i32, i32 return } @@ -224,23 +224,23 @@ } // CHECK-LABEL: func @bitfield_uextract_vector -// CHECK-SAME: %[[BASE:.*]]: !llvm<"<2 x i32>">, %[[OFFSET:.*]]: !llvm.i32, %[[COUNT:.*]]: !llvm.i32 +// CHECK-SAME: %[[BASE:.*]]: !llvm.vec<2 x i32>, %[[OFFSET:.*]]: !llvm.i32, %[[COUNT:.*]]: !llvm.i32 func @bitfield_uextract_vector(%base: vector<2xi32>, %offset: i32, %count: i32) { - // CHECK: %[[OFFSET_V0:.*]] = llvm.mlir.undef : !llvm<"<2 x i32>"> + // CHECK: %[[OFFSET_V0:.*]] = llvm.mlir.undef : !llvm.vec<2 x i32> // CHECK: %[[ZERO:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 - // CHECK: %[[OFFSET_V1:.*]] = llvm.insertelement %[[OFFSET]], %[[OFFSET_V0]][%[[ZERO]] : !llvm.i32] : !llvm<"<2 x i32>"> + // CHECK: %[[OFFSET_V1:.*]] = llvm.insertelement %[[OFFSET]], %[[OFFSET_V0]][%[[ZERO]] : !llvm.i32] : !llvm.vec<2 x i32> // CHECK: %[[ONE:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32 - // CHECK: %[[OFFSET_V2:.*]] = llvm.insertelement %[[OFFSET]], %[[OFFSET_V1]][%[[ONE]] : !llvm.i32] : !llvm<"<2 x i32>"> - // CHECK: %[[COUNT_V0:.*]] = llvm.mlir.undef : !llvm<"<2 x i32>"> + // CHECK: %[[OFFSET_V2:.*]] = llvm.insertelement %[[OFFSET]], %[[OFFSET_V1]][%[[ONE]] : !llvm.i32] : !llvm.vec<2 x i32> + // CHECK: %[[COUNT_V0:.*]] = llvm.mlir.undef : !llvm.vec<2 x i32> // CHECK: %[[ZERO:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 - // CHECK: %[[COUNT_V1:.*]] = llvm.insertelement %[[COUNT]], %[[COUNT_V0]][%[[ZERO]] : !llvm.i32] : !llvm<"<2 x i32>"> + // CHECK: %[[COUNT_V1:.*]] = llvm.insertelement %[[COUNT]], %[[COUNT_V0]][%[[ZERO]] : !llvm.i32] : !llvm.vec<2 x i32> // CHECK: %[[ONE:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32 - // CHECK: %[[COUNT_V2:.*]] = llvm.insertelement %[[COUNT]], %[[COUNT_V1]][%[[ONE]] : !llvm.i32] : !llvm<"<2 x i32>"> - // CHECK: %[[MINUS_ONE:.*]] = llvm.mlir.constant(dense<-1> : vector<2xi32>) : !llvm<"<2 x i32>"> - // CHECK: %[[T0:.*]] = llvm.shl %[[MINUS_ONE]], %[[COUNT_V2]] : !llvm<"<2 x i32>"> - // CHECK: %[[MASK:.*]] = llvm.xor %[[T0]], %[[MINUS_ONE]] : !llvm<"<2 x i32>"> - // CHECK: %[[SHIFTED_BASE:.*]] = llvm.lshr %[[BASE]], %[[OFFSET_V2]] : !llvm<"<2 x i32>"> - // CHECK: %{{.*}} = llvm.and %[[SHIFTED_BASE]], %[[MASK]] : !llvm<"<2 x i32>"> + // CHECK: %[[COUNT_V2:.*]] = llvm.insertelement %[[COUNT]], %[[COUNT_V1]][%[[ONE]] : !llvm.i32] : !llvm.vec<2 x i32> + // CHECK: %[[MINUS_ONE:.*]] = llvm.mlir.constant(dense<-1> : vector<2xi32>) : !llvm.vec<2 x i32> + // CHECK: %[[T0:.*]] = llvm.shl %[[MINUS_ONE]], %[[COUNT_V2]] : !llvm.vec<2 x i32> + // CHECK: %[[MASK:.*]] = llvm.xor %[[T0]], %[[MINUS_ONE]] : !llvm.vec<2 x i32> + // CHECK: %[[SHIFTED_BASE:.*]] = llvm.lshr %[[BASE]], %[[OFFSET_V2]] : !llvm.vec<2 x i32> + // CHECK: %{{.*}} = llvm.and %[[SHIFTED_BASE]], %[[MASK]] : !llvm.vec<2 x i32> %0 = spv.BitFieldUExtract %base, %offset, %count : vector<2xi32>, i32, i32 return } @@ -256,7 +256,7 @@ } func @bitwise_and_vector(%arg0: vector<4xi64>, %arg1: vector<4xi64>) { - // CHECK: %{{.*}} = llvm.and %{{.*}}, %{{.*}} : !llvm<"<4 x i64>"> + // CHECK: %{{.*}} = llvm.and %{{.*}}, %{{.*}} : !llvm.vec<4 x i64> %0 = spv.BitwiseAnd %arg0, %arg1 : vector<4xi64> return } @@ -272,7 +272,7 @@ } func @bitwise_or_vector(%arg0: vector<3xi8>, %arg1: vector<3xi8>) { - // CHECK: %{{.*}} = llvm.or %{{.*}}, %{{.*}} : !llvm<"<3 x i8>"> + // CHECK: %{{.*}} = llvm.or %{{.*}}, %{{.*}} : !llvm.vec<3 x i8> %0 = spv.BitwiseOr %arg0, %arg1 : vector<3xi8> return } @@ -288,7 +288,7 @@ } func @bitwise_xor_vector(%arg0: vector<2xi16>, %arg1: vector<2xi16>) { - // CHECK: %{{.*}} = llvm.xor %{{.*}}, %{{.*}} : !llvm<"<2 x i16>"> + // CHECK: %{{.*}} = llvm.xor %{{.*}}, %{{.*}} : !llvm.vec<2 x i16> %0 = spv.BitwiseXor %arg0, %arg1 : vector<2xi16> return } @@ -305,8 +305,8 @@ } func @not_vector(%arg0: vector<2xi16>) { - // CHECK: %[[CONST:.*]] = llvm.mlir.constant(dense<-1> : vector<2xi16>) : !llvm<"<2 x i16>"> - // CHECK: %{{.*}} = llvm.xor %{{.*}}, %[[CONST]] : !llvm<"<2 x i16>"> + // CHECK: %[[CONST:.*]] = llvm.mlir.constant(dense<-1> : vector<2xi16>) : !llvm.vec<2 x i16> + // CHECK: %{{.*}} = llvm.xor %{{.*}}, %[[CONST]] : !llvm.vec<2 x i16> %0 = spv.Not %arg0 : vector<2xi16> return } diff --git a/mlir/test/Conversion/SPIRVToLLVM/cast-ops-to-llvm.mlir b/mlir/test/Conversion/SPIRVToLLVM/cast-ops-to-llvm.mlir --- a/mlir/test/Conversion/SPIRVToLLVM/cast-ops-to-llvm.mlir +++ b/mlir/test/Conversion/SPIRVToLLVM/cast-ops-to-llvm.mlir @@ -11,31 +11,31 @@ } func @bitcast_float_to_integer_vector(%arg0 : vector<3xf32>) { - // CHECK: {{.*}} = llvm.bitcast {{.*}} : !llvm<"<3 x float>"> to !llvm<"<3 x i32>"> + // CHECK: {{.*}} = llvm.bitcast {{.*}} : !llvm.vec<3 x float> to !llvm.vec<3 x i32> %0 = spv.Bitcast %arg0: vector<3xf32> to vector<3xi32> return } func @bitcast_vector_to_scalar(%arg0 : vector<2xf32>) { - // CHECK: {{.*}} = llvm.bitcast {{.*}} : !llvm<"<2 x float>"> to !llvm.i64 + // CHECK: {{.*}} = llvm.bitcast {{.*}} : !llvm.vec<2 x float> to !llvm.i64 %0 = spv.Bitcast %arg0: vector<2xf32> to i64 return } func @bitcast_scalar_to_vector(%arg0 : f64) { - // CHECK: {{.*}} = llvm.bitcast {{.*}} : !llvm.double to !llvm<"<2 x i32>"> + // CHECK: {{.*}} = llvm.bitcast {{.*}} : !llvm.double to !llvm.vec<2 x i32> %0 = spv.Bitcast %arg0: f64 to vector<2xi32> return } func @bitcast_vector_to_vector(%arg0 : vector<4xf32>) { - // CHECK: {{.*}} = llvm.bitcast {{.*}} : !llvm<"<4 x float>"> to !llvm<"<2 x i64>"> + // CHECK: {{.*}} = llvm.bitcast {{.*}} : !llvm.vec<4 x float> to !llvm.vec<2 x i64> %0 = spv.Bitcast %arg0: vector<4xf32> to vector<2xi64> return } func @bitcast_pointer(%arg0: !spv.ptr) { - // CHECK: %{{.*}} = llvm.bitcast %{{.*}} : !llvm<"float*"> to !llvm<"i32*"> + // CHECK: %{{.*}} = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr %0 = spv.Bitcast %arg0 : !spv.ptr to !spv.ptr return } @@ -51,7 +51,7 @@ } func @convert_float_to_signed_vector(%arg0: vector<2xf32>) { - // CHECK: %{{.*}} = llvm.fptosi %{{.*}} : !llvm<"<2 x float>"> to !llvm<"<2 x i32>"> + // CHECK: %{{.*}} = llvm.fptosi %{{.*}} : !llvm.vec<2 x float> to !llvm.vec<2 x i32> %0 = spv.ConvertFToS %arg0: vector<2xf32> to vector<2xi32> return } @@ -67,7 +67,7 @@ } func @convert_float_to_unsigned_vector(%arg0: vector<2xf32>) { - // CHECK: %{{.*}} = llvm.fptoui %{{.*}} : !llvm<"<2 x float>"> to !llvm<"<2 x i32>"> + // CHECK: %{{.*}} = llvm.fptoui %{{.*}} : !llvm.vec<2 x float> to !llvm.vec<2 x i32> %0 = spv.ConvertFToU %arg0: vector<2xf32> to vector<2xi32> return } @@ -83,7 +83,7 @@ } func @convert_signed_to_float_vector(%arg0: vector<3xi32>) { - // CHECK: %{{.*}} = llvm.sitofp %{{.*}} : !llvm<"<3 x i32>"> to !llvm<"<3 x float>"> + // CHECK: %{{.*}} = llvm.sitofp %{{.*}} : !llvm.vec<3 x i32> to !llvm.vec<3 x float> %0 = spv.ConvertSToF %arg0: vector<3xi32> to vector<3xf32> return } @@ -99,7 +99,7 @@ } func @convert_unsigned_to_float_vector(%arg0: vector<3xi32>) { - // CHECK: %{{.*}} = llvm.uitofp %{{.*}} : !llvm<"<3 x i32>"> to !llvm<"<3 x float>"> + // CHECK: %{{.*}} = llvm.uitofp %{{.*}} : !llvm.vec<3 x i32> to !llvm.vec<3 x float> %0 = spv.ConvertUToF %arg0: vector<3xi32> to vector<3xf32> return } @@ -118,10 +118,10 @@ } func @fconvert_vector(%arg0: vector<2xf32>, %arg1: vector<2xf64>) { - // CHECK: %{{.*}} = llvm.fpext %{{.*}} : !llvm<"<2 x float>"> to !llvm<"<2 x double>"> + // CHECK: %{{.*}} = llvm.fpext %{{.*}} : !llvm.vec<2 x float> to !llvm.vec<2 x double> %0 = spv.FConvert %arg0: vector<2xf32> to vector<2xf64> - // CHECK: %{{.*}} = llvm.fptrunc %{{.*}} : !llvm<"<2 x double>"> to !llvm<"<2 x float>"> + // CHECK: %{{.*}} = llvm.fptrunc %{{.*}} : !llvm.vec<2 x double> to !llvm.vec<2 x float> %1 = spv.FConvert %arg1: vector<2xf64> to vector<2xf32> return } @@ -140,10 +140,10 @@ } func @sconvert_vector(%arg0: vector<3xi32>, %arg1: vector<3xi64>) { - // CHECK: %{{.*}} = llvm.sext %{{.*}} : !llvm<"<3 x i32>"> to !llvm<"<3 x i64>"> + // CHECK: %{{.*}} = llvm.sext %{{.*}} : !llvm.vec<3 x i32> to !llvm.vec<3 x i64> %0 = spv.SConvert %arg0: vector<3xi32> to vector<3xi64> - // CHECK: %{{.*}} = llvm.trunc %{{.*}} : !llvm<"<3 x i64>"> to !llvm<"<3 x i32>"> + // CHECK: %{{.*}} = llvm.trunc %{{.*}} : !llvm.vec<3 x i64> to !llvm.vec<3 x i32> %1 = spv.SConvert %arg1: vector<3xi64> to vector<3xi32> return } @@ -162,10 +162,10 @@ } func @uconvert_vector(%arg0: vector<3xi32>, %arg1: vector<3xi64>) { - // CHECK: %{{.*}} = llvm.zext %{{.*}} : !llvm<"<3 x i32>"> to !llvm<"<3 x i64>"> + // CHECK: %{{.*}} = llvm.zext %{{.*}} : !llvm.vec<3 x i32> to !llvm.vec<3 x i64> %0 = spv.UConvert %arg0: vector<3xi32> to vector<3xi64> - // CHECK: %{{.*}} = llvm.trunc %{{.*}} : !llvm<"<3 x i64>"> to !llvm<"<3 x i32>"> + // CHECK: %{{.*}} = llvm.trunc %{{.*}} : !llvm.vec<3 x i64> to !llvm.vec<3 x i32> %1 = spv.UConvert %arg1: vector<3xi64> to vector<3xi32> return } diff --git a/mlir/test/Conversion/SPIRVToLLVM/comparison-ops-to-llvm.mlir b/mlir/test/Conversion/SPIRVToLLVM/comparison-ops-to-llvm.mlir --- a/mlir/test/Conversion/SPIRVToLLVM/comparison-ops-to-llvm.mlir +++ b/mlir/test/Conversion/SPIRVToLLVM/comparison-ops-to-llvm.mlir @@ -11,7 +11,7 @@ } func @i_equal_vector(%arg0: vector<4xi64>, %arg1: vector<4xi64>) { - // CHECK: %{{.*}} = llvm.icmp "eq" %{{.*}}, %{{.*}} : !llvm<"<4 x i64>"> + // CHECK: %{{.*}} = llvm.icmp "eq" %{{.*}}, %{{.*}} : !llvm.vec<4 x i64> %0 = spv.IEqual %arg0, %arg1 : vector<4xi64> return } @@ -27,7 +27,7 @@ } func @i_not_equal_vector(%arg0: vector<2xi64>, %arg1: vector<2xi64>) { - // CHECK: %{{.*}} = llvm.icmp "ne" %{{.*}}, %{{.*}} : !llvm<"<2 x i64>"> + // CHECK: %{{.*}} = llvm.icmp "ne" %{{.*}}, %{{.*}} : !llvm.vec<2 x i64> %0 = spv.INotEqual %arg0, %arg1 : vector<2xi64> return } @@ -43,7 +43,7 @@ } func @s_greater_than_equal_vector(%arg0: vector<2xi64>, %arg1: vector<2xi64>) { - // CHECK: %{{.*}} = llvm.icmp "sge" %{{.*}}, %{{.*}} : !llvm<"<2 x i64>"> + // CHECK: %{{.*}} = llvm.icmp "sge" %{{.*}}, %{{.*}} : !llvm.vec<2 x i64> %0 = spv.SGreaterThanEqual %arg0, %arg1 : vector<2xi64> return } @@ -59,7 +59,7 @@ } func @s_greater_than_vector(%arg0: vector<2xi64>, %arg1: vector<2xi64>) { - // CHECK: %{{.*}} = llvm.icmp "sgt" %{{.*}}, %{{.*}} : !llvm<"<2 x i64>"> + // CHECK: %{{.*}} = llvm.icmp "sgt" %{{.*}}, %{{.*}} : !llvm.vec<2 x i64> %0 = spv.SGreaterThan %arg0, %arg1 : vector<2xi64> return } @@ -75,7 +75,7 @@ } func @s_less_than_equal_vector(%arg0: vector<2xi64>, %arg1: vector<2xi64>) { - // CHECK: %{{.*}} = llvm.icmp "sle" %{{.*}}, %{{.*}} : !llvm<"<2 x i64>"> + // CHECK: %{{.*}} = llvm.icmp "sle" %{{.*}}, %{{.*}} : !llvm.vec<2 x i64> %0 = spv.SLessThanEqual %arg0, %arg1 : vector<2xi64> return } @@ -91,7 +91,7 @@ } func @s_less_than_vector(%arg0: vector<2xi64>, %arg1: vector<2xi64>) { - // CHECK: %{{.*}} = llvm.icmp "slt" %{{.*}}, %{{.*}} : !llvm<"<2 x i64>"> + // CHECK: %{{.*}} = llvm.icmp "slt" %{{.*}}, %{{.*}} : !llvm.vec<2 x i64> %0 = spv.SLessThan %arg0, %arg1 : vector<2xi64> return } @@ -107,7 +107,7 @@ } func @u_greater_than_equal_vector(%arg0: vector<2xi64>, %arg1: vector<2xi64>) { - // CHECK: %{{.*}} = llvm.icmp "uge" %{{.*}}, %{{.*}} : !llvm<"<2 x i64>"> + // CHECK: %{{.*}} = llvm.icmp "uge" %{{.*}}, %{{.*}} : !llvm.vec<2 x i64> %0 = spv.UGreaterThanEqual %arg0, %arg1 : vector<2xi64> return } @@ -123,7 +123,7 @@ } func @u_greater_than_vector(%arg0: vector<2xi64>, %arg1: vector<2xi64>) { - // CHECK: %{{.*}} = llvm.icmp "ugt" %{{.*}}, %{{.*}} : !llvm<"<2 x i64>"> + // CHECK: %{{.*}} = llvm.icmp "ugt" %{{.*}}, %{{.*}} : !llvm.vec<2 x i64> %0 = spv.UGreaterThan %arg0, %arg1 : vector<2xi64> return } @@ -139,7 +139,7 @@ } func @u_less_than_equal_vector(%arg0: vector<2xi64>, %arg1: vector<2xi64>) { - // CHECK: %{{.*}} = llvm.icmp "ule" %{{.*}}, %{{.*}} : !llvm<"<2 x i64>"> + // CHECK: %{{.*}} = llvm.icmp "ule" %{{.*}}, %{{.*}} : !llvm.vec<2 x i64> %0 = spv.ULessThanEqual %arg0, %arg1 : vector<2xi64> return } @@ -155,7 +155,7 @@ } func @u_less_than_vector(%arg0: vector<2xi64>, %arg1: vector<2xi64>) { - // CHECK: %{{.*}} = llvm.icmp "ult" %{{.*}}, %{{.*}} : !llvm<"<2 x i64>"> + // CHECK: %{{.*}} = llvm.icmp "ult" %{{.*}}, %{{.*}} : !llvm.vec<2 x i64> %0 = spv.ULessThan %arg0, %arg1 : vector<2xi64> return } @@ -171,7 +171,7 @@ } func @f_ord_equal_vector(%arg0: vector<4xf64>, %arg1: vector<4xf64>) { - // CHECK: %{{.*}} = llvm.fcmp "oeq" %{{.*}}, %{{.*}} : !llvm<"<4 x double>"> + // CHECK: %{{.*}} = llvm.fcmp "oeq" %{{.*}}, %{{.*}} : !llvm.vec<4 x double> %0 = spv.FOrdEqual %arg0, %arg1 : vector<4xf64> return } @@ -187,7 +187,7 @@ } func @f_ord_greater_than_equal_vector(%arg0: vector<2xf64>, %arg1: vector<2xf64>) { - // CHECK: %{{.*}} = llvm.fcmp "oge" %{{.*}}, %{{.*}} : !llvm<"<2 x double>"> + // CHECK: %{{.*}} = llvm.fcmp "oge" %{{.*}}, %{{.*}} : !llvm.vec<2 x double> %0 = spv.FOrdGreaterThanEqual %arg0, %arg1 : vector<2xf64> return } @@ -203,7 +203,7 @@ } func @f_ord_greater_than_vector(%arg0: vector<2xf64>, %arg1: vector<2xf64>) { - // CHECK: %{{.*}} = llvm.fcmp "ogt" %{{.*}}, %{{.*}} : !llvm<"<2 x double>"> + // CHECK: %{{.*}} = llvm.fcmp "ogt" %{{.*}}, %{{.*}} : !llvm.vec<2 x double> %0 = spv.FOrdGreaterThan %arg0, %arg1 : vector<2xf64> return } @@ -219,7 +219,7 @@ } func @f_ord_less_than_vector(%arg0: vector<2xf64>, %arg1: vector<2xf64>) { - // CHECK: %{{.*}} = llvm.fcmp "olt" %{{.*}}, %{{.*}} : !llvm<"<2 x double>"> + // CHECK: %{{.*}} = llvm.fcmp "olt" %{{.*}}, %{{.*}} : !llvm.vec<2 x double> %0 = spv.FOrdLessThan %arg0, %arg1 : vector<2xf64> return } @@ -235,7 +235,7 @@ } func @f_ord_less_than_equal_vector(%arg0: vector<2xf64>, %arg1: vector<2xf64>) { - // CHECK: %{{.*}} = llvm.fcmp "ole" %{{.*}}, %{{.*}} : !llvm<"<2 x double>"> + // CHECK: %{{.*}} = llvm.fcmp "ole" %{{.*}}, %{{.*}} : !llvm.vec<2 x double> %0 = spv.FOrdLessThanEqual %arg0, %arg1 : vector<2xf64> return } @@ -251,7 +251,7 @@ } func @f_ord_not_equal_vector(%arg0: vector<4xf64>, %arg1: vector<4xf64>) { - // CHECK: %{{.*}} = llvm.fcmp "one" %{{.*}}, %{{.*}} : !llvm<"<4 x double>"> + // CHECK: %{{.*}} = llvm.fcmp "one" %{{.*}}, %{{.*}} : !llvm.vec<4 x double> %0 = spv.FOrdNotEqual %arg0, %arg1 : vector<4xf64> return } @@ -267,7 +267,7 @@ } func @f_unord_equal_vector(%arg0: vector<4xf64>, %arg1: vector<4xf64>) { - // CHECK: %{{.*}} = llvm.fcmp "ueq" %{{.*}}, %{{.*}} : !llvm<"<4 x double>"> + // CHECK: %{{.*}} = llvm.fcmp "ueq" %{{.*}}, %{{.*}} : !llvm.vec<4 x double> %0 = spv.FUnordEqual %arg0, %arg1 : vector<4xf64> return } @@ -283,7 +283,7 @@ } func @f_unord_greater_than_equal_vector(%arg0: vector<2xf64>, %arg1: vector<2xf64>) { - // CHECK: %{{.*}} = llvm.fcmp "uge" %{{.*}}, %{{.*}} : !llvm<"<2 x double>"> + // CHECK: %{{.*}} = llvm.fcmp "uge" %{{.*}}, %{{.*}} : !llvm.vec<2 x double> %0 = spv.FUnordGreaterThanEqual %arg0, %arg1 : vector<2xf64> return } @@ -299,7 +299,7 @@ } func @f_unord_greater_than_vector(%arg0: vector<2xf64>, %arg1: vector<2xf64>) { - // CHECK: %{{.*}} = llvm.fcmp "ugt" %{{.*}}, %{{.*}} : !llvm<"<2 x double>"> + // CHECK: %{{.*}} = llvm.fcmp "ugt" %{{.*}}, %{{.*}} : !llvm.vec<2 x double> %0 = spv.FUnordGreaterThan %arg0, %arg1 : vector<2xf64> return } @@ -315,7 +315,7 @@ } func @f_unord_less_than_vector(%arg0: vector<2xf64>, %arg1: vector<2xf64>) { - // CHECK: %{{.*}} = llvm.fcmp "ult" %{{.*}}, %{{.*}} : !llvm<"<2 x double>"> + // CHECK: %{{.*}} = llvm.fcmp "ult" %{{.*}}, %{{.*}} : !llvm.vec<2 x double> %0 = spv.FUnordLessThan %arg0, %arg1 : vector<2xf64> return } @@ -331,7 +331,7 @@ } func @f_unord_less_than_equal_vector(%arg0: vector<2xf64>, %arg1: vector<2xf64>) { - // CHECK: %{{.*}} = llvm.fcmp "ule" %{{.*}}, %{{.*}} : !llvm<"<2 x double>"> + // CHECK: %{{.*}} = llvm.fcmp "ule" %{{.*}}, %{{.*}} : !llvm.vec<2 x double> %0 = spv.FUnordLessThanEqual %arg0, %arg1 : vector<2xf64> return } @@ -347,7 +347,7 @@ } func @f_unord_not_equal_vector(%arg0: vector<4xf64>, %arg1: vector<4xf64>) { - // CHECK: %{{.*}} = llvm.fcmp "une" %{{.*}}, %{{.*}} : !llvm<"<4 x double>"> + // CHECK: %{{.*}} = llvm.fcmp "une" %{{.*}}, %{{.*}} : !llvm.vec<4 x double> %0 = spv.FUnordNotEqual %arg0, %arg1 : vector<4xf64> return } diff --git a/mlir/test/Conversion/SPIRVToLLVM/constant-op-to-llvm.mlir b/mlir/test/Conversion/SPIRVToLLVM/constant-op-to-llvm.mlir --- a/mlir/test/Conversion/SPIRVToLLVM/constant-op-to-llvm.mlir +++ b/mlir/test/Conversion/SPIRVToLLVM/constant-op-to-llvm.mlir @@ -13,9 +13,9 @@ } func @bool_constant_vector() { - // CHECK: {{.*}} = llvm.mlir.constant(dense<[true, false]> : vector<2xi1>) : !llvm<"<2 x i1>"> + // CHECK: {{.*}} = llvm.mlir.constant(dense<[true, false]> : vector<2xi1>) : !llvm.vec<2 x i1> %0 = constant dense<[true, false]> : vector<2xi1> - // CHECK: {{.*}} = llvm.mlir.constant(dense : vector<3xi1>) : !llvm<"<3 x i1>"> + // CHECK: {{.*}} = llvm.mlir.constant(dense : vector<3xi1>) : !llvm.vec<3 x i1> %1 = constant dense : vector<3xi1> return } @@ -31,11 +31,11 @@ } func @integer_constant_vector() { - // CHECK: {{.*}} = llvm.mlir.constant(dense<[2, 3]> : vector<2xi32>) : !llvm<"<2 x i32>"> + // CHECK: {{.*}} = llvm.mlir.constant(dense<[2, 3]> : vector<2xi32>) : !llvm.vec<2 x i32> %0 = spv.constant dense<[2, 3]> : vector<2xi32> - // CHECK: {{.*}} = llvm.mlir.constant(dense<-4> : vector<2xi32>) : !llvm<"<2 x i32>"> + // CHECK: {{.*}} = llvm.mlir.constant(dense<-4> : vector<2xi32>) : !llvm.vec<2 x i32> %1 = spv.constant dense<-4> : vector<2xsi32> - // CHECK: {{.*}} = llvm.mlir.constant(dense<[2, 3, 4]> : vector<3xi32>) : !llvm<"<3 x i32>"> + // CHECK: {{.*}} = llvm.mlir.constant(dense<[2, 3, 4]> : vector<3xi32>) : !llvm.vec<3 x i32> %2 = spv.constant dense<[2, 3, 4]> : vector<3xui32> return } @@ -49,7 +49,7 @@ } func @float_constant_vector() { - // CHECK: {{.*}} = llvm.mlir.constant(dense<[2.000000e+00, 3.000000e+00]> : vector<2xf32>) : !llvm<"<2 x float>"> + // CHECK: {{.*}} = llvm.mlir.constant(dense<[2.000000e+00, 3.000000e+00]> : vector<2xf32>) : !llvm.vec<2 x float> %0 = spv.constant dense<[2.000000e+00, 3.000000e+00]> : vector<2xf32> return } diff --git a/mlir/test/Conversion/SPIRVToLLVM/func-to-llvm.mlir b/mlir/test/Conversion/SPIRVToLLVM/func-to-llvm.mlir --- a/mlir/test/Conversion/SPIRVToLLVM/func-to-llvm.mlir +++ b/mlir/test/Conversion/SPIRVToLLVM/func-to-llvm.mlir @@ -52,7 +52,7 @@ spv.Return } -// CHECK-LABEL: llvm.func @vector_types(%arg0: !llvm<"<2 x i64>">, %arg1: !llvm<"<2 x i64>">) -> !llvm<"<2 x i64>"> +// CHECK-LABEL: llvm.func @vector_types(%arg0: !llvm.vec<2 x i64>, %arg1: !llvm.vec<2 x i64>) -> !llvm.vec<2 x i64> spv.func @vector_types(%arg0: vector<2xi64>, %arg1: vector<2xi64>) -> vector<2xi64> "None" { %0 = spv.IAdd %arg0, %arg1 : vector<2xi64> spv.ReturnValue %0 : vector<2xi64> @@ -63,15 +63,15 @@ //===----------------------------------------------------------------------===// // CHECK-LABEL: llvm.func @function_calls -// CHECK-SAME: %[[ARG0:.*]]: !llvm.i32, %[[ARG1:.*]]: !llvm.i1, %[[ARG2:.*]]: !llvm.double, %[[ARG3:.*]]: !llvm<"<2 x i64>">, %[[ARG4:.*]]: !llvm<"<2 x float>"> +// CHECK-SAME: %[[ARG0:.*]]: !llvm.i32, %[[ARG1:.*]]: !llvm.i1, %[[ARG2:.*]]: !llvm.double, %[[ARG3:.*]]: !llvm.vec<2 x i64>, %[[ARG4:.*]]: !llvm.vec<2 x float> spv.func @function_calls(%arg0: i32, %arg1: i1, %arg2: f64, %arg3: vector<2xi64>, %arg4: vector<2xf32>) -> () "None" { // CHECK: llvm.call @void_1() : () -> () spv.FunctionCall @void_1() : () -> () - // CHECK: llvm.call @void_2(%[[ARG3]]) : (!llvm<"<2 x i64>">) -> () + // CHECK: llvm.call @void_2(%[[ARG3]]) : (!llvm.vec<2 x i64>) -> () spv.FunctionCall @void_2(%arg3) : (vector<2xi64>) -> () // CHECK: %{{.*}} = llvm.call @value_scalar(%[[ARG0]], %[[ARG1]], %[[ARG2]]) : (!llvm.i32, !llvm.i1, !llvm.double) -> !llvm.i32 %0 = spv.FunctionCall @value_scalar(%arg0, %arg1, %arg2) : (i32, i1, f64) -> i32 - // CHECK: %{{.*}} = llvm.call @value_vector(%[[ARG3]], %[[ARG4]]) : (!llvm<"<2 x i64>">, !llvm<"<2 x float>">) -> !llvm<"<2 x float>"> + // CHECK: %{{.*}} = llvm.call @value_vector(%[[ARG3]], %[[ARG4]]) : (!llvm.vec<2 x i64>, !llvm.vec<2 x float>) -> !llvm.vec<2 x float> %1 = spv.FunctionCall @value_vector(%arg3, %arg4) : (vector<2xi64>, vector<2xf32>) -> vector<2xf32> spv.Return } diff --git a/mlir/test/Conversion/SPIRVToLLVM/logical-to-llvm.mlir b/mlir/test/Conversion/SPIRVToLLVM/logical-to-llvm.mlir --- a/mlir/test/Conversion/SPIRVToLLVM/logical-to-llvm.mlir +++ b/mlir/test/Conversion/SPIRVToLLVM/logical-to-llvm.mlir @@ -11,7 +11,7 @@ } func @logical_equal_vector(%arg0: vector<4xi1>, %arg1: vector<4xi1>) { - // CHECK: %{{.*}} = llvm.icmp "eq" %{{.*}}, %{{.*}} : !llvm<"<4 x i1>"> + // CHECK: %{{.*}} = llvm.icmp "eq" %{{.*}}, %{{.*}} : !llvm.vec<4 x i1> %0 = spv.LogicalEqual %arg0, %arg0 : vector<4xi1> return } @@ -27,7 +27,7 @@ } func @logical_not_equal_vector(%arg0: vector<4xi1>, %arg1: vector<4xi1>) { - // CHECK: %{{.*}} = llvm.icmp "ne" %{{.*}}, %{{.*}} : !llvm<"<4 x i1>"> + // CHECK: %{{.*}} = llvm.icmp "ne" %{{.*}}, %{{.*}} : !llvm.vec<4 x i1> %0 = spv.LogicalNotEqual %arg0, %arg0 : vector<4xi1> return } @@ -44,8 +44,8 @@ } func @logical_not_vector(%arg0: vector<4xi1>) { - // CHECK: %[[CONST:.*]] = llvm.mlir.constant(dense : vector<4xi1>) : !llvm<"<4 x i1>"> - // CHECK: %{{.*}} = llvm.xor %{{.*}}, %[[CONST]] : !llvm<"<4 x i1>"> + // CHECK: %[[CONST:.*]] = llvm.mlir.constant(dense : vector<4xi1>) : !llvm.vec<4 x i1> + // CHECK: %{{.*}} = llvm.xor %{{.*}}, %[[CONST]] : !llvm.vec<4 x i1> %0 = spv.LogicalNot %arg0 : vector<4xi1> return } @@ -61,7 +61,7 @@ } func @logical_and_vector(%arg0: vector<4xi1>, %arg1: vector<4xi1>) { - // CHECK: %{{.*}} = llvm.and %{{.*}}, %{{.*}} : !llvm<"<4 x i1>"> + // CHECK: %{{.*}} = llvm.and %{{.*}}, %{{.*}} : !llvm.vec<4 x i1> %0 = spv.LogicalAnd %arg0, %arg0 : vector<4xi1> return } @@ -77,7 +77,7 @@ } func @logical_or_vector(%arg0: vector<4xi1>, %arg1: vector<4xi1>) { - // CHECK: %{{.*}} = llvm.or %{{.*}}, %{{.*}} : !llvm<"<4 x i1>"> + // CHECK: %{{.*}} = llvm.or %{{.*}}, %{{.*}} : !llvm.vec<4 x i1> %0 = spv.LogicalOr %arg0, %arg0 : vector<4xi1> return } diff --git a/mlir/test/Conversion/SPIRVToLLVM/memory-ops-to-llvm.mlir b/mlir/test/Conversion/SPIRVToLLVM/memory-ops-to-llvm.mlir --- a/mlir/test/Conversion/SPIRVToLLVM/memory-ops-to-llvm.mlir +++ b/mlir/test/Conversion/SPIRVToLLVM/memory-ops-to-llvm.mlir @@ -6,21 +6,21 @@ func @load() { %0 = spv.Variable : !spv.ptr - // CHECK: %{{.*}} = llvm.load %{{.*}} : !llvm<"float*"> + // CHECK: %{{.*}} = llvm.load %{{.*}} : !llvm.ptr %1 = spv.Load "Function" %0 : f32 return } func @load_none() { %0 = spv.Variable : !spv.ptr - // CHECK: %{{.*}} = llvm.load %{{.*}} : !llvm<"float*"> + // CHECK: %{{.*}} = llvm.load %{{.*}} : !llvm.ptr %1 = spv.Load "Function" %0 ["None"] : f32 return } func @load_with_alignment() { %0 = spv.Variable : !spv.ptr - // CHECK: %{{.*}} = llvm.load %{{.*}} {alignment = 4 : i64} : !llvm<"float*"> + // CHECK: %{{.*}} = llvm.load %{{.*}} {alignment = 4 : i64} : !llvm.ptr %1 = spv.Load "Function" %0 ["Aligned", 4] : f32 return } @@ -45,21 +45,21 @@ func @store(%arg0 : f32) -> () { %0 = spv.Variable : !spv.ptr - // CHECK: llvm.store %{{.*}}, %{{.*}} : !llvm<"float*"> + // CHECK: llvm.store %{{.*}}, %{{.*}} : !llvm.ptr spv.Store "Function" %0, %arg0 : f32 return } func @store_composite(%arg0 : !spv.struct) -> () { %0 = spv.Variable : !spv.ptr, Function> - // CHECK: llvm.store %{{.*}}, %{{.*}} : !llvm<"<{ double }>*"> + // CHECK: llvm.store %{{.*}}, %{{.*}} : !llvm.ptr> spv.Store "Function" %0, %arg0 : !spv.struct return } func @store_with_alignment(%arg0 : f32) -> () { %0 = spv.Variable : !spv.ptr - // CHECK: llvm.store %{{.*}}, %{{.*}} {alignment = 4 : i64} : !llvm<"float*"> + // CHECK: llvm.store %{{.*}}, %{{.*}} {alignment = 4 : i64} : !llvm.ptr spv.Store "Function" %0, %arg0 ["Aligned", 4] : f32 return } @@ -84,10 +84,10 @@ func @variable_scalar() { // CHECK: %[[SIZE1:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32 - // CHECK: %{{.*}} = llvm.alloca %[[SIZE1]] x !llvm.float : (!llvm.i32) -> !llvm<"float*"> + // CHECK: %{{.*}} = llvm.alloca %[[SIZE1]] x !llvm.float : (!llvm.i32) -> !llvm.ptr %0 = spv.Variable : !spv.ptr // CHECK: %[[SIZE2:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32 - // CHECK: %{{.*}} = llvm.alloca %[[SIZE2]] x !llvm.i8 : (!llvm.i32) -> !llvm<"i8*"> + // CHECK: %{{.*}} = llvm.alloca %[[SIZE2]] x !llvm.i8 : (!llvm.i32) -> !llvm.ptr %1 = spv.Variable : !spv.ptr return } @@ -95,8 +95,8 @@ func @variable_scalar_with_initialization() { // CHECK: %[[VALUE:.*]] = llvm.mlir.constant(0 : i64) : !llvm.i64 // CHECK: %[[SIZE:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32 - // CHECK: %[[ALLOCATED:.*]] = llvm.alloca %[[SIZE]] x !llvm.i64 : (!llvm.i32) -> !llvm<"i64*"> - // CHECK: llvm.store %[[VALUE]], %[[ALLOCATED]] : !llvm<"i64*"> + // CHECK: %[[ALLOCATED:.*]] = llvm.alloca %[[SIZE]] x !llvm.i64 : (!llvm.i32) -> !llvm.ptr + // CHECK: llvm.store %[[VALUE]], %[[ALLOCATED]] : !llvm.ptr %c = spv.constant 0 : i64 %0 = spv.Variable init(%c) : !spv.ptr return @@ -104,16 +104,16 @@ func @variable_vector() { // CHECK: %[[SIZE:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32 - // CHECK: %{{.*}} = llvm.alloca %[[SIZE]] x !llvm<"<3 x float>"> : (!llvm.i32) -> !llvm<"<3 x float>*"> + // CHECK: %{{.*}} = llvm.alloca %[[SIZE]] x !llvm.vec<3 x float> : (!llvm.i32) -> !llvm.ptr> %0 = spv.Variable : !spv.ptr, Function> return } func @variable_vector_with_initialization() { - // CHECK: %[[VALUE:.*]] = llvm.mlir.constant(dense : vector<3xi1>) : !llvm<"<3 x i1>"> + // CHECK: %[[VALUE:.*]] = llvm.mlir.constant(dense : vector<3xi1>) : !llvm.vec<3 x i1> // CHECK: %[[SIZE:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32 - // CHECK: %[[ALLOCATED:.*]] = llvm.alloca %[[SIZE]] x !llvm<"<3 x i1>"> : (!llvm.i32) -> !llvm<"<3 x i1>*"> - // CHECK: llvm.store %[[VALUE]], %[[ALLOCATED]] : !llvm<"<3 x i1>*"> + // CHECK: %[[ALLOCATED:.*]] = llvm.alloca %[[SIZE]] x !llvm.vec<3 x i1> : (!llvm.i32) -> !llvm.ptr> + // CHECK: llvm.store %[[VALUE]], %[[ALLOCATED]] : !llvm.ptr> %c = spv.constant dense : vector<3xi1> %0 = spv.Variable init(%c) : !spv.ptr, Function> return @@ -121,7 +121,7 @@ func @variable_array() { // CHECK: %[[SIZE:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32 - // CHECK: %{{.*}} = llvm.alloca %[[SIZE]] x !llvm<"[10 x i32]"> : (!llvm.i32) -> !llvm<"[10 x i32]*"> + // CHECK: %{{.*}} = llvm.alloca %[[SIZE]] x !llvm.array<10 x i32> : (!llvm.i32) -> !llvm.ptr> %0 = spv.Variable : !spv.ptr, Function> return } diff --git a/mlir/test/Conversion/SPIRVToLLVM/misc-ops-to-llvm.mlir b/mlir/test/Conversion/SPIRVToLLVM/misc-ops-to-llvm.mlir --- a/mlir/test/Conversion/SPIRVToLLVM/misc-ops-to-llvm.mlir +++ b/mlir/test/Conversion/SPIRVToLLVM/misc-ops-to-llvm.mlir @@ -5,7 +5,7 @@ //===----------------------------------------------------------------------===// func @select_scalar(%arg0: i1, %arg1: vector<3xi32>, %arg2: f32) { - // CHECK: %{{.*}} = llvm.select %{{.*}}, %{{.*}}, %{{.*}} : !llvm.i1, !llvm<"<3 x i32>"> + // CHECK: %{{.*}} = llvm.select %{{.*}}, %{{.*}}, %{{.*}} : !llvm.i1, !llvm.vec<3 x i32> %0 = spv.Select %arg0, %arg1, %arg1 : i1, vector<3xi32> // CHECK: %{{.*}} = llvm.select %{{.*}}, %{{.*}}, %{{.*}} : !llvm.i1, !llvm.float %1 = spv.Select %arg0, %arg2, %arg2 : i1, f32 @@ -13,7 +13,7 @@ } func @select_vector(%arg0: vector<2xi1>, %arg1: vector<2xi32>) { - // CHECK: %{{.*}} = llvm.select %{{.*}}, %{{.*}}, %{{.*}} : !llvm<"<2 x i1>">, !llvm<"<2 x i32>"> + // CHECK: %{{.*}} = llvm.select %{{.*}}, %{{.*}}, %{{.*}} : !llvm.vec<2 x i1>, !llvm.vec<2 x i32> %0 = spv.Select %arg0, %arg1, %arg1 : vector<2xi1>, vector<2xi32> return } @@ -29,7 +29,7 @@ } func @undef_vector() { - // CHECK: %{{.*}} = llvm.mlir.undef : !llvm<"<2 x i32>"> + // CHECK: %{{.*}} = llvm.mlir.undef : !llvm.vec<2 x i32> %0 = spv.undef : vector<2xi32> return } diff --git a/mlir/test/Conversion/SPIRVToLLVM/shifts-to-llvm.mlir b/mlir/test/Conversion/SPIRVToLLVM/shifts-to-llvm.mlir --- a/mlir/test/Conversion/SPIRVToLLVM/shifts-to-llvm.mlir +++ b/mlir/test/Conversion/SPIRVToLLVM/shifts-to-llvm.mlir @@ -22,18 +22,18 @@ } func @shift_right_arithmetic_vector(%arg0: vector<4xi64>, %arg1: vector<4xui64>, %arg2: vector<4xi32>, %arg3: vector<4xui32>) { - // CHECK: %{{.*}} = llvm.ashr %{{.*}}, %{{.*}} : !llvm<"<4 x i64>"> + // CHECK: %{{.*}} = llvm.ashr %{{.*}}, %{{.*}} : !llvm.vec<4 x i64> %0 = spv.ShiftRightArithmetic %arg0, %arg0 : vector<4xi64>, vector<4xi64> - // CHECK: %{{.*}} = llvm.ashr %{{.*}}, %{{.*}} : !llvm<"<4 x i64>"> + // CHECK: %{{.*}} = llvm.ashr %{{.*}}, %{{.*}} : !llvm.vec<4 x i64> %1 = spv.ShiftRightArithmetic %arg0, %arg1 : vector<4xi64>, vector<4xui64> - // CHECK: %[[EXT1:.*]] = llvm.sext %{{.*}} : !llvm<"<4 x i32>"> to !llvm<"<4 x i64>"> - // CHECK: %{{.*}} = llvm.ashr %{{.*}}, %[[EXT1:.*]]: !llvm<"<4 x i64>"> + // CHECK: %[[EXT1:.*]] = llvm.sext %{{.*}} : !llvm.vec<4 x i32> to !llvm.vec<4 x i64> + // CHECK: %{{.*}} = llvm.ashr %{{.*}}, %[[EXT1:.*]]: !llvm.vec<4 x i64> %2 = spv.ShiftRightArithmetic %arg0, %arg2 : vector<4xi64>, vector<4xi32> - // CHECK: %[[EXT2:.*]] = llvm.zext %{{.*}} : !llvm<"<4 x i32>"> to !llvm<"<4 x i64>"> - // CHECK: %{{.*}} = llvm.ashr %{{.*}}, %[[EXT2:.*]]: !llvm<"<4 x i64>"> + // CHECK: %[[EXT2:.*]] = llvm.zext %{{.*}} : !llvm.vec<4 x i32> to !llvm.vec<4 x i64> + // CHECK: %{{.*}} = llvm.ashr %{{.*}}, %[[EXT2:.*]]: !llvm.vec<4 x i64> %3 = spv.ShiftRightArithmetic %arg0, %arg3 : vector<4xi64>, vector<4xui32> return } @@ -60,18 +60,18 @@ } func @shift_right_logical_vector(%arg0: vector<4xi64>, %arg1: vector<4xsi64>, %arg2: vector<4xi32>, %arg3: vector<4xui32>) { - // CHECK: %{{.*}} = llvm.lshr %{{.*}}, %{{.*}} : !llvm<"<4 x i64>"> + // CHECK: %{{.*}} = llvm.lshr %{{.*}}, %{{.*}} : !llvm.vec<4 x i64> %0 = spv.ShiftRightLogical %arg0, %arg0 : vector<4xi64>, vector<4xi64> - // CHECK: %{{.*}} = llvm.lshr %{{.*}}, %{{.*}} : !llvm<"<4 x i64>"> + // CHECK: %{{.*}} = llvm.lshr %{{.*}}, %{{.*}} : !llvm.vec<4 x i64> %1 = spv.ShiftRightLogical %arg0, %arg1 : vector<4xi64>, vector<4xsi64> - // CHECK: %[[EXT1:.*]] = llvm.sext %{{.*}} : !llvm<"<4 x i32>"> to !llvm<"<4 x i64>"> - // CHECK: %{{.*}} = llvm.lshr %{{.*}}, %[[EXT1:.*]]: !llvm<"<4 x i64>"> + // CHECK: %[[EXT1:.*]] = llvm.sext %{{.*}} : !llvm.vec<4 x i32> to !llvm.vec<4 x i64> + // CHECK: %{{.*}} = llvm.lshr %{{.*}}, %[[EXT1:.*]]: !llvm.vec<4 x i64> %2 = spv.ShiftRightLogical %arg0, %arg2 : vector<4xi64>, vector<4xi32> - // CHECK: %[[EXT2:.*]] = llvm.zext %{{.*}} : !llvm<"<4 x i32>"> to !llvm<"<4 x i64>"> - // CHECK: %{{.*}} = llvm.lshr %{{.*}}, %[[EXT2:.*]]: !llvm<"<4 x i64>"> + // CHECK: %[[EXT2:.*]] = llvm.zext %{{.*}} : !llvm.vec<4 x i32> to !llvm.vec<4 x i64> + // CHECK: %{{.*}} = llvm.lshr %{{.*}}, %[[EXT2:.*]]: !llvm.vec<4 x i64> %3 = spv.ShiftRightLogical %arg0, %arg3 : vector<4xi64>, vector<4xui32> return } @@ -98,18 +98,18 @@ } func @shift_left_logical_vector(%arg0: vector<4xi64>, %arg1: vector<4xsi64>, %arg2: vector<4xi32>, %arg3: vector<4xui32>) { - // CHECK: %{{.*}} = llvm.shl %{{.*}}, %{{.*}} : !llvm<"<4 x i64>"> + // CHECK: %{{.*}} = llvm.shl %{{.*}}, %{{.*}} : !llvm.vec<4 x i64> %0 = spv.ShiftLeftLogical %arg0, %arg0 : vector<4xi64>, vector<4xi64> - // CHECK: %{{.*}} = llvm.shl %{{.*}}, %{{.*}} : !llvm<"<4 x i64>"> + // CHECK: %{{.*}} = llvm.shl %{{.*}}, %{{.*}} : !llvm.vec<4 x i64> %1 = spv.ShiftLeftLogical %arg0, %arg1 : vector<4xi64>, vector<4xsi64> - // CHECK: %[[EXT1:.*]] = llvm.sext %{{.*}} : !llvm<"<4 x i32>"> to !llvm<"<4 x i64>"> - // CHECK: %{{.*}} = llvm.shl %{{.*}}, %[[EXT1:.*]]: !llvm<"<4 x i64>"> + // CHECK: %[[EXT1:.*]] = llvm.sext %{{.*}} : !llvm.vec<4 x i32> to !llvm.vec<4 x i64> + // CHECK: %{{.*}} = llvm.shl %{{.*}}, %[[EXT1:.*]]: !llvm.vec<4 x i64> %2 = spv.ShiftLeftLogical %arg0, %arg2 : vector<4xi64>, vector<4xi32> - // CHECK: %[[EXT2:.*]] = llvm.zext %{{.*}} : !llvm<"<4 x i32>"> to !llvm<"<4 x i64>"> - // CHECK: %{{.*}} = llvm.shl %{{.*}}, %[[EXT2:.*]]: !llvm<"<4 x i64>"> + // CHECK: %[[EXT2:.*]] = llvm.zext %{{.*}} : !llvm.vec<4 x i32> to !llvm.vec<4 x i64> + // CHECK: %{{.*}} = llvm.shl %{{.*}}, %[[EXT2:.*]]: !llvm.vec<4 x i64> %3 = spv.ShiftLeftLogical %arg0, %arg3 : vector<4xi64>, vector<4xui32> return } diff --git a/mlir/test/Conversion/SPIRVToLLVM/spirv-types-to-llvm.mlir b/mlir/test/Conversion/SPIRVToLLVM/spirv-types-to-llvm.mlir --- a/mlir/test/Conversion/SPIRVToLLVM/spirv-types-to-llvm.mlir +++ b/mlir/test/Conversion/SPIRVToLLVM/spirv-types-to-llvm.mlir @@ -4,35 +4,35 @@ // Array type //===----------------------------------------------------------------------===// -// CHECK-LABEL: @array(!llvm<"[16 x float]">, !llvm<"[32 x <4 x float>]">) +// CHECK-LABEL: @array(!llvm.array<16 x float>, !llvm.array<32 x vec<4 x float>>) func @array(!spv.array<16xf32>, !spv.array< 32 x vector<4xf32> >) -> () //===----------------------------------------------------------------------===// // Pointer type //===----------------------------------------------------------------------===// -// CHECK-LABEL: @pointer_scalar(!llvm<"i1*">, !llvm<"float*">) +// CHECK-LABEL: @pointer_scalar(!llvm.ptr, !llvm.ptr) func @pointer_scalar(!spv.ptr, !spv.ptr) -> () -// CHECK-LABEL: @pointer_vector(!llvm<"<4 x i32>*">) +// CHECK-LABEL: @pointer_vector(!llvm.ptr>) func @pointer_vector(!spv.ptr, Function>) -> () //===----------------------------------------------------------------------===// // Runtime array type //===----------------------------------------------------------------------===// -// CHECK-LABEL: @runtime_array_vector(!llvm<"[0 x <4 x float>]">) +// CHECK-LABEL: @runtime_array_vector(!llvm.array<0 x vec<4 x float>>) func @runtime_array_vector(!spv.rtarray< vector<4xf32> >) -> () -// CHECK-LABEL: @runtime_array_scalar(!llvm<"[0 x float]">) +// CHECK-LABEL: @runtime_array_scalar(!llvm.array<0 x float>) func @runtime_array_scalar(!spv.rtarray) -> () //===----------------------------------------------------------------------===// // Struct type //===----------------------------------------------------------------------===// -// CHECK-LABEL: @struct(!llvm<"<{ double }>">) +// CHECK-LABEL: @struct(!llvm.struct) func @struct(!spv.struct) -> () -// CHECK-LABEL: @struct_nested(!llvm<"<{ i32, <{ i64, i32 }> }>">) +// CHECK-LABEL: @struct_nested(!llvm.struct)>) func @struct_nested(!spv.struct>) diff --git a/mlir/test/Conversion/StandardToLLVM/calling-convention.mlir b/mlir/test/Conversion/StandardToLLVM/calling-convention.mlir --- a/mlir/test/Conversion/StandardToLLVM/calling-convention.mlir +++ b/mlir/test/Conversion/StandardToLLVM/calling-convention.mlir @@ -8,11 +8,11 @@ // An external function is transformed into the glue around calling an interface function. // CHECK-LABEL: @external -// CHECK: %[[ALLOC0:.*]]: !llvm<"float*">, %[[ALIGN0:.*]]: !llvm<"float*">, %[[OFFSET0:.*]]: !llvm.i64, %[[SIZE00:.*]]: !llvm.i64, %[[SIZE01:.*]]: !llvm.i64, %[[STRIDE00:.*]]: !llvm.i64, %[[STRIDE01:.*]]: !llvm.i64, -// CHECK: %[[ALLOC1:.*]]: !llvm<"float*">, %[[ALIGN1:.*]]: !llvm<"float*">, %[[OFFSET1:.*]]: !llvm.i64) +// CHECK: %[[ALLOC0:.*]]: !llvm.ptr, %[[ALIGN0:.*]]: !llvm.ptr, %[[OFFSET0:.*]]: !llvm.i64, %[[SIZE00:.*]]: !llvm.i64, %[[SIZE01:.*]]: !llvm.i64, %[[STRIDE00:.*]]: !llvm.i64, %[[STRIDE01:.*]]: !llvm.i64, +// CHECK: %[[ALLOC1:.*]]: !llvm.ptr, %[[ALIGN1:.*]]: !llvm.ptr, %[[OFFSET1:.*]]: !llvm.i64) func @external(%arg0: memref, %arg1: memref) // Populate the descriptor for arg0. - // CHECK: %[[DESC00:.*]] = llvm.mlir.undef : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: %[[DESC00:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[DESC01:.*]] = llvm.insertvalue %arg0, %[[DESC00]][0] // CHECK: %[[DESC02:.*]] = llvm.insertvalue %arg1, %[[DESC01]][1] // CHECK: %[[DESC03:.*]] = llvm.insertvalue %arg2, %[[DESC02]][2] @@ -23,18 +23,18 @@ // Allocate on stack and store to comply with C calling convention. // CHECK: %[[C1:.*]] = llvm.mlir.constant(1 : index) - // CHECK: %[[DESC0_ALLOCA:.*]] = llvm.alloca %[[C1]] x !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: %[[DESC0_ALLOCA:.*]] = llvm.alloca %[[C1]] x !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: llvm.store %[[DESC07]], %[[DESC0_ALLOCA]] // Populate the descriptor for arg1. - // CHECK: %[[DESC10:.*]] = llvm.mlir.undef : !llvm<"{ float*, float*, i64 }"> - // CHECK: %[[DESC11:.*]] = llvm.insertvalue %arg7, %[[DESC10]][0] : !llvm<"{ float*, float*, i64 }"> - // CHECK: %[[DESC12:.*]] = llvm.insertvalue %arg8, %[[DESC11]][1] : !llvm<"{ float*, float*, i64 }"> - // CHECK: %[[DESC13:.*]] = llvm.insertvalue %arg9, %[[DESC12]][2] : !llvm<"{ float*, float*, i64 }"> + // CHECK: %[[DESC10:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64)> + // CHECK: %[[DESC11:.*]] = llvm.insertvalue %arg7, %[[DESC10]][0] : !llvm.struct<(ptr, ptr, i64)> + // CHECK: %[[DESC12:.*]] = llvm.insertvalue %arg8, %[[DESC11]][1] : !llvm.struct<(ptr, ptr, i64)> + // CHECK: %[[DESC13:.*]] = llvm.insertvalue %arg9, %[[DESC12]][2] : !llvm.struct<(ptr, ptr, i64)> // Allocate on stack and store to comply with C calling convention. // CHECK: %[[C1:.*]] = llvm.mlir.constant(1 : index) - // CHECK: %[[DESC1_ALLOCA:.*]] = llvm.alloca %[[C1]] x !llvm<"{ float*, float*, i64 }"> + // CHECK: %[[DESC1_ALLOCA:.*]] = llvm.alloca %[[C1]] x !llvm.struct<(ptr, ptr, i64)> // CHECK: llvm.store %[[DESC13]], %[[DESC1_ALLOCA]] // Call the interface function. @@ -42,18 +42,18 @@ // Verify that an interface function is emitted. // CHECK-LABEL: llvm.func @_mlir_ciface_external -// CHECK: (!llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }*">, !llvm<"{ float*, float*, i64 }*">) +// CHECK: (!llvm.ptr, ptr, i64, array<2 x i64>, array<2 x i64>)>>, !llvm.ptr, ptr, i64)>>) // Verify that the return value is not affected. // CHECK-LABEL: @returner -// CHECK: -> !llvm<"{ { float*, float*, i64, [2 x i64], [2 x i64] }, { float*, float*, i64 } }"> +// CHECK: -> !llvm.struct<(struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)>, struct<(ptr, ptr, i64)>)> func @returner() -> (memref, memref) // CHECK-LABEL: @caller func @caller() { %0:2 = call @returner() : () -> (memref, memref) // Extract individual values from the descriptor for the first memref. - // CHECK: %[[ALLOC0:.*]] = llvm.extractvalue %[[DESC0:.*]][0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: %[[ALLOC0:.*]] = llvm.extractvalue %[[DESC0:.*]][0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[ALIGN0:.*]] = llvm.extractvalue %[[DESC0]][1] // CHECK: %[[OFFSET0:.*]] = llvm.extractvalue %[[DESC0]][2] // CHECK: %[[SIZE00:.*]] = llvm.extractvalue %[[DESC0]][3, 0] @@ -62,12 +62,12 @@ // CHECK: %[[STRIDE01:.*]] = llvm.extractvalue %[[DESC0]][4, 1] // Extract individual values from the descriptor for the second memref. - // CHECK: %[[ALLOC1:.*]] = llvm.extractvalue %[[DESC1:.*]][0] : !llvm<"{ float*, float*, i64 }"> + // CHECK: %[[ALLOC1:.*]] = llvm.extractvalue %[[DESC1:.*]][0] : !llvm.struct<(ptr, ptr, i64)> // CHECK: %[[ALIGN1:.*]] = llvm.extractvalue %[[DESC1]][1] // CHECK: %[[OFFSET1:.*]] = llvm.extractvalue %[[DESC1]][2] // Forward the values to the call. - // CHECK: llvm.call @external(%[[ALLOC0]], %[[ALIGN0]], %[[OFFSET0]], %[[SIZE00]], %[[SIZE01]], %[[STRIDE00]], %[[STRIDE01]], %[[ALLOC1]], %[[ALIGN1]], %[[OFFSET1]]) : (!llvm<"float*">, !llvm<"float*">, !llvm.i64, !llvm.i64, !llvm.i64, !llvm.i64, !llvm.i64, !llvm<"float*">, !llvm<"float*">, !llvm.i64) -> () + // CHECK: llvm.call @external(%[[ALLOC0]], %[[ALIGN0]], %[[OFFSET0]], %[[SIZE00]], %[[SIZE01]], %[[STRIDE00]], %[[STRIDE01]], %[[ALLOC1]], %[[ALIGN1]], %[[OFFSET1]]) : (!llvm.ptr, !llvm.ptr, !llvm.i64, !llvm.i64, !llvm.i64, !llvm.i64, !llvm.i64, !llvm.ptr, !llvm.ptr, !llvm.i64) -> () call @external(%0#0, %0#1) : (memref, memref) -> () return } @@ -81,9 +81,9 @@ // Verify that an interface function is emitted. // CHECK-LABEL: @_mlir_ciface_callee -// CHECK: %[[ARG0:.*]]: !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }*"> +// CHECK: %[[ARG0:.*]]: !llvm.ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>> // Load the memref descriptor pointer. - // CHECK: %[[DESC:.*]] = llvm.load %[[ARG0]] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }*"> + // CHECK: %[[DESC:.*]] = llvm.load %[[ARG0]] : !llvm.ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>> // Extract individual components of the descriptor. // CHECK: %[[ALLOC:.*]] = llvm.extractvalue %[[DESC]][0] @@ -93,7 +93,7 @@ // CHECK: %[[STRIDE:.*]] = llvm.extractvalue %[[DESC]][4, 0] // Forward the descriptor components to the call. - // CHECK: llvm.call @callee(%[[ALLOC]], %[[ALIGN]], %[[OFFSET]], %[[SIZE]], %[[STRIDE]], %{{.*}}) : (!llvm<"float*">, !llvm<"float*">, !llvm.i64, !llvm.i64, !llvm.i64, !llvm.i64) -> () + // CHECK: llvm.call @callee(%[[ALLOC]], %[[ALIGN]], %[[OFFSET]], %[[SIZE]], %[[STRIDE]], %{{.*}}) : (!llvm.ptr, !llvm.ptr, !llvm.i64, !llvm.i64, !llvm.i64, !llvm.i64) -> () // EMIT_C_ATTRIBUTE-NOT: @mlir_ciface_callee @@ -126,7 +126,7 @@ // CHECK: %[[IDX_SIZE:.*]] = llvm.mlir.constant // CHECK: %[[DOUBLE_PTR_SIZE:.*]] = llvm.mul %[[TWO]], %[[PTR_SIZE]] - // CHECK: %[[RANK:.*]] = llvm.extractvalue %[[CALL_RES]][0] : !llvm<"{ i64, i8* }"> + // CHECK: %[[RANK:.*]] = llvm.extractvalue %[[CALL_RES]][0] : !llvm.struct<(i64, ptr)> // CHECK: %[[DOUBLE_RANK:.*]] = llvm.mul %[[TWO]], %[[RANK]] // CHECK: %[[DOUBLE_RANK_INC:.*]] = llvm.add %[[DOUBLE_RANK]], %[[ONE]] // CHECK: %[[TABLES_SIZE:.*]] = llvm.mul %[[DOUBLE_RANK_INC]], %[[IDX_SIZE]] @@ -136,8 +136,8 @@ // CHECK: %[[SOURCE:.*]] = llvm.extractvalue %[[CALL_RES]][1] // CHECK: "llvm.intr.memcpy"(%[[ALLOCA]], %[[SOURCE]], %[[ALLOC_SIZE]], %[[FALSE]]) // CHECK: llvm.call @free(%[[SOURCE]]) - // CHECK: %[[DESC:.*]] = llvm.mlir.undef : !llvm<"{ i64, i8* }"> - // CHECK: %[[RANK:.*]] = llvm.extractvalue %[[CALL_RES]][0] : !llvm<"{ i64, i8* }"> + // CHECK: %[[DESC:.*]] = llvm.mlir.undef : !llvm.struct<(i64, ptr)> + // CHECK: %[[RANK:.*]] = llvm.extractvalue %[[CALL_RES]][0] : !llvm.struct<(i64, ptr)> // CHECK: %[[DESC_1:.*]] = llvm.insertvalue %[[RANK]], %[[DESC]][0] // CHECK: llvm.insertvalue %[[ALLOCA]], %[[DESC_1]][1] return @@ -148,7 +148,7 @@ // Match the construction of the unranked descriptor. // CHECK: %[[ALLOCA:.*]] = llvm.alloca // CHECK: %[[MEMORY:.*]] = llvm.bitcast %[[ALLOCA]] - // CHECK: %[[DESC_0:.*]] = llvm.mlir.undef : !llvm<"{ i64, i8* }"> + // CHECK: %[[DESC_0:.*]] = llvm.mlir.undef : !llvm.struct<(i64, ptr)> // CHECK: %[[DESC_1:.*]] = llvm.insertvalue %{{.*}}, %[[DESC_0]][0] // CHECK: %[[DESC_2:.*]] = llvm.insertvalue %[[MEMORY]], %[[DESC_1]][1] %0 = memref_cast %arg0: memref<4x3xf32> to memref<*xf32> @@ -160,7 +160,7 @@ // CHECK: %[[IDX_SIZE:.*]] = llvm.mlir.constant // CHECK: %[[DOUBLE_PTR_SIZE:.*]] = llvm.mul %[[TWO]], %[[PTR_SIZE]] - // CHECK: %[[RANK:.*]] = llvm.extractvalue %[[DESC_2]][0] : !llvm<"{ i64, i8* }"> + // CHECK: %[[RANK:.*]] = llvm.extractvalue %[[DESC_2]][0] : !llvm.struct<(i64, ptr)> // CHECK: %[[DOUBLE_RANK:.*]] = llvm.mul %[[TWO]], %[[RANK]] // CHECK: %[[DOUBLE_RANK_INC:.*]] = llvm.add %[[DOUBLE_RANK]], %[[ONE]] // CHECK: %[[TABLES_SIZE:.*]] = llvm.mul %[[DOUBLE_RANK_INC]], %[[IDX_SIZE]] @@ -169,8 +169,8 @@ // CHECK: %[[ALLOCATED:.*]] = llvm.call @malloc(%[[ALLOC_SIZE]]) // CHECK: %[[SOURCE:.*]] = llvm.extractvalue %[[DESC_2]][1] // CHECK: "llvm.intr.memcpy"(%[[ALLOCATED]], %[[SOURCE]], %[[ALLOC_SIZE]], %[[FALSE]]) - // CHECK: %[[NEW_DESC:.*]] = llvm.mlir.undef : !llvm<"{ i64, i8* }"> - // CHECK: %[[RANK:.*]] = llvm.extractvalue %[[DESC_2]][0] : !llvm<"{ i64, i8* }"> + // CHECK: %[[NEW_DESC:.*]] = llvm.mlir.undef : !llvm.struct<(i64, ptr)> + // CHECK: %[[RANK:.*]] = llvm.extractvalue %[[DESC_2]][0] : !llvm.struct<(i64, ptr)> // CHECK: %[[NEW_DESC_1:.*]] = llvm.insertvalue %[[RANK]], %[[NEW_DESC]][0] // CHECK: %[[NEW_DESC_2:.*]] = llvm.insertvalue %[[ALLOCATED]], %[[NEW_DESC_1]][1] // CHECL: llvm.return %[[NEW_DESC_2]] @@ -210,7 +210,7 @@ // Match the construction of the unranked descriptor. // CHECK: %[[ALLOCA:.*]] = llvm.alloca // CHECK: %[[MEMORY:.*]] = llvm.bitcast %[[ALLOCA]] - // CHECK: %[[DESC_0:.*]] = llvm.mlir.undef : !llvm<"{ i64, i8* }"> + // CHECK: %[[DESC_0:.*]] = llvm.mlir.undef : !llvm.struct<(i64, ptr)> // CHECK: %[[DESC_1:.*]] = llvm.insertvalue %{{.*}}, %[[DESC_0]][0] // CHECK: %[[DESC_2:.*]] = llvm.insertvalue %[[MEMORY]], %[[DESC_1]][1] %0 = memref_cast %arg0 : memref<4x3xf32> to memref<*xf32> @@ -233,7 +233,7 @@ // CHECK: %[[RES_21:.*]] = llvm.insertvalue %{{.*}}, %[[RES_2]][0] // CHECK: %[[RES_22:.*]] = llvm.insertvalue %[[ALLOCATED_2]], %[[RES_21]][1] - // CHECK: %[[RESULTS:.*]] = llvm.mlir.undef : !llvm<"{ { i64, i8* }, { i64, i8* } }"> + // CHECK: %[[RESULTS:.*]] = llvm.mlir.undef : !llvm.struct<(struct<(i64, ptr)>, struct<(i64, ptr)>)> // CHECK: %[[RESULTS_1:.*]] = llvm.insertvalue %[[RES_12]], %[[RESULTS]] // CHECK: %[[RESULTS_2:.*]] = llvm.insertvalue %[[RES_22]], %[[RESULTS_1]] // CHECK: llvm.return %[[RESULTS_2]] diff --git a/mlir/test/Conversion/StandardToLLVM/convert-dynamic-memref-ops.mlir b/mlir/test/Conversion/StandardToLLVM/convert-dynamic-memref-ops.mlir --- a/mlir/test/Conversion/StandardToLLVM/convert-dynamic-memref-ops.mlir +++ b/mlir/test/Conversion/StandardToLLVM/convert-dynamic-memref-ops.mlir @@ -2,11 +2,11 @@ // RUN: mlir-opt -convert-std-to-llvm='use-aligned-alloc=1' %s | FileCheck %s --check-prefix=ALIGNED-ALLOC // CHECK-LABEL: func @check_strided_memref_arguments( -// CHECK-COUNT-2: !llvm<"float*"> +// CHECK-COUNT-2: !llvm.ptr // CHECK-COUNT-5: !llvm.i64 -// CHECK-COUNT-2: !llvm<"float*"> +// CHECK-COUNT-2: !llvm.ptr // CHECK-COUNT-5: !llvm.i64 -// CHECK-COUNT-2: !llvm<"float*"> +// CHECK-COUNT-2: !llvm.ptr // CHECK-COUNT-5: !llvm.i64 func @check_strided_memref_arguments(%static: memref<10x20xf32, affine_map<(i,j)->(20 * i + j + 1)>>, %dynamic : memref(M * i + j + 1)>>, @@ -15,144 +15,144 @@ } // CHECK-LABEL: func @check_arguments -// CHECK-COUNT-2: !llvm<"float*"> +// CHECK-COUNT-2: !llvm.ptr // CHECK-COUNT-5: !llvm.i64 -// CHECK-COUNT-2: !llvm<"float*"> +// CHECK-COUNT-2: !llvm.ptr // CHECK-COUNT-5: !llvm.i64 -// CHECK-COUNT-2: !llvm<"float*"> +// CHECK-COUNT-2: !llvm.ptr // CHECK-COUNT-5: !llvm.i64 func @check_arguments(%static: memref<10x20xf32>, %dynamic : memref, %mixed : memref<10x?xf32>) { return } // CHECK-LABEL: func @mixed_alloc( -// CHECK: %[[M:.*]]: !llvm.i64, %[[N:.*]]: !llvm.i64) -> !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> { +// CHECK: %[[M:.*]]: !llvm.i64, %[[N:.*]]: !llvm.i64) -> !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> { func @mixed_alloc(%arg0: index, %arg1: index) -> memref { // CHECK: %[[c42:.*]] = llvm.mlir.constant(42 : index) : !llvm.i64 // CHECK-NEXT: llvm.mul %[[M]], %[[c42]] : !llvm.i64 // CHECK-NEXT: %[[sz:.*]] = llvm.mul %{{.*}}, %[[N]] : !llvm.i64 -// CHECK-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm<"float*"> +// CHECK-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm.ptr // CHECK-NEXT: %[[one:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm<"float*"> to !llvm.i64 +// CHECK-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr to !llvm.i64 // CHECK-NEXT: %[[sz_bytes:.*]] = llvm.mul %[[sz]], %[[sizeof]] : !llvm.i64 -// CHECK-NEXT: llvm.call @malloc(%[[sz_bytes]]) : (!llvm.i64) -> !llvm<"i8*"> -// CHECK-NEXT: llvm.bitcast %{{.*}} : !llvm<"i8*"> to !llvm<"float*"> -// CHECK-NEXT: llvm.mlir.undef : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> +// CHECK-NEXT: llvm.call @malloc(%[[sz_bytes]]) : (!llvm.i64) -> !llvm.ptr +// CHECK-NEXT: llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr +// CHECK-NEXT: llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> // CHECK-NEXT: %[[off:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK-NEXT: llvm.insertvalue %[[off]], %{{.*}}[2] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> +// CHECK-NEXT: llvm.insertvalue %[[off]], %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> // CHECK-NEXT: %[[st2:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 // CHECK-NEXT: %[[st1:.*]] = llvm.mul %{{.*}}, %[[N]] : !llvm.i64 // CHECK-NEXT: %[[st0:.*]] = llvm.mul %{{.*}}, %[[c42]] : !llvm.i64 -// CHECK-NEXT: llvm.insertvalue %[[M]], %{{.*}}[3, 0] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %[[st0]], %{{.*}}[4, 0] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %[[c42]], %{{.*}}[3, 1] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %[[st1]], %{{.*}}[4, 1] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %[[N]], %{{.*}}[3, 2] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %[[st2]], %{{.*}}[4, 2] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> +// CHECK-NEXT: llvm.insertvalue %[[M]], %{{.*}}[3, 0] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK-NEXT: llvm.insertvalue %[[st0]], %{{.*}}[4, 0] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK-NEXT: llvm.insertvalue %[[c42]], %{{.*}}[3, 1] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK-NEXT: llvm.insertvalue %[[st1]], %{{.*}}[4, 1] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK-NEXT: llvm.insertvalue %[[N]], %{{.*}}[3, 2] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK-NEXT: llvm.insertvalue %[[st2]], %{{.*}}[4, 2] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> %0 = alloc(%arg0, %arg1) : memref -// CHECK-NEXT: llvm.return %{{.*}} : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> +// CHECK-NEXT: llvm.return %{{.*}} : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> return %0 : memref } // CHECK-LABEL: func @mixed_dealloc func @mixed_dealloc(%arg0: memref) { -// CHECK: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[0] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK-NEXT: %[[ptri8:.*]] = llvm.bitcast %[[ptr]] : !llvm<"float*"> to !llvm<"i8*"> -// CHECK-NEXT: llvm.call @free(%[[ptri8]]) : (!llvm<"i8*">) -> () +// CHECK: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK-NEXT: %[[ptri8:.*]] = llvm.bitcast %[[ptr]] : !llvm.ptr to !llvm.ptr +// CHECK-NEXT: llvm.call @free(%[[ptri8]]) : (!llvm.ptr) -> () dealloc %arg0 : memref // CHECK-NEXT: llvm.return return } // CHECK-LABEL: func @dynamic_alloc( -// CHECK: %[[M:.*]]: !llvm.i64, %[[N:.*]]: !llvm.i64) -> !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> { +// CHECK: %[[M:.*]]: !llvm.i64, %[[N:.*]]: !llvm.i64) -> !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> { func @dynamic_alloc(%arg0: index, %arg1: index) -> memref { // CHECK: %[[sz:.*]] = llvm.mul %[[M]], %[[N]] : !llvm.i64 -// CHECK-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm<"float*"> +// CHECK-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm.ptr // CHECK-NEXT: %[[one:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm<"float*"> to !llvm.i64 +// CHECK-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr to !llvm.i64 // CHECK-NEXT: %[[sz_bytes:.*]] = llvm.mul %[[sz]], %[[sizeof]] : !llvm.i64 -// CHECK-NEXT: llvm.call @malloc(%[[sz_bytes]]) : (!llvm.i64) -> !llvm<"i8*"> -// CHECK-NEXT: llvm.bitcast %{{.*}} : !llvm<"i8*"> to !llvm<"float*"> -// CHECK-NEXT: llvm.mlir.undef : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK-NEXT: llvm.call @malloc(%[[sz_bytes]]) : (!llvm.i64) -> !llvm.ptr +// CHECK-NEXT: llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr +// CHECK-NEXT: llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK-NEXT: %[[off:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK-NEXT: llvm.insertvalue %[[off]], %{{.*}}[2] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK-NEXT: llvm.insertvalue %[[off]], %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK-NEXT: %[[st1:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 // CHECK-NEXT: %[[st0:.*]] = llvm.mul %{{.*}}, %[[N]] : !llvm.i64 -// CHECK-NEXT: llvm.insertvalue %[[M]], %{{.*}}[3, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %[[st0]], %{{.*}}[4, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %[[N]], %{{.*}}[3, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %[[st1]], %{{.*}}[4, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK-NEXT: llvm.insertvalue %[[M]], %{{.*}}[3, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK-NEXT: llvm.insertvalue %[[st0]], %{{.*}}[4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK-NEXT: llvm.insertvalue %[[N]], %{{.*}}[3, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK-NEXT: llvm.insertvalue %[[st1]], %{{.*}}[4, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> %0 = alloc(%arg0, %arg1) : memref -// CHECK-NEXT: llvm.return %{{.*}} : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK-NEXT: llvm.return %{{.*}} : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> return %0 : memref } // ----- // CHECK-LABEL: func @dynamic_alloca -// CHECK: %[[M:.*]]: !llvm.i64, %[[N:.*]]: !llvm.i64) -> !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> { +// CHECK: %[[M:.*]]: !llvm.i64, %[[N:.*]]: !llvm.i64) -> !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> { func @dynamic_alloca(%arg0: index, %arg1: index) -> memref { // CHECK: %[[num_elems:.*]] = llvm.mul %[[M]], %[[N]] : !llvm.i64 -// CHECK-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm<"float*"> +// CHECK-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm.ptr // CHECK-NEXT: %[[one:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm<"float*"> to !llvm.i64 +// CHECK-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr to !llvm.i64 // CHECK-NEXT: %[[sz_bytes:.*]] = llvm.mul %[[num_elems]], %[[sizeof]] : !llvm.i64 -// CHECK-NEXT: %[[allocated:.*]] = llvm.alloca %[[sz_bytes]] x !llvm.float : (!llvm.i64) -> !llvm<"float*"> -// CHECK-NEXT: llvm.mlir.undef : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %[[allocated]], %{{.*}}[0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %[[allocated]], %{{.*}}[1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK-NEXT: %[[allocated:.*]] = llvm.alloca %[[sz_bytes]] x !llvm.float : (!llvm.i64) -> !llvm.ptr +// CHECK-NEXT: llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK-NEXT: llvm.insertvalue %[[allocated]], %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK-NEXT: llvm.insertvalue %[[allocated]], %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK-NEXT: %[[off:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK-NEXT: llvm.insertvalue %[[off]], %{{.*}}[2] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK-NEXT: llvm.insertvalue %[[off]], %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK-NEXT: %[[st1:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 // CHECK-NEXT: %[[st0:.*]] = llvm.mul %{{.*}}, %[[N]] : !llvm.i64 -// CHECK-NEXT: llvm.insertvalue %[[M]], %{{.*}}[3, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %[[st0]], %{{.*}}[4, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %[[N]], %{{.*}}[3, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %[[st1]], %{{.*}}[4, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK-NEXT: llvm.insertvalue %[[M]], %{{.*}}[3, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK-NEXT: llvm.insertvalue %[[st0]], %{{.*}}[4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK-NEXT: llvm.insertvalue %[[N]], %{{.*}}[3, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK-NEXT: llvm.insertvalue %[[st1]], %{{.*}}[4, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> %0 = alloca(%arg0, %arg1) : memref // Test with explicitly specified alignment. llvm.alloca takes care of the // alignment. The same pointer is thus used for allocation and aligned // accesses. -// CHECK: %[[alloca_aligned:.*]] = llvm.alloca %{{.*}} x !llvm.float {alignment = 32 : i64} : (!llvm.i64) -> !llvm<"float*"> -// CHECK: %[[desc:.*]] = llvm.mlir.undef : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK: %[[desc1:.*]] = llvm.insertvalue %[[alloca_aligned]], %[[desc]][0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK: llvm.insertvalue %[[alloca_aligned]], %[[desc1]][1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: %[[alloca_aligned:.*]] = llvm.alloca %{{.*}} x !llvm.float {alignment = 32 : i64} : (!llvm.i64) -> !llvm.ptr +// CHECK: %[[desc:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK: %[[desc1:.*]] = llvm.insertvalue %[[alloca_aligned]], %[[desc]][0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK: llvm.insertvalue %[[alloca_aligned]], %[[desc1]][1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> alloca(%arg0, %arg1) {alignment = 32} : memref return %0 : memref } // CHECK-LABEL: func @dynamic_dealloc func @dynamic_dealloc(%arg0: memref) { -// CHECK: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK-NEXT: %[[ptri8:.*]] = llvm.bitcast %[[ptr]] : !llvm<"float*"> to !llvm<"i8*"> -// CHECK-NEXT: llvm.call @free(%[[ptri8]]) : (!llvm<"i8*">) -> () +// CHECK: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK-NEXT: %[[ptri8:.*]] = llvm.bitcast %[[ptr]] : !llvm.ptr to !llvm.ptr +// CHECK-NEXT: llvm.call @free(%[[ptri8]]) : (!llvm.ptr) -> () dealloc %arg0 : memref return } -// CHECK-LABEL: func @stdlib_aligned_alloc({{.*}}) -> !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> { -// ALIGNED-ALLOC-LABEL: func @stdlib_aligned_alloc({{.*}}) -> !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> { +// CHECK-LABEL: func @stdlib_aligned_alloc({{.*}}) -> !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> { +// ALIGNED-ALLOC-LABEL: func @stdlib_aligned_alloc({{.*}}) -> !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> { func @stdlib_aligned_alloc(%N : index) -> memref<32x18xf32> { // ALIGNED-ALLOC-NEXT: %[[sz1:.*]] = llvm.mlir.constant(32 : index) : !llvm.i64 // ALIGNED-ALLOC-NEXT: %[[sz2:.*]] = llvm.mlir.constant(18 : index) : !llvm.i64 // ALIGNED-ALLOC-NEXT: %[[num_elems:.*]] = llvm.mul %0, %1 : !llvm.i64 -// ALIGNED-ALLOC-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm<"float*"> +// ALIGNED-ALLOC-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm.ptr // ALIGNED-ALLOC-NEXT: %[[one:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// ALIGNED-ALLOC-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// ALIGNED-ALLOC-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm<"float*"> to !llvm.i64 +// ALIGNED-ALLOC-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// ALIGNED-ALLOC-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr to !llvm.i64 // ALIGNED-ALLOC-NEXT: %[[bytes:.*]] = llvm.mul %[[num_elems]], %[[sizeof]] : !llvm.i64 // ALIGNED-ALLOC-NEXT: %[[alignment:.*]] = llvm.mlir.constant(32 : i64) : !llvm.i64 -// ALIGNED-ALLOC-NEXT: %[[allocated:.*]] = llvm.call @aligned_alloc(%[[alignment]], %[[bytes]]) : (!llvm.i64, !llvm.i64) -> !llvm<"i8*"> -// ALIGNED-ALLOC-NEXT: llvm.bitcast %[[allocated]] : !llvm<"i8*"> to !llvm<"float*"> +// ALIGNED-ALLOC-NEXT: %[[allocated:.*]] = llvm.call @aligned_alloc(%[[alignment]], %[[bytes]]) : (!llvm.i64, !llvm.i64) -> !llvm.ptr +// ALIGNED-ALLOC-NEXT: llvm.bitcast %[[allocated]] : !llvm.ptr to !llvm.ptr %0 = alloc() {alignment = 32} : memref<32x18xf32> // Do another alloc just to test that we have a unique declaration for // aligned_alloc. @@ -186,28 +186,28 @@ } // CHECK-LABEL: func @mixed_load( -// CHECK-COUNT-2: !llvm<"float*">, +// CHECK-COUNT-2: !llvm.ptr, // CHECK-COUNT-5: {{%[a-zA-Z0-9]*}}: !llvm.i64 // CHECK: %[[I:.*]]: !llvm.i64, // CHECK: %[[J:.*]]: !llvm.i64) func @mixed_load(%mixed : memref<42x?xf32>, %i : index, %j : index) { -// CHECK: %[[ptr:.*]] = llvm.extractvalue %[[ld:.*]][1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: %[[ptr:.*]] = llvm.extractvalue %[[ld:.*]][1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK-NEXT: %[[off:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK-NEXT: %[[st0:.*]] = llvm.extractvalue %[[ld]][4, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK-NEXT: %[[st0:.*]] = llvm.extractvalue %[[ld]][4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK-NEXT: %[[offI:.*]] = llvm.mul %[[I]], %[[st0]] : !llvm.i64 // CHECK-NEXT: %[[off0:.*]] = llvm.add %[[off]], %[[offI]] : !llvm.i64 // CHECK-NEXT: %[[st1:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 // CHECK-NEXT: %[[offJ:.*]] = llvm.mul %[[J]], %[[st1]] : !llvm.i64 // CHECK-NEXT: %[[off1:.*]] = llvm.add %[[off0]], %[[offJ]] : !llvm.i64 -// CHECK-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off1]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// CHECK-NEXT: llvm.load %[[addr]] : !llvm<"float*"> +// CHECK-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off1]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// CHECK-NEXT: llvm.load %[[addr]] : !llvm.ptr %0 = load %mixed[%i, %j] : memref<42x?xf32> return } // CHECK-LABEL: func @dynamic_load( -// CHECK-SAME: %[[ARG0:[a-zA-Z0-9]*]]: !llvm<"float*"> -// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm<"float*"> +// CHECK-SAME: %[[ARG0:[a-zA-Z0-9]*]]: !llvm.ptr +// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.ptr // CHECK-SAME: %[[ARG2:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[ARG3:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[ARG4:[a-zA-Z0-9]*]]: !llvm.i64 @@ -216,23 +216,23 @@ // CHECK-SAME: %[[I:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[J:[a-zA-Z0-9]*]]: !llvm.i64 func @dynamic_load(%dynamic : memref, %i : index, %j : index) { -// CHECK: %[[ptr:.*]] = llvm.extractvalue %[[ld:.*]][1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: %[[ptr:.*]] = llvm.extractvalue %[[ld:.*]][1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK-NEXT: %[[off:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK-NEXT: %[[st0:.*]] = llvm.extractvalue %[[ld]][4, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK-NEXT: %[[st0:.*]] = llvm.extractvalue %[[ld]][4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK-NEXT: %[[offI:.*]] = llvm.mul %[[I]], %[[st0]] : !llvm.i64 // CHECK-NEXT: %[[off0:.*]] = llvm.add %[[off]], %[[offI]] : !llvm.i64 // CHECK-NEXT: %[[st1:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 // CHECK-NEXT: %[[offJ:.*]] = llvm.mul %[[J]], %[[st1]] : !llvm.i64 // CHECK-NEXT: %[[off1:.*]] = llvm.add %[[off0]], %[[offJ]] : !llvm.i64 -// CHECK-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off1]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// CHECK-NEXT: llvm.load %[[addr]] : !llvm<"float*"> +// CHECK-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off1]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// CHECK-NEXT: llvm.load %[[addr]] : !llvm.ptr %0 = load %dynamic[%i, %j] : memref return } // CHECK-LABEL: func @prefetch -// CHECK-SAME: %[[ARG0:[a-zA-Z0-9]*]]: !llvm<"float*"> -// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm<"float*"> +// CHECK-SAME: %[[ARG0:[a-zA-Z0-9]*]]: !llvm.ptr +// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.ptr // CHECK-SAME: %[[ARG2:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[ARG3:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[ARG4:[a-zA-Z0-9]*]]: !llvm.i64 @@ -241,36 +241,36 @@ // CHECK-SAME: %[[I:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[J:[a-zA-Z0-9]*]]: !llvm.i64 func @prefetch(%A : memref, %i : index, %j : index) { -// CHECK: %[[ptr:.*]] = llvm.extractvalue %[[ld:.*]][1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: %[[ptr:.*]] = llvm.extractvalue %[[ld:.*]][1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK-NEXT: %[[off:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK-NEXT: %[[st0:.*]] = llvm.extractvalue %[[ld]][4, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK-NEXT: %[[st0:.*]] = llvm.extractvalue %[[ld]][4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK-NEXT: %[[offI:.*]] = llvm.mul %[[I]], %[[st0]] : !llvm.i64 // CHECK-NEXT: %[[off0:.*]] = llvm.add %[[off]], %[[offI]] : !llvm.i64 // CHECK-NEXT: %[[st1:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 // CHECK-NEXT: %[[offJ:.*]] = llvm.mul %[[J]], %[[st1]] : !llvm.i64 // CHECK-NEXT: %[[off1:.*]] = llvm.add %[[off0]], %[[offJ]] : !llvm.i64 -// CHECK-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off1]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> +// CHECK-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off1]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr // CHECK-NEXT: [[C1:%.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32 // CHECK-NEXT: [[C3:%.*]] = llvm.mlir.constant(3 : i32) : !llvm.i32 // CHECK-NEXT: [[C1_1:%.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32 -// CHECK-NEXT: "llvm.intr.prefetch"(%[[addr]], [[C1]], [[C3]], [[C1_1]]) : (!llvm<"float*">, !llvm.i32, !llvm.i32, !llvm.i32) -> () +// CHECK-NEXT: "llvm.intr.prefetch"(%[[addr]], [[C1]], [[C3]], [[C1_1]]) : (!llvm.ptr, !llvm.i32, !llvm.i32, !llvm.i32) -> () prefetch %A[%i, %j], write, locality<3>, data : memref // CHECK: [[C0:%.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 // CHECK: [[C0_1:%.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 // CHECK: [[C1_2:%.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32 -// CHECK: "llvm.intr.prefetch"(%{{.*}}, [[C0]], [[C0_1]], [[C1_2]]) : (!llvm<"float*">, !llvm.i32, !llvm.i32, !llvm.i32) -> () +// CHECK: "llvm.intr.prefetch"(%{{.*}}, [[C0]], [[C0_1]], [[C1_2]]) : (!llvm.ptr, !llvm.i32, !llvm.i32, !llvm.i32) -> () prefetch %A[%i, %j], read, locality<0>, data : memref // CHECK: [[C0_2:%.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 // CHECK: [[C2:%.*]] = llvm.mlir.constant(2 : i32) : !llvm.i32 // CHECK: [[C0_3:%.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 -// CHECK: "llvm.intr.prefetch"(%{{.*}}, [[C0_2]], [[C2]], [[C0_3]]) : (!llvm<"float*">, !llvm.i32, !llvm.i32, !llvm.i32) -> () +// CHECK: "llvm.intr.prefetch"(%{{.*}}, [[C0_2]], [[C2]], [[C0_3]]) : (!llvm.ptr, !llvm.i32, !llvm.i32, !llvm.i32) -> () prefetch %A[%i, %j], read, locality<2>, instr : memref return } // CHECK-LABEL: func @dynamic_store -// CHECK-SAME: %[[ARG0:[a-zA-Z0-9]*]]: !llvm<"float*"> -// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm<"float*"> +// CHECK-SAME: %[[ARG0:[a-zA-Z0-9]*]]: !llvm.ptr +// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.ptr // CHECK-SAME: %[[ARG2:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[ARG3:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[ARG4:[a-zA-Z0-9]*]]: !llvm.i64 @@ -279,23 +279,23 @@ // CHECK-SAME: %[[I:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[J:[a-zA-Z0-9]*]]: !llvm.i64 func @dynamic_store(%dynamic : memref, %i : index, %j : index, %val : f32) { -// CHECK: %[[ptr:.*]] = llvm.extractvalue %[[ld:.*]][1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: %[[ptr:.*]] = llvm.extractvalue %[[ld:.*]][1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK-NEXT: %[[off:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK-NEXT: %[[st0:.*]] = llvm.extractvalue %[[ld]][4, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK-NEXT: %[[st0:.*]] = llvm.extractvalue %[[ld]][4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK-NEXT: %[[offI:.*]] = llvm.mul %[[I]], %[[st0]] : !llvm.i64 // CHECK-NEXT: %[[off0:.*]] = llvm.add %[[off]], %[[offI]] : !llvm.i64 // CHECK-NEXT: %[[st1:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 // CHECK-NEXT: %[[offJ:.*]] = llvm.mul %[[J]], %[[st1]] : !llvm.i64 // CHECK-NEXT: %[[off1:.*]] = llvm.add %[[off0]], %[[offJ]] : !llvm.i64 -// CHECK-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off1]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// CHECK-NEXT: llvm.store %{{.*}}, %[[addr]] : !llvm<"float*"> +// CHECK-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off1]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// CHECK-NEXT: llvm.store %{{.*}}, %[[addr]] : !llvm.ptr store %val, %dynamic[%i, %j] : memref return } // CHECK-LABEL: func @mixed_store -// CHECK-SAME: %[[ARG0:[a-zA-Z0-9]*]]: !llvm<"float*"> -// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm<"float*"> +// CHECK-SAME: %[[ARG0:[a-zA-Z0-9]*]]: !llvm.ptr +// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.ptr // CHECK-SAME: %[[ARG2:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[ARG3:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[ARG4:[a-zA-Z0-9]*]]: !llvm.i64 @@ -304,65 +304,65 @@ // CHECK-SAME: %[[I:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[J:[a-zA-Z0-9]*]]: !llvm.i64 func @mixed_store(%mixed : memref<42x?xf32>, %i : index, %j : index, %val : f32) { -// CHECK: %[[ptr:.*]] = llvm.extractvalue %[[ld:.*]][1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: %[[ptr:.*]] = llvm.extractvalue %[[ld:.*]][1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK-NEXT: %[[off:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK-NEXT: %[[st0:.*]] = llvm.extractvalue %[[ld]][4, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK-NEXT: %[[st0:.*]] = llvm.extractvalue %[[ld]][4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK-NEXT: %[[offI:.*]] = llvm.mul %[[I]], %[[st0]] : !llvm.i64 // CHECK-NEXT: %[[off0:.*]] = llvm.add %[[off]], %[[offI]] : !llvm.i64 // CHECK-NEXT: %[[st1:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 // CHECK-NEXT: %[[offJ:.*]] = llvm.mul %[[J]], %[[st1]] : !llvm.i64 // CHECK-NEXT: %[[off1:.*]] = llvm.add %[[off0]], %[[offJ]] : !llvm.i64 -// CHECK-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off1]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// CHECK-NEXT: llvm.store %{{.*}}, %[[addr]] : !llvm<"float*"> +// CHECK-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off1]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// CHECK-NEXT: llvm.store %{{.*}}, %[[addr]] : !llvm.ptr store %val, %mixed[%i, %j] : memref<42x?xf32> return } // CHECK-LABEL: func @memref_cast_static_to_dynamic func @memref_cast_static_to_dynamic(%static : memref<10x42xf32>) { -// CHECK: llvm.bitcast %{{.*}} : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> to !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: llvm.bitcast %{{.*}} : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> to !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> %0 = memref_cast %static : memref<10x42xf32> to memref return } // CHECK-LABEL: func @memref_cast_static_to_mixed func @memref_cast_static_to_mixed(%static : memref<10x42xf32>) { -// CHECK: llvm.bitcast %{{.*}} : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> to !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: llvm.bitcast %{{.*}} : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> to !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> %0 = memref_cast %static : memref<10x42xf32> to memref return } // CHECK-LABEL: func @memref_cast_dynamic_to_static func @memref_cast_dynamic_to_static(%dynamic : memref) { -// CHECK: llvm.bitcast %{{.*}} : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> to !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: llvm.bitcast %{{.*}} : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> to !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> %0 = memref_cast %dynamic : memref to memref<10x12xf32> return } // CHECK-LABEL: func @memref_cast_dynamic_to_mixed func @memref_cast_dynamic_to_mixed(%dynamic : memref) { -// CHECK: llvm.bitcast %{{.*}} : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> to !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: llvm.bitcast %{{.*}} : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> to !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> %0 = memref_cast %dynamic : memref to memref return } // CHECK-LABEL: func @memref_cast_mixed_to_dynamic func @memref_cast_mixed_to_dynamic(%mixed : memref<42x?xf32>) { -// CHECK: llvm.bitcast %{{.*}} : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> to !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: llvm.bitcast %{{.*}} : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> to !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> %0 = memref_cast %mixed : memref<42x?xf32> to memref return } // CHECK-LABEL: func @memref_cast_mixed_to_static func @memref_cast_mixed_to_static(%mixed : memref<42x?xf32>) { -// CHECK: llvm.bitcast %{{.*}} : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> to !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: llvm.bitcast %{{.*}} : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> to !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> %0 = memref_cast %mixed : memref<42x?xf32> to memref<42x1xf32> return } // CHECK-LABEL: func @memref_cast_mixed_to_mixed func @memref_cast_mixed_to_mixed(%mixed : memref<42x?xf32>) { -// CHECK: llvm.bitcast %{{.*}} : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> to !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: llvm.bitcast %{{.*}} : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> to !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> %0 = memref_cast %mixed : memref<42x?xf32> to memref return } @@ -370,21 +370,21 @@ // CHECK-LABEL: func @memref_cast_ranked_to_unranked func @memref_cast_ranked_to_unranked(%arg : memref<42x2x?xf32>) { // CHECK-DAG: %[[c:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK-DAG: %[[p:.*]] = llvm.alloca %[[c]] x !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> : (!llvm.i64) -> !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }*"> -// CHECK-DAG: llvm.store %{{.*}}, %[[p]] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }*"> -// CHECK-DAG: %[[p2:.*]] = llvm.bitcast %[[p]] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }*"> to !llvm<"i8*"> +// CHECK-DAG: %[[p:.*]] = llvm.alloca %[[c]] x !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> : (!llvm.i64) -> !llvm.ptr, ptr, i64, array<3 x i64>, array<3 x i64>)>> +// CHECK-DAG: llvm.store %{{.*}}, %[[p]] : !llvm.ptr, ptr, i64, array<3 x i64>, array<3 x i64>)>> +// CHECK-DAG: %[[p2:.*]] = llvm.bitcast %[[p]] : !llvm.ptr, ptr, i64, array<3 x i64>, array<3 x i64>)>> to !llvm.ptr // CHECK-DAG: %[[r:.*]] = llvm.mlir.constant(3 : i64) : !llvm.i64 -// CHECK : llvm.mlir.undef : !llvm<"{ i64, i8* }"> -// CHECK-DAG: llvm.insertvalue %[[r]], %{{.*}}[0] : !llvm<"{ i64, i8* }"> -// CHECK-DAG: llvm.insertvalue %[[p2]], %{{.*}}[1] : !llvm<"{ i64, i8* }"> +// CHECK : llvm.mlir.undef : !llvm.struct<(i64, ptr)> +// CHECK-DAG: llvm.insertvalue %[[r]], %{{.*}}[0] : !llvm.struct<(i64, ptr)> +// CHECK-DAG: llvm.insertvalue %[[p2]], %{{.*}}[1] : !llvm.struct<(i64, ptr)> %0 = memref_cast %arg : memref<42x2x?xf32> to memref<*xf32> return } // CHECK-LABEL: func @memref_cast_unranked_to_ranked func @memref_cast_unranked_to_ranked(%arg : memref<*xf32>) { -// CHECK: %[[p:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm<"{ i64, i8* }"> -// CHECK-NEXT: llvm.bitcast %[[p]] : !llvm<"i8*"> to !llvm<"{ float*, float*, i64, [4 x i64], [4 x i64] }*"> +// CHECK: %[[p:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(i64, ptr)> +// CHECK-NEXT: llvm.bitcast %[[p]] : !llvm.ptr to !llvm.ptr, ptr, i64, array<4 x i64>, array<4 x i64>)>> %0 = memref_cast %arg : memref<*xf32> to memref return } @@ -394,25 +394,25 @@ // CHECK: llvm.mlir.constant(42 : index) : !llvm.i64 %c0 = constant 0 : index %0 = dim %mixed, %c0 : memref<42x?x?x13x?xf32> -// CHECK: llvm.extractvalue %[[ld:.*]][3, 1] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> +// CHECK: llvm.extractvalue %[[ld:.*]][3, 1] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> %c1 = constant 1 : index %1 = dim %mixed, %c1 : memref<42x?x?x13x?xf32> -// CHECK: llvm.extractvalue %[[ld]][3, 2] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> +// CHECK: llvm.extractvalue %[[ld]][3, 2] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> %c2 = constant 2 : index %2 = dim %mixed, %c2 : memref<42x?x?x13x?xf32> // CHECK: llvm.mlir.constant(13 : index) : !llvm.i64 %c3 = constant 3 : index %3 = dim %mixed, %c3 : memref<42x?x?x13x?xf32> -// CHECK: llvm.extractvalue %[[ld]][3, 4] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> +// CHECK: llvm.extractvalue %[[ld]][3, 4] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> %c4 = constant 4 : index %4 = dim %mixed, %c4 : memref<42x?x?x13x?xf32> return } // CHECK-LABEL: @memref_dim_with_dyn_index -// CHECK-SAME: %[[ALLOC_PTR:.*]]: !llvm<"float*">, %[[ALIGN_PTR:.*]]: !llvm<"float*">, %[[OFFSET:.*]]: !llvm.i64, %[[SIZE0:.*]]: !llvm.i64, %[[SIZE1:.*]]: !llvm.i64, %[[STRIDE0:.*]]: !llvm.i64, %[[STRIDE1:.*]]: !llvm.i64, %[[IDX:.*]]: !llvm.i64) -> !llvm.i64 +// CHECK-SAME: %[[ALLOC_PTR:.*]]: !llvm.ptr, %[[ALIGN_PTR:.*]]: !llvm.ptr, %[[OFFSET:.*]]: !llvm.i64, %[[SIZE0:.*]]: !llvm.i64, %[[SIZE1:.*]]: !llvm.i64, %[[STRIDE0:.*]]: !llvm.i64, %[[STRIDE1:.*]]: !llvm.i64, %[[IDX:.*]]: !llvm.i64) -> !llvm.i64 func @memref_dim_with_dyn_index(%arg : memref<3x?xf32>, %idx : index) -> index { - // CHECK-NEXT: %[[DESCR0:.*]] = llvm.mlir.undef : [[DESCR_TY:!llvm<"{ float\*, float\*, i64, \[2 x i64\], \[2 x i64\] }">]] + // CHECK-NEXT: %[[DESCR0:.*]] = llvm.mlir.undef : [[DESCR_TY:!llvm.struct<\(ptr, ptr, i64, array<2 x i64>, array<2 x i64>\)>]] // CHECK-NEXT: %[[DESCR1:.*]] = llvm.insertvalue %[[ALLOC_PTR]], %[[DESCR0]][0] : [[DESCR_TY]] // CHECK-NEXT: %[[DESCR2:.*]] = llvm.insertvalue %[[ALIGN_PTR]], %[[DESCR1]][1] : [[DESCR_TY]] // CHECK-NEXT: %[[DESCR3:.*]] = llvm.insertvalue %[[OFFSET]], %[[DESCR2]][2] : [[DESCR_TY]] @@ -423,10 +423,10 @@ // CHECK-DAG: %[[C0:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 // CHECK-DAG: %[[C1:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 // CHECK-DAG: %[[SIZES:.*]] = llvm.extractvalue %[[DESCR7]][3] : [[DESCR_TY]] - // CHECK-DAG: %[[SIZES_PTR:.*]] = llvm.alloca %[[C1]] x !llvm<"[2 x i64]"> : (!llvm.i64) -> !llvm<"[2 x i64]*"> - // CHECK-DAG: llvm.store %[[SIZES]], %[[SIZES_PTR]] : !llvm<"[2 x i64]*"> - // CHECK-DAG: %[[RESULT_PTR:.*]] = llvm.getelementptr %[[SIZES_PTR]][%[[C0]], %[[IDX]]] : (!llvm<"[2 x i64]*">, !llvm.i64, !llvm.i64) -> !llvm<"i64*"> - // CHECK-DAG: %[[RESULT:.*]] = llvm.load %[[RESULT_PTR]] : !llvm<"i64*"> + // CHECK-DAG: %[[SIZES_PTR:.*]] = llvm.alloca %[[C1]] x !llvm.array<2 x i64> : (!llvm.i64) -> !llvm.ptr> + // CHECK-DAG: llvm.store %[[SIZES]], %[[SIZES_PTR]] : !llvm.ptr> + // CHECK-DAG: %[[RESULT_PTR:.*]] = llvm.getelementptr %[[SIZES_PTR]][%[[C0]], %[[IDX]]] : (!llvm.ptr>, !llvm.i64, !llvm.i64) -> !llvm.ptr + // CHECK-DAG: %[[RESULT:.*]] = llvm.load %[[RESULT_PTR]] : !llvm.ptr // CHECK-DAG: llvm.return %[[RESULT]] : !llvm.i64 %result = dim %arg, %idx : memref<3x?xf32> return %result : index diff --git a/mlir/test/Conversion/StandardToLLVM/convert-funcs.mlir b/mlir/test/Conversion/StandardToLLVM/convert-funcs.mlir --- a/mlir/test/Conversion/StandardToLLVM/convert-funcs.mlir +++ b/mlir/test/Conversion/StandardToLLVM/convert-funcs.mlir @@ -1,39 +1,39 @@ // RUN: mlir-opt -convert-std-to-llvm %s | FileCheck %s -//CHECK: llvm.func @second_order_arg(!llvm<"void ()*">) +//CHECK: llvm.func @second_order_arg(!llvm.ptr>) func @second_order_arg(%arg0 : () -> ()) -//CHECK: llvm.func @second_order_result() -> !llvm<"void ()*"> +//CHECK: llvm.func @second_order_result() -> !llvm.ptr> func @second_order_result() -> (() -> ()) -//CHECK: llvm.func @second_order_multi_result() -> !llvm<"{ i32 ()*, i64 ()*, float ()* }"> +//CHECK: llvm.func @second_order_multi_result() -> !llvm.struct<(ptr>, ptr>, ptr>)> func @second_order_multi_result() -> (() -> (i32), () -> (i64), () -> (f32)) -//CHECK: llvm.func @third_order(!llvm<"void ()* (void ()*)*">) -> !llvm<"void ()* (void ()*)*"> +//CHECK: llvm.func @third_order(!llvm.ptr> (ptr>)>>) -> !llvm.ptr> (ptr>)>> func @third_order(%arg0 : (() -> ()) -> (() -> ())) -> ((() -> ()) -> (() -> ())) -//CHECK: llvm.func @fifth_order_left(!llvm<"void (void (void (void ()*)*)*)*">) +//CHECK: llvm.func @fifth_order_left(!llvm.ptr>)>>)>>)>>) func @fifth_order_left(%arg0: (((() -> ()) -> ()) -> ()) -> ()) -//CHECK: llvm.func @fifth_order_right(!llvm<"void ()* ()* ()* ()*">) +//CHECK: llvm.func @fifth_order_right(!llvm.ptr> ()>> ()>> ()>>) func @fifth_order_right(%arg0: () -> (() -> (() -> (() -> ())))) // Check that memrefs are converted to argument packs if appear as function arguments. -// CHECK: llvm.func @memref_call_conv(!llvm<"float*">, !llvm<"float*">, !llvm.i64, !llvm.i64, !llvm.i64) +// CHECK: llvm.func @memref_call_conv(!llvm.ptr, !llvm.ptr, !llvm.i64, !llvm.i64, !llvm.i64) func @memref_call_conv(%arg0: memref) // Same in nested functions. -// CHECK: llvm.func @memref_call_conv_nested(!llvm<"void (float*, float*, i64, i64, i64)*">) +// CHECK: llvm.func @memref_call_conv_nested(!llvm.ptr, ptr, i64, i64, i64)>>) func @memref_call_conv_nested(%arg0: (memref) -> ()) -//CHECK-LABEL: llvm.func @pass_through(%arg0: !llvm<"void ()*">) -> !llvm<"void ()*"> { +//CHECK-LABEL: llvm.func @pass_through(%arg0: !llvm.ptr>) -> !llvm.ptr> { func @pass_through(%arg0: () -> ()) -> (() -> ()) { -// CHECK-NEXT: llvm.br ^bb1(%arg0 : !llvm<"void ()*">) +// CHECK-NEXT: llvm.br ^bb1(%arg0 : !llvm.ptr>) br ^bb1(%arg0 : () -> ()) -//CHECK-NEXT: ^bb1(%0: !llvm<"void ()*">): +//CHECK-NEXT: ^bb1(%0: !llvm.ptr>): ^bb1(%bbarg: () -> ()): -// CHECK-NEXT: llvm.return %0 : !llvm<"void ()*"> +// CHECK-NEXT: llvm.return %0 : !llvm.ptr> return %bbarg : () -> () } @@ -43,7 +43,7 @@ // CHECK-LABEL: llvm.func @indirect_const_call // CHECK-SAME: (%[[ARG0:.*]]: !llvm.i32) { func @indirect_const_call(%arg0: i32) { -// CHECK-NEXT: %[[ADDR:.*]] = llvm.mlir.addressof @body : !llvm<"void (i32)*"> +// CHECK-NEXT: %[[ADDR:.*]] = llvm.mlir.addressof @body : !llvm.ptr> %0 = constant @body : (i32) -> () // CHECK-NEXT: llvm.call %[[ADDR]](%[[ARG0:.*]]) : (!llvm.i32) -> () call_indirect %0(%arg0) : (i32) -> () @@ -51,7 +51,7 @@ return } -// CHECK-LABEL: llvm.func @indirect_call(%arg0: !llvm<"i32 (float)*">, %arg1: !llvm.float) -> !llvm.i32 { +// CHECK-LABEL: llvm.func @indirect_call(%arg0: !llvm.ptr>, %arg1: !llvm.float) -> !llvm.i32 { func @indirect_call(%arg0: (f32) -> i32, %arg1: f32) -> i32 { // CHECK-NEXT: %0 = llvm.call %arg0(%arg1) : (!llvm.float) -> !llvm.i32 %0 = call_indirect %arg0(%arg1) : (f32) -> i32 diff --git a/mlir/test/Conversion/StandardToLLVM/convert-static-memref-ops.mlir b/mlir/test/Conversion/StandardToLLVM/convert-static-memref-ops.mlir --- a/mlir/test/Conversion/StandardToLLVM/convert-static-memref-ops.mlir +++ b/mlir/test/Conversion/StandardToLLVM/convert-static-memref-ops.mlir @@ -2,7 +2,7 @@ // RUN: mlir-opt -convert-std-to-llvm='use-bare-ptr-memref-call-conv=1' -split-input-file %s | FileCheck %s --check-prefix=BAREPTR // BAREPTR-LABEL: func @check_noalias -// BAREPTR-SAME: %{{.*}}: !llvm<"float*"> {llvm.noalias = true}, %{{.*}}: !llvm<"float*"> {llvm.noalias = true} +// BAREPTR-SAME: %{{.*}}: !llvm.ptr {llvm.noalias = true}, %{{.*}}: !llvm.ptr {llvm.noalias = true} func @check_noalias(%static : memref<2xf32> {llvm.noalias = true}, %other : memref<2xf32> {llvm.noalias = true}) { return } @@ -10,91 +10,91 @@ // ----- // CHECK-LABEL: func @check_static_return -// CHECK-COUNT-2: !llvm<"float*"> +// CHECK-COUNT-2: !llvm.ptr // CHECK-COUNT-5: !llvm.i64 -// CHECK-SAME: -> !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK-SAME: -> !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // BAREPTR-LABEL: func @check_static_return -// BAREPTR-SAME: (%[[arg:.*]]: !llvm<"float*">) -> !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> { +// BAREPTR-SAME: (%[[arg:.*]]: !llvm.ptr) -> !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> { func @check_static_return(%static : memref<32x18xf32>) -> memref<32x18xf32> { -// CHECK: llvm.return %{{.*}} : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: llvm.return %{{.*}} : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> -// BAREPTR: %[[udf:.*]] = llvm.mlir.undef : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// BAREPTR-NEXT: %[[base:.*]] = llvm.insertvalue %[[arg]], %[[udf]][0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// BAREPTR-NEXT: %[[aligned:.*]] = llvm.insertvalue %[[arg]], %[[base]][1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// BAREPTR: %[[udf:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// BAREPTR-NEXT: %[[base:.*]] = llvm.insertvalue %[[arg]], %[[udf]][0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// BAREPTR-NEXT: %[[aligned:.*]] = llvm.insertvalue %[[arg]], %[[base]][1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // BAREPTR-NEXT: %[[val0:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// BAREPTR-NEXT: %[[ins0:.*]] = llvm.insertvalue %[[val0]], %[[aligned]][2] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// BAREPTR-NEXT: %[[ins0:.*]] = llvm.insertvalue %[[val0]], %[[aligned]][2] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // BAREPTR-NEXT: %[[val1:.*]] = llvm.mlir.constant(32 : index) : !llvm.i64 -// BAREPTR-NEXT: %[[ins1:.*]] = llvm.insertvalue %[[val1]], %[[ins0]][3, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// BAREPTR-NEXT: %[[ins1:.*]] = llvm.insertvalue %[[val1]], %[[ins0]][3, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // BAREPTR-NEXT: %[[val2:.*]] = llvm.mlir.constant(18 : index) : !llvm.i64 -// BAREPTR-NEXT: %[[ins2:.*]] = llvm.insertvalue %[[val2]], %[[ins1]][4, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// BAREPTR-NEXT: %[[ins2:.*]] = llvm.insertvalue %[[val2]], %[[ins1]][4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // BAREPTR-NEXT: %[[val3:.*]] = llvm.mlir.constant(18 : index) : !llvm.i64 -// BAREPTR-NEXT: %[[ins3:.*]] = llvm.insertvalue %[[val3]], %[[ins2]][3, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// BAREPTR-NEXT: %[[ins3:.*]] = llvm.insertvalue %[[val3]], %[[ins2]][3, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // BAREPTR-NEXT: %[[val4:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// BAREPTR-NEXT: %[[ins4:.*]] = llvm.insertvalue %[[val4]], %[[ins3]][4, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// BAREPTR-NEXT: llvm.return %[[ins4]] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// BAREPTR-NEXT: %[[ins4:.*]] = llvm.insertvalue %[[val4]], %[[ins3]][4, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// BAREPTR-NEXT: llvm.return %[[ins4]] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> return %static : memref<32x18xf32> } // ----- // CHECK-LABEL: func @check_static_return_with_offset -// CHECK-COUNT-2: !llvm<"float*"> +// CHECK-COUNT-2: !llvm.ptr // CHECK-COUNT-5: !llvm.i64 -// CHECK-SAME: -> !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK-SAME: -> !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // BAREPTR-LABEL: func @check_static_return_with_offset -// BAREPTR-SAME: (%[[arg:.*]]: !llvm<"float*">) -> !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> { +// BAREPTR-SAME: (%[[arg:.*]]: !llvm.ptr) -> !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> { func @check_static_return_with_offset(%static : memref<32x18xf32, offset:7, strides:[22,1]>) -> memref<32x18xf32, offset:7, strides:[22,1]> { -// CHECK: llvm.return %{{.*}} : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: llvm.return %{{.*}} : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> -// BAREPTR: %[[udf:.*]] = llvm.mlir.undef : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// BAREPTR-NEXT: %[[base:.*]] = llvm.insertvalue %[[arg]], %[[udf]][0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// BAREPTR-NEXT: %[[aligned:.*]] = llvm.insertvalue %[[arg]], %[[base]][1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// BAREPTR: %[[udf:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// BAREPTR-NEXT: %[[base:.*]] = llvm.insertvalue %[[arg]], %[[udf]][0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// BAREPTR-NEXT: %[[aligned:.*]] = llvm.insertvalue %[[arg]], %[[base]][1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // BAREPTR-NEXT: %[[val0:.*]] = llvm.mlir.constant(7 : index) : !llvm.i64 -// BAREPTR-NEXT: %[[ins0:.*]] = llvm.insertvalue %[[val0]], %[[aligned]][2] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// BAREPTR-NEXT: %[[ins0:.*]] = llvm.insertvalue %[[val0]], %[[aligned]][2] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // BAREPTR-NEXT: %[[val1:.*]] = llvm.mlir.constant(32 : index) : !llvm.i64 -// BAREPTR-NEXT: %[[ins1:.*]] = llvm.insertvalue %[[val1]], %[[ins0]][3, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// BAREPTR-NEXT: %[[ins1:.*]] = llvm.insertvalue %[[val1]], %[[ins0]][3, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // BAREPTR-NEXT: %[[val2:.*]] = llvm.mlir.constant(22 : index) : !llvm.i64 -// BAREPTR-NEXT: %[[ins2:.*]] = llvm.insertvalue %[[val2]], %[[ins1]][4, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// BAREPTR-NEXT: %[[ins2:.*]] = llvm.insertvalue %[[val2]], %[[ins1]][4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // BAREPTR-NEXT: %[[val3:.*]] = llvm.mlir.constant(18 : index) : !llvm.i64 -// BAREPTR-NEXT: %[[ins3:.*]] = llvm.insertvalue %[[val3]], %[[ins2]][3, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// BAREPTR-NEXT: %[[ins3:.*]] = llvm.insertvalue %[[val3]], %[[ins2]][3, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // BAREPTR-NEXT: %[[val4:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// BAREPTR-NEXT: %[[ins4:.*]] = llvm.insertvalue %[[val4]], %[[ins3]][4, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// BAREPTR-NEXT: llvm.return %[[ins4]] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// BAREPTR-NEXT: %[[ins4:.*]] = llvm.insertvalue %[[val4]], %[[ins3]][4, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// BAREPTR-NEXT: llvm.return %[[ins4]] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> return %static : memref<32x18xf32, offset:7, strides:[22,1]> } // ----- -// CHECK-LABEL: func @zero_d_alloc() -> !llvm<"{ float*, float*, i64 }"> { -// BAREPTR-LABEL: func @zero_d_alloc() -> !llvm<"{ float*, float*, i64 }"> { +// CHECK-LABEL: func @zero_d_alloc() -> !llvm.struct<(ptr, ptr, i64)> { +// BAREPTR-LABEL: func @zero_d_alloc() -> !llvm.struct<(ptr, ptr, i64)> { func @zero_d_alloc() -> memref { // CHECK-NEXT: llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm<"float*"> +// CHECK-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm.ptr // CHECK-NEXT: %[[one:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm<"float*"> to !llvm.i64 +// CHECK-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr to !llvm.i64 // CHECK-NEXT: llvm.mul %{{.*}}, %[[sizeof]] : !llvm.i64 -// CHECK-NEXT: llvm.call @malloc(%{{.*}}) : (!llvm.i64) -> !llvm<"i8*"> -// CHECK-NEXT: %[[ptr:.*]] = llvm.bitcast %{{.*}} : !llvm<"i8*"> to !llvm<"float*"> -// CHECK-NEXT: llvm.mlir.undef : !llvm<"{ float*, float*, i64 }"> -// CHECK-NEXT: llvm.insertvalue %[[ptr]], %{{.*}}[0] : !llvm<"{ float*, float*, i64 }"> -// CHECK-NEXT: llvm.insertvalue %[[ptr]], %{{.*}}[1] : !llvm<"{ float*, float*, i64 }"> +// CHECK-NEXT: llvm.call @malloc(%{{.*}}) : (!llvm.i64) -> !llvm.ptr +// CHECK-NEXT: %[[ptr:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr +// CHECK-NEXT: llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64)> +// CHECK-NEXT: llvm.insertvalue %[[ptr]], %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64)> +// CHECK-NEXT: llvm.insertvalue %[[ptr]], %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64)> // CHECK-NEXT: %[[c0:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK-NEXT: llvm.insertvalue %[[c0]], %{{.*}}[2] : !llvm<"{ float*, float*, i64 }"> +// CHECK-NEXT: llvm.insertvalue %[[c0]], %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64)> // BAREPTR-NEXT: llvm.mlir.constant(1 : index) : !llvm.i64 -// BAREPTR-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm<"float*"> +// BAREPTR-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm.ptr // BAREPTR-NEXT: %[[one:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// BAREPTR-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// BAREPTR-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm<"float*"> to !llvm.i64 +// BAREPTR-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// BAREPTR-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr to !llvm.i64 // BAREPTR-NEXT: llvm.mul %{{.*}}, %[[sizeof]] : !llvm.i64 -// BAREPTR-NEXT: llvm.call @malloc(%{{.*}}) : (!llvm.i64) -> !llvm<"i8*"> -// BAREPTR-NEXT: %[[ptr:.*]] = llvm.bitcast %{{.*}} : !llvm<"i8*"> to !llvm<"float*"> -// BAREPTR-NEXT: llvm.mlir.undef : !llvm<"{ float*, float*, i64 }"> -// BAREPTR-NEXT: llvm.insertvalue %[[ptr]], %{{.*}}[0] : !llvm<"{ float*, float*, i64 }"> -// BAREPTR-NEXT: llvm.insertvalue %[[ptr]], %{{.*}}[1] : !llvm<"{ float*, float*, i64 }"> +// BAREPTR-NEXT: llvm.call @malloc(%{{.*}}) : (!llvm.i64) -> !llvm.ptr +// BAREPTR-NEXT: %[[ptr:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr +// BAREPTR-NEXT: llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64)> +// BAREPTR-NEXT: llvm.insertvalue %[[ptr]], %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64)> +// BAREPTR-NEXT: llvm.insertvalue %[[ptr]], %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64)> // BAREPTR-NEXT: %[[c0:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// BAREPTR-NEXT: llvm.insertvalue %[[c0]], %{{.*}}[2] : !llvm<"{ float*, float*, i64 }"> +// BAREPTR-NEXT: llvm.insertvalue %[[c0]], %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64)> %0 = alloc() : memref return %0 : memref } @@ -102,15 +102,15 @@ // ----- // CHECK-LABEL: func @zero_d_dealloc -// BAREPTR-LABEL: func @zero_d_dealloc(%{{.*}}: !llvm<"float*">) { +// BAREPTR-LABEL: func @zero_d_dealloc(%{{.*}}: !llvm.ptr) { func @zero_d_dealloc(%arg0: memref) { -// CHECK: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[0] : !llvm<"{ float*, float*, i64 }"> -// CHECK-NEXT: %[[bc:.*]] = llvm.bitcast %[[ptr]] : !llvm<"float*"> to !llvm<"i8*"> -// CHECK-NEXT: llvm.call @free(%[[bc]]) : (!llvm<"i8*">) -> () +// CHECK: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64)> +// CHECK-NEXT: %[[bc:.*]] = llvm.bitcast %[[ptr]] : !llvm.ptr to !llvm.ptr +// CHECK-NEXT: llvm.call @free(%[[bc]]) : (!llvm.ptr) -> () -// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[0] : !llvm<"{ float*, float*, i64 }"> -// BAREPTR-NEXT: %[[bc:.*]] = llvm.bitcast %[[ptr]] : !llvm<"float*"> to !llvm<"i8*"> -// BAREPTR-NEXT: llvm.call @free(%[[bc]]) : (!llvm<"i8*">) -> () +// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64)> +// BAREPTR-NEXT: %[[bc:.*]] = llvm.bitcast %[[ptr]] : !llvm.ptr to !llvm.ptr +// BAREPTR-NEXT: llvm.call @free(%[[bc]]) : (!llvm.ptr) -> () dealloc %arg0 : memref return } @@ -121,106 +121,106 @@ // BAREPTR-LABEL: func @aligned_1d_alloc( func @aligned_1d_alloc() -> memref<42xf32> { // CHECK: llvm.mlir.constant(42 : index) : !llvm.i64 -// CHECK-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm<"float*"> +// CHECK-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm.ptr // CHECK-NEXT: %[[one:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm<"float*"> to !llvm.i64 +// CHECK-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr to !llvm.i64 // CHECK-NEXT: llvm.mul %{{.*}}, %[[sizeof]] : !llvm.i64 // CHECK-NEXT: %[[alignment:.*]] = llvm.mlir.constant(8 : index) : !llvm.i64 // CHECK-NEXT: %[[alignmentMinus1:.*]] = llvm.add {{.*}}, %[[alignment]] : !llvm.i64 // CHECK-NEXT: %[[allocsize:.*]] = llvm.sub %[[alignmentMinus1]], %[[one]] : !llvm.i64 -// CHECK-NEXT: %[[allocated:.*]] = llvm.call @malloc(%[[allocsize]]) : (!llvm.i64) -> !llvm<"i8*"> -// CHECK-NEXT: %[[ptr:.*]] = llvm.bitcast %{{.*}} : !llvm<"i8*"> to !llvm<"float*"> -// CHECK-NEXT: llvm.mlir.undef : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %[[ptr]], %{{.*}}[0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> -// CHECK-NEXT: %[[allocatedAsInt:.*]] = llvm.ptrtoint %[[allocated]] : !llvm<"i8*"> to !llvm.i64 +// CHECK-NEXT: %[[allocated:.*]] = llvm.call @malloc(%[[allocsize]]) : (!llvm.i64) -> !llvm.ptr +// CHECK-NEXT: %[[ptr:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr +// CHECK-NEXT: llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> +// CHECK-NEXT: llvm.insertvalue %[[ptr]], %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> +// CHECK-NEXT: %[[allocatedAsInt:.*]] = llvm.ptrtoint %[[allocated]] : !llvm.ptr to !llvm.i64 // CHECK-NEXT: %[[alignAdj1:.*]] = llvm.urem %[[allocatedAsInt]], %[[alignment]] : !llvm.i64 // CHECK-NEXT: %[[alignAdj2:.*]] = llvm.sub %[[alignment]], %[[alignAdj1]] : !llvm.i64 // CHECK-NEXT: %[[alignAdj3:.*]] = llvm.urem %[[alignAdj2]], %[[alignment]] : !llvm.i64 -// CHECK-NEXT: %[[aligned:.*]] = llvm.getelementptr %9[%[[alignAdj3]]] : (!llvm<"i8*">, !llvm.i64) -> !llvm<"i8*"> -// CHECK-NEXT: %[[alignedBitCast:.*]] = llvm.bitcast %[[aligned]] : !llvm<"i8*"> to !llvm<"float*"> -// CHECK-NEXT: llvm.insertvalue %[[alignedBitCast]], %{{.*}}[1] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> +// CHECK-NEXT: %[[aligned:.*]] = llvm.getelementptr %9[%[[alignAdj3]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// CHECK-NEXT: %[[alignedBitCast:.*]] = llvm.bitcast %[[aligned]] : !llvm.ptr to !llvm.ptr +// CHECK-NEXT: llvm.insertvalue %[[alignedBitCast]], %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> // CHECK-NEXT: %[[c0:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK-NEXT: llvm.insertvalue %[[c0]], %{{.*}}[2] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> +// CHECK-NEXT: llvm.insertvalue %[[c0]], %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> // BAREPTR-NEXT: llvm.mlir.constant(42 : index) : !llvm.i64 -// BAREPTR-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm<"float*"> +// BAREPTR-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm.ptr // BAREPTR-NEXT: %[[one:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// BAREPTR-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// BAREPTR-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm<"float*"> to !llvm.i64 +// BAREPTR-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// BAREPTR-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr to !llvm.i64 // BAREPTR-NEXT: llvm.mul %{{.*}}, %[[sizeof]] : !llvm.i64 // BAREPTR-NEXT: %[[alignment:.*]] = llvm.mlir.constant(8 : index) : !llvm.i64 // BAREPTR-NEXT: %[[alignmentMinus1:.*]] = llvm.add {{.*}}, %[[alignment]] : !llvm.i64 // BAREPTR-NEXT: %[[allocsize:.*]] = llvm.sub %[[alignmentMinus1]], %[[one]] : !llvm.i64 -// BAREPTR-NEXT: %[[allocated:.*]] = llvm.call @malloc(%[[allocsize]]) : (!llvm.i64) -> !llvm<"i8*"> -// BAREPTR-NEXT: %[[ptr:.*]] = llvm.bitcast %{{.*}} : !llvm<"i8*"> to !llvm<"float*"> -// BAREPTR-NEXT: llvm.mlir.undef : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> -// BAREPTR-NEXT: llvm.insertvalue %[[ptr]], %{{.*}}[0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> -// BAREPTR-NEXT: %[[allocatedAsInt:.*]] = llvm.ptrtoint %[[allocated]] : !llvm<"i8*"> to !llvm.i64 +// BAREPTR-NEXT: %[[allocated:.*]] = llvm.call @malloc(%[[allocsize]]) : (!llvm.i64) -> !llvm.ptr +// BAREPTR-NEXT: %[[ptr:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr +// BAREPTR-NEXT: llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> +// BAREPTR-NEXT: llvm.insertvalue %[[ptr]], %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> +// BAREPTR-NEXT: %[[allocatedAsInt:.*]] = llvm.ptrtoint %[[allocated]] : !llvm.ptr to !llvm.i64 // BAREPTR-NEXT: %[[alignAdj1:.*]] = llvm.urem %[[allocatedAsInt]], %[[alignment]] : !llvm.i64 // BAREPTR-NEXT: %[[alignAdj2:.*]] = llvm.sub %[[alignment]], %[[alignAdj1]] : !llvm.i64 // BAREPTR-NEXT: %[[alignAdj3:.*]] = llvm.urem %[[alignAdj2]], %[[alignment]] : !llvm.i64 -// BAREPTR-NEXT: %[[aligned:.*]] = llvm.getelementptr %9[%[[alignAdj3]]] : (!llvm<"i8*">, !llvm.i64) -> !llvm<"i8*"> -// BAREPTR-NEXT: %[[alignedBitCast:.*]] = llvm.bitcast %[[aligned]] : !llvm<"i8*"> to !llvm<"float*"> -// BAREPTR-NEXT: llvm.insertvalue %[[alignedBitCast]], %{{.*}}[1] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> +// BAREPTR-NEXT: %[[aligned:.*]] = llvm.getelementptr %9[%[[alignAdj3]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// BAREPTR-NEXT: %[[alignedBitCast:.*]] = llvm.bitcast %[[aligned]] : !llvm.ptr to !llvm.ptr +// BAREPTR-NEXT: llvm.insertvalue %[[alignedBitCast]], %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> // BAREPTR-NEXT: %[[c0:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// BAREPTR-NEXT: llvm.insertvalue %[[c0]], %{{.*}}[2] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> +// BAREPTR-NEXT: llvm.insertvalue %[[c0]], %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> %0 = alloc() {alignment = 8} : memref<42xf32> return %0 : memref<42xf32> } // ----- -// CHECK-LABEL: func @static_alloc() -> !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> { -// BAREPTR-LABEL: func @static_alloc() -> !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> { +// CHECK-LABEL: func @static_alloc() -> !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> { +// BAREPTR-LABEL: func @static_alloc() -> !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> { func @static_alloc() -> memref<32x18xf32> { // CHECK: %[[sz1:.*]] = llvm.mlir.constant(32 : index) : !llvm.i64 // CHECK-NEXT: %[[sz2:.*]] = llvm.mlir.constant(18 : index) : !llvm.i64 // CHECK-NEXT: %[[num_elems:.*]] = llvm.mul %0, %1 : !llvm.i64 -// CHECK-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm<"float*"> +// CHECK-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm.ptr // CHECK-NEXT: %[[one:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm<"float*"> to !llvm.i64 +// CHECK-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr to !llvm.i64 // CHECK-NEXT: %[[bytes:.*]] = llvm.mul %[[num_elems]], %[[sizeof]] : !llvm.i64 -// CHECK-NEXT: %[[allocated:.*]] = llvm.call @malloc(%[[bytes]]) : (!llvm.i64) -> !llvm<"i8*"> -// CHECK-NEXT: llvm.bitcast %[[allocated]] : !llvm<"i8*"> to !llvm<"float*"> +// CHECK-NEXT: %[[allocated:.*]] = llvm.call @malloc(%[[bytes]]) : (!llvm.i64) -> !llvm.ptr +// CHECK-NEXT: llvm.bitcast %[[allocated]] : !llvm.ptr to !llvm.ptr // BAREPTR-NEXT: %[[sz1:.*]] = llvm.mlir.constant(32 : index) : !llvm.i64 // BAREPTR-NEXT: %[[sz2:.*]] = llvm.mlir.constant(18 : index) : !llvm.i64 // BAREPTR-NEXT: %[[num_elems:.*]] = llvm.mul %[[sz1]], %[[sz2]] : !llvm.i64 -// BAREPTR-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm<"float*"> +// BAREPTR-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm.ptr // BAREPTR-NEXT: %[[one:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// BAREPTR-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// BAREPTR-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm<"float*"> to !llvm.i64 +// BAREPTR-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// BAREPTR-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr to !llvm.i64 // BAREPTR-NEXT: %[[bytes:.*]] = llvm.mul %[[num_elems]], %[[sizeof]] : !llvm.i64 -// BAREPTR-NEXT: %[[allocated:.*]] = llvm.call @malloc(%[[bytes]]) : (!llvm.i64) -> !llvm<"i8*"> -// BAREPTR-NEXT: llvm.bitcast %[[allocated]] : !llvm<"i8*"> to !llvm<"float*"> +// BAREPTR-NEXT: %[[allocated:.*]] = llvm.call @malloc(%[[bytes]]) : (!llvm.i64) -> !llvm.ptr +// BAREPTR-NEXT: llvm.bitcast %[[allocated]] : !llvm.ptr to !llvm.ptr %0 = alloc() : memref<32x18xf32> return %0 : memref<32x18xf32> } // ----- -// CHECK-LABEL: func @static_alloca() -> !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> { +// CHECK-LABEL: func @static_alloca() -> !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> { func @static_alloca() -> memref<32x18xf32> { // CHECK-NEXT: %[[sz1:.*]] = llvm.mlir.constant(32 : index) : !llvm.i64 // CHECK-NEXT: %[[sz2:.*]] = llvm.mlir.constant(18 : index) : !llvm.i64 // CHECK-NEXT: %[[num_elems:.*]] = llvm.mul %0, %1 : !llvm.i64 -// CHECK-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm<"float*"> +// CHECK-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm.ptr // CHECK-NEXT: %[[one:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm<"float*"> to !llvm.i64 +// CHECK-NEXT: %[[gep:.*]] = llvm.getelementptr %[[null]][%[[one]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr to !llvm.i64 // CHECK-NEXT: %[[bytes:.*]] = llvm.mul %[[num_elems]], %[[sizeof]] : !llvm.i64 -// CHECK-NEXT: %[[allocated:.*]] = llvm.alloca %[[bytes]] x !llvm.float : (!llvm.i64) -> !llvm<"float*"> +// CHECK-NEXT: %[[allocated:.*]] = llvm.alloca %[[bytes]] x !llvm.float : (!llvm.i64) -> !llvm.ptr %0 = alloca() : memref<32x18xf32> // Test with explicitly specified alignment. llvm.alloca takes care of the // alignment. The same pointer is thus used for allocation and aligned // accesses. - // CHECK: %[[alloca_aligned:.*]] = llvm.alloca %{{.*}} x !llvm.float {alignment = 32 : i64} : (!llvm.i64) -> !llvm<"float*"> - // CHECK: %[[desc:.*]] = llvm.mlir.undef : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[desc1:.*]] = llvm.insertvalue %[[alloca_aligned]], %[[desc]][0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: llvm.insertvalue %[[alloca_aligned]], %[[desc1]][1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: %[[alloca_aligned:.*]] = llvm.alloca %{{.*}} x !llvm.float {alignment = 32 : i64} : (!llvm.i64) -> !llvm.ptr + // CHECK: %[[desc:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[desc1:.*]] = llvm.insertvalue %[[alloca_aligned]], %[[desc]][0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: llvm.insertvalue %[[alloca_aligned]], %[[desc1]][1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> alloca() {alignment = 32} : memref<32x18xf32> return %0 : memref<32x18xf32> } @@ -228,15 +228,15 @@ // ----- // CHECK-LABEL: func @static_dealloc -// BAREPTR-LABEL: func @static_dealloc(%{{.*}}: !llvm<"float*">) { +// BAREPTR-LABEL: func @static_dealloc(%{{.*}}: !llvm.ptr) { func @static_dealloc(%static: memref<10x8xf32>) { -// CHECK: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK-NEXT: %[[bc:.*]] = llvm.bitcast %[[ptr]] : !llvm<"float*"> to !llvm<"i8*"> -// CHECK-NEXT: llvm.call @free(%[[bc]]) : (!llvm<"i8*">) -> () +// CHECK: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK-NEXT: %[[bc:.*]] = llvm.bitcast %[[ptr]] : !llvm.ptr to !llvm.ptr +// CHECK-NEXT: llvm.call @free(%[[bc]]) : (!llvm.ptr) -> () -// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// BAREPTR-NEXT: %[[bc:.*]] = llvm.bitcast %[[ptr]] : !llvm<"float*"> to !llvm<"i8*"> -// BAREPTR-NEXT: llvm.call @free(%[[bc]]) : (!llvm<"i8*">) -> () +// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// BAREPTR-NEXT: %[[bc:.*]] = llvm.bitcast %[[ptr]] : !llvm.ptr to !llvm.ptr +// BAREPTR-NEXT: llvm.call @free(%[[bc]]) : (!llvm.ptr) -> () dealloc %static : memref<10x8xf32> return } @@ -244,17 +244,17 @@ // ----- // CHECK-LABEL: func @zero_d_load -// BAREPTR-LABEL: func @zero_d_load(%{{.*}}: !llvm<"float*">) -> !llvm.float +// BAREPTR-LABEL: func @zero_d_load(%{{.*}}: !llvm.ptr) -> !llvm.float func @zero_d_load(%arg0: memref) -> f32 { -// CHECK: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, float*, i64 }"> +// CHECK: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64)> // CHECK-NEXT: %[[c0:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[c0]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// CHECK-NEXT: %{{.*}} = llvm.load %[[addr]] : !llvm<"float*"> +// CHECK-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[c0]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// CHECK-NEXT: %{{.*}} = llvm.load %[[addr]] : !llvm.ptr -// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, float*, i64 }"> +// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64)> // BAREPTR-NEXT: %[[c0:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// BAREPTR-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[c0]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// BAREPTR-NEXT: llvm.load %[[addr:.*]] : !llvm<"float*"> +// BAREPTR-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[c0]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// BAREPTR-NEXT: llvm.load %[[addr:.*]] : !llvm.ptr %0 = load %arg0[] : memref return %0 : f32 } @@ -262,14 +262,14 @@ // ----- // CHECK-LABEL: func @static_load( -// CHECK-COUNT-2: !llvm<"float*">, +// CHECK-COUNT-2: !llvm.ptr, // CHECK-COUNT-5: {{%[a-zA-Z0-9]*}}: !llvm.i64 // CHECK: %[[I:.*]]: !llvm.i64, // CHECK: %[[J:.*]]: !llvm.i64) // BAREPTR-LABEL: func @static_load -// BAREPTR-SAME: (%[[A:.*]]: !llvm<"float*">, %[[I:.*]]: !llvm.i64, %[[J:.*]]: !llvm.i64) { +// BAREPTR-SAME: (%[[A:.*]]: !llvm.ptr, %[[I:.*]]: !llvm.i64, %[[J:.*]]: !llvm.i64) { func @static_load(%static : memref<10x42xf32>, %i : index, %j : index) { -// CHECK: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK-NEXT: %[[off:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 // CHECK-NEXT: %[[st0:.*]] = llvm.mlir.constant(42 : index) : !llvm.i64 // CHECK-NEXT: %[[offI:.*]] = llvm.mul %[[I]], %[[st0]] : !llvm.i64 @@ -277,10 +277,10 @@ // CHECK-NEXT: %[[st1:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 // CHECK-NEXT: %[[offJ:.*]] = llvm.mul %[[J]], %[[st1]] : !llvm.i64 // CHECK-NEXT: %[[off1:.*]] = llvm.add %[[off0]], %[[offJ]] : !llvm.i64 -// CHECK-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off1]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// CHECK-NEXT: llvm.load %[[addr]] : !llvm<"float*"> +// CHECK-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off1]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// CHECK-NEXT: llvm.load %[[addr]] : !llvm.ptr -// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // BAREPTR-NEXT: %[[off:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 // BAREPTR-NEXT: %[[st0:.*]] = llvm.mlir.constant(42 : index) : !llvm.i64 // BAREPTR-NEXT: %[[offI:.*]] = llvm.mul %[[I]], %[[st0]] : !llvm.i64 @@ -288,8 +288,8 @@ // BAREPTR-NEXT: %[[st1:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 // BAREPTR-NEXT: %[[offJ:.*]] = llvm.mul %[[J]], %[[st1]] : !llvm.i64 // BAREPTR-NEXT: %[[off1:.*]] = llvm.add %[[off0]], %[[offJ]] : !llvm.i64 -// BAREPTR-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off1]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// BAREPTR-NEXT: llvm.load %[[addr]] : !llvm<"float*"> +// BAREPTR-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off1]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// BAREPTR-NEXT: llvm.load %[[addr]] : !llvm.ptr %0 = load %static[%i, %j] : memref<10x42xf32> return } @@ -298,17 +298,17 @@ // CHECK-LABEL: func @zero_d_store // BAREPTR-LABEL: func @zero_d_store -// BAREPTR-SAME: (%[[A:.*]]: !llvm<"float*">, %[[val:.*]]: !llvm.float) +// BAREPTR-SAME: (%[[A:.*]]: !llvm.ptr, %[[val:.*]]: !llvm.float) func @zero_d_store(%arg0: memref, %arg1: f32) { -// CHECK: %[[ptr:.*]] = llvm.extractvalue %[[ld:.*]][1] : !llvm<"{ float*, float*, i64 }"> +// CHECK: %[[ptr:.*]] = llvm.extractvalue %[[ld:.*]][1] : !llvm.struct<(ptr, ptr, i64)> // CHECK-NEXT: %[[off:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// CHECK-NEXT: llvm.store %{{.*}}, %[[addr]] : !llvm<"float*"> +// CHECK-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// CHECK-NEXT: llvm.store %{{.*}}, %[[addr]] : !llvm.ptr -// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, float*, i64 }"> +// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64)> // BAREPTR-NEXT: %[[off:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// BAREPTR-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// BAREPTR-NEXT: llvm.store %[[val]], %[[addr]] : !llvm<"float*"> +// BAREPTR-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// BAREPTR-NEXT: llvm.store %[[val]], %[[addr]] : !llvm.ptr store %arg1, %arg0[] : memref return } @@ -316,8 +316,8 @@ // ----- // CHECK-LABEL: func @static_store -// CHECK-SAME: %[[ARG0:[a-zA-Z0-9]*]]: !llvm<"float*"> -// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm<"float*"> +// CHECK-SAME: %[[ARG0:[a-zA-Z0-9]*]]: !llvm.ptr +// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.ptr // CHECK-SAME: %[[ARG2:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[ARG3:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[ARG4:[a-zA-Z0-9]*]]: !llvm.i64 @@ -326,11 +326,11 @@ // CHECK-SAME: %[[I:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[J:[a-zA-Z0-9]*]]: !llvm.i64 // BAREPTR-LABEL: func @static_store -// BAREPTR-SAME: %[[A:.*]]: !llvm<"float*"> +// BAREPTR-SAME: %[[A:.*]]: !llvm.ptr // BAREPTR-SAME: %[[I:[a-zA-Z0-9]*]]: !llvm.i64 // BAREPTR-SAME: %[[J:[a-zA-Z0-9]*]]: !llvm.i64 func @static_store(%static : memref<10x42xf32>, %i : index, %j : index, %val : f32) { -// CHECK: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK-NEXT: %[[off:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 // CHECK-NEXT: %[[st0:.*]] = llvm.mlir.constant(42 : index) : !llvm.i64 // CHECK-NEXT: %[[offI:.*]] = llvm.mul %[[I]], %[[st0]] : !llvm.i64 @@ -338,10 +338,10 @@ // CHECK-NEXT: %[[st1:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 // CHECK-NEXT: %[[offJ:.*]] = llvm.mul %[[J]], %[[st1]] : !llvm.i64 // CHECK-NEXT: %[[off1:.*]] = llvm.add %[[off0]], %[[offJ]] : !llvm.i64 -// CHECK-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off1]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// CHECK-NEXT: llvm.store %{{.*}}, %[[addr]] : !llvm<"float*"> +// CHECK-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off1]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// CHECK-NEXT: llvm.store %{{.*}}, %[[addr]] : !llvm.ptr -// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // BAREPTR-NEXT: %[[off:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 // BAREPTR-NEXT: %[[st0:.*]] = llvm.mlir.constant(42 : index) : !llvm.i64 // BAREPTR-NEXT: %[[offI:.*]] = llvm.mul %[[I]], %[[st0]] : !llvm.i64 @@ -349,8 +349,8 @@ // BAREPTR-NEXT: %[[st1:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 // BAREPTR-NEXT: %[[offJ:.*]] = llvm.mul %[[J]], %[[st1]] : !llvm.i64 // BAREPTR-NEXT: %[[off1:.*]] = llvm.add %[[off0]], %[[offJ]] : !llvm.i64 -// BAREPTR-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off1]]] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> -// BAREPTR-NEXT: llvm.store %{{.*}}, %[[addr]] : !llvm<"float*"> +// BAREPTR-NEXT: %[[addr:.*]] = llvm.getelementptr %[[ptr]][%[[off1]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr +// BAREPTR-NEXT: llvm.store %{{.*}}, %[[addr]] : !llvm.ptr store %val, %static[%i, %j] : memref<10x42xf32> return } @@ -358,10 +358,10 @@ // ----- // CHECK-LABEL: func @static_memref_dim -// BAREPTR-LABEL: func @static_memref_dim(%{{.*}}: !llvm<"float*">) { +// BAREPTR-LABEL: func @static_memref_dim(%{{.*}}: !llvm.ptr) { func @static_memref_dim(%static : memref<42x32x15x13x27xf32>) { // CHECK: llvm.mlir.constant(42 : index) : !llvm.i64 -// BAREPTR: llvm.insertvalue %{{.*}}, %{{.*}}[4, 4] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> +// BAREPTR: llvm.insertvalue %{{.*}}, %{{.*}}[4, 4] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> // BAREPTR: llvm.mlir.constant(42 : index) : !llvm.i64 %c0 = constant 0 : index %0 = dim %static, %c0 : memref<42x32x15x13x27xf32> diff --git a/mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir b/mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir --- a/mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir +++ b/mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir @@ -68,11 +68,11 @@ // CHECK-LABEL: llvm.func @complex_numbers() // CHECK-NEXT: %[[REAL0:.*]] = llvm.mlir.constant(1.200000e+00 : f32) : !llvm.float // CHECK-NEXT: %[[IMAG0:.*]] = llvm.mlir.constant(3.400000e+00 : f32) : !llvm.float -// CHECK-NEXT: %[[CPLX0:.*]] = llvm.mlir.undef : !llvm<"{ float, float }"> -// CHECK-NEXT: %[[CPLX1:.*]] = llvm.insertvalue %[[REAL0]], %[[CPLX0]][0] : !llvm<"{ float, float }"> -// CHECK-NEXT: %[[CPLX2:.*]] = llvm.insertvalue %[[IMAG0]], %[[CPLX1]][1] : !llvm<"{ float, float }"> -// CHECK-NEXT: %[[REAL1:.*]] = llvm.extractvalue %[[CPLX2:.*]][0] : !llvm<"{ float, float }"> -// CHECK-NEXT: %[[IMAG1:.*]] = llvm.extractvalue %[[CPLX2:.*]][1] : !llvm<"{ float, float }"> +// CHECK-NEXT: %[[CPLX0:.*]] = llvm.mlir.undef : !llvm.struct<(float, float)> +// CHECK-NEXT: %[[CPLX1:.*]] = llvm.insertvalue %[[REAL0]], %[[CPLX0]][0] : !llvm.struct<(float, float)> +// CHECK-NEXT: %[[CPLX2:.*]] = llvm.insertvalue %[[IMAG0]], %[[CPLX1]][1] : !llvm.struct<(float, float)> +// CHECK-NEXT: %[[REAL1:.*]] = llvm.extractvalue %[[CPLX2:.*]][0] : !llvm.struct<(float, float)> +// CHECK-NEXT: %[[IMAG1:.*]] = llvm.extractvalue %[[CPLX2:.*]][1] : !llvm.struct<(float, float)> // CHECK-NEXT: llvm.return func @complex_numbers() { %real0 = constant 1.2 : f32 @@ -84,15 +84,15 @@ } // CHECK-LABEL: llvm.func @complex_addition() -// CHECK-DAG: %[[A_REAL:.*]] = llvm.extractvalue %[[A:.*]][0] : !llvm<"{ double, double }"> -// CHECK-DAG: %[[B_REAL:.*]] = llvm.extractvalue %[[B:.*]][0] : !llvm<"{ double, double }"> -// CHECK-DAG: %[[A_IMAG:.*]] = llvm.extractvalue %[[A]][1] : !llvm<"{ double, double }"> -// CHECK-DAG: %[[B_IMAG:.*]] = llvm.extractvalue %[[B]][1] : !llvm<"{ double, double }"> -// CHECK: %[[C0:.*]] = llvm.mlir.undef : !llvm<"{ double, double }"> +// CHECK-DAG: %[[A_REAL:.*]] = llvm.extractvalue %[[A:.*]][0] : !llvm.struct<(double, double)> +// CHECK-DAG: %[[B_REAL:.*]] = llvm.extractvalue %[[B:.*]][0] : !llvm.struct<(double, double)> +// CHECK-DAG: %[[A_IMAG:.*]] = llvm.extractvalue %[[A]][1] : !llvm.struct<(double, double)> +// CHECK-DAG: %[[B_IMAG:.*]] = llvm.extractvalue %[[B]][1] : !llvm.struct<(double, double)> +// CHECK: %[[C0:.*]] = llvm.mlir.undef : !llvm.struct<(double, double)> // CHECK-DAG: %[[C_REAL:.*]] = llvm.fadd %[[A_REAL]], %[[B_REAL]] : !llvm.double // CHECK-DAG: %[[C_IMAG:.*]] = llvm.fadd %[[A_IMAG]], %[[B_IMAG]] : !llvm.double -// CHECK: %[[C1:.*]] = llvm.insertvalue %[[C_REAL]], %[[C0]][0] : !llvm<"{ double, double }"> -// CHECK: %[[C2:.*]] = llvm.insertvalue %[[C_IMAG]], %[[C1]][1] : !llvm<"{ double, double }"> +// CHECK: %[[C1:.*]] = llvm.insertvalue %[[C_REAL]], %[[C0]][0] : !llvm.struct<(double, double)> +// CHECK: %[[C2:.*]] = llvm.insertvalue %[[C_IMAG]], %[[C1]][1] : !llvm.struct<(double, double)> func @complex_addition() { %a_re = constant 1.2 : f64 %a_im = constant 3.4 : f64 @@ -105,15 +105,15 @@ } // CHECK-LABEL: llvm.func @complex_substraction() -// CHECK-DAG: %[[A_REAL:.*]] = llvm.extractvalue %[[A:.*]][0] : !llvm<"{ double, double }"> -// CHECK-DAG: %[[B_REAL:.*]] = llvm.extractvalue %[[B:.*]][0] : !llvm<"{ double, double }"> -// CHECK-DAG: %[[A_IMAG:.*]] = llvm.extractvalue %[[A]][1] : !llvm<"{ double, double }"> -// CHECK-DAG: %[[B_IMAG:.*]] = llvm.extractvalue %[[B]][1] : !llvm<"{ double, double }"> -// CHECK: %[[C0:.*]] = llvm.mlir.undef : !llvm<"{ double, double }"> +// CHECK-DAG: %[[A_REAL:.*]] = llvm.extractvalue %[[A:.*]][0] : !llvm.struct<(double, double)> +// CHECK-DAG: %[[B_REAL:.*]] = llvm.extractvalue %[[B:.*]][0] : !llvm.struct<(double, double)> +// CHECK-DAG: %[[A_IMAG:.*]] = llvm.extractvalue %[[A]][1] : !llvm.struct<(double, double)> +// CHECK-DAG: %[[B_IMAG:.*]] = llvm.extractvalue %[[B]][1] : !llvm.struct<(double, double)> +// CHECK: %[[C0:.*]] = llvm.mlir.undef : !llvm.struct<(double, double)> // CHECK-DAG: %[[C_REAL:.*]] = llvm.fsub %[[A_REAL]], %[[B_REAL]] : !llvm.double // CHECK-DAG: %[[C_IMAG:.*]] = llvm.fsub %[[A_IMAG]], %[[B_IMAG]] : !llvm.double -// CHECK: %[[C1:.*]] = llvm.insertvalue %[[C_REAL]], %[[C0]][0] : !llvm<"{ double, double }"> -// CHECK: %[[C2:.*]] = llvm.insertvalue %[[C_IMAG]], %[[C1]][1] : !llvm<"{ double, double }"> +// CHECK: %[[C1:.*]] = llvm.insertvalue %[[C_REAL]], %[[C0]][0] : !llvm.struct<(double, double)> +// CHECK: %[[C2:.*]] = llvm.insertvalue %[[C_IMAG]], %[[C1]][1] : !llvm.struct<(double, double)> func @complex_substraction() { %a_re = constant 1.2 : f64 %a_im = constant 3.4 : f64 @@ -427,39 +427,39 @@ func @get_i64() -> (i64) // CHECK-LABEL: func @get_f32() -> !llvm.float func @get_f32() -> (f32) -// CHECK-LABEL: func @get_c16() -> !llvm<"{ half, half }"> +// CHECK-LABEL: func @get_c16() -> !llvm.struct<(half, half)> func @get_c16() -> (complex) -// CHECK-LABEL: func @get_c32() -> !llvm<"{ float, float }"> +// CHECK-LABEL: func @get_c32() -> !llvm.struct<(float, float)> func @get_c32() -> (complex) -// CHECK-LABEL: func @get_c64() -> !llvm<"{ double, double }"> +// CHECK-LABEL: func @get_c64() -> !llvm.struct<(double, double)> func @get_c64() -> (complex) -// CHECK-LABEL: func @get_memref() -> !llvm<"{ float*, float*, i64, [4 x i64], [4 x i64] }"> -// CHECK32-LABEL: func @get_memref() -> !llvm<"{ float*, float*, i32, [4 x i32], [4 x i32] }"> +// CHECK-LABEL: func @get_memref() -> !llvm.struct<(ptr, ptr, i64, array<4 x i64>, array<4 x i64>)> +// CHECK32-LABEL: func @get_memref() -> !llvm.struct<(ptr, ptr, i32, array<4 x i32>, array<4 x i32>)> func @get_memref() -> (memref<42x?x10x?xf32>) -// CHECK-LABEL: func @multireturn() -> !llvm<"{ i64, float, { float*, float*, i64, [4 x i64], [4 x i64] } }"> { -// CHECK32-LABEL: func @multireturn() -> !llvm<"{ i64, float, { float*, float*, i32, [4 x i32], [4 x i32] } }"> { +// CHECK-LABEL: func @multireturn() -> !llvm.struct<(i64, float, struct<(ptr, ptr, i64, array<4 x i64>, array<4 x i64>)>)> { +// CHECK32-LABEL: func @multireturn() -> !llvm.struct<(i64, float, struct<(ptr, ptr, i32, array<4 x i32>, array<4 x i32>)>)> { func @multireturn() -> (i64, f32, memref<42x?x10x?xf32>) { ^bb0: // CHECK-NEXT: {{.*}} = llvm.call @get_i64() : () -> !llvm.i64 // CHECK-NEXT: {{.*}} = llvm.call @get_f32() : () -> !llvm.float -// CHECK-NEXT: {{.*}} = llvm.call @get_memref() : () -> !llvm<"{ float*, float*, i64, [4 x i64], [4 x i64] }"> +// CHECK-NEXT: {{.*}} = llvm.call @get_memref() : () -> !llvm.struct<(ptr, ptr, i64, array<4 x i64>, array<4 x i64>)> // CHECK32-NEXT: {{.*}} = llvm.call @get_i64() : () -> !llvm.i64 // CHECK32-NEXT: {{.*}} = llvm.call @get_f32() : () -> !llvm.float -// CHECK32-NEXT: {{.*}} = llvm.call @get_memref() : () -> !llvm<"{ float*, float*, i32, [4 x i32], [4 x i32] }"> +// CHECK32-NEXT: {{.*}} = llvm.call @get_memref() : () -> !llvm.struct<(ptr, ptr, i32, array<4 x i32>, array<4 x i32>)> %0 = call @get_i64() : () -> (i64) %1 = call @get_f32() : () -> (f32) %2 = call @get_memref() : () -> (memref<42x?x10x?xf32>) -// CHECK-NEXT: {{.*}} = llvm.mlir.undef : !llvm<"{ i64, float, { float*, float*, i64, [4 x i64], [4 x i64] } }"> -// CHECK-NEXT: {{.*}} = llvm.insertvalue {{.*}}, {{.*}}[0] : !llvm<"{ i64, float, { float*, float*, i64, [4 x i64], [4 x i64] } }"> -// CHECK-NEXT: {{.*}} = llvm.insertvalue {{.*}}, {{.*}}[1] : !llvm<"{ i64, float, { float*, float*, i64, [4 x i64], [4 x i64] } }"> -// CHECK-NEXT: {{.*}} = llvm.insertvalue {{.*}}, {{.*}}[2] : !llvm<"{ i64, float, { float*, float*, i64, [4 x i64], [4 x i64] } }"> -// CHECK-NEXT: llvm.return {{.*}} : !llvm<"{ i64, float, { float*, float*, i64, [4 x i64], [4 x i64] } }"> -// CHECK32-NEXT: {{.*}} = llvm.mlir.undef : !llvm<"{ i64, float, { float*, float*, i32, [4 x i32], [4 x i32] } }"> -// CHECK32-NEXT: {{.*}} = llvm.insertvalue {{.*}}, {{.*}}[0] : !llvm<"{ i64, float, { float*, float*, i32, [4 x i32], [4 x i32] } }"> -// CHECK32-NEXT: {{.*}} = llvm.insertvalue {{.*}}, {{.*}}[1] : !llvm<"{ i64, float, { float*, float*, i32, [4 x i32], [4 x i32] } }"> -// CHECK32-NEXT: {{.*}} = llvm.insertvalue {{.*}}, {{.*}}[2] : !llvm<"{ i64, float, { float*, float*, i32, [4 x i32], [4 x i32] } }"> -// CHECK32-NEXT: llvm.return {{.*}} : !llvm<"{ i64, float, { float*, float*, i32, [4 x i32], [4 x i32] } }"> +// CHECK-NEXT: {{.*}} = llvm.mlir.undef : !llvm.struct<(i64, float, struct<(ptr, ptr, i64, array<4 x i64>, array<4 x i64>)>)> +// CHECK-NEXT: {{.*}} = llvm.insertvalue {{.*}}, {{.*}}[0] : !llvm.struct<(i64, float, struct<(ptr, ptr, i64, array<4 x i64>, array<4 x i64>)>)> +// CHECK-NEXT: {{.*}} = llvm.insertvalue {{.*}}, {{.*}}[1] : !llvm.struct<(i64, float, struct<(ptr, ptr, i64, array<4 x i64>, array<4 x i64>)>)> +// CHECK-NEXT: {{.*}} = llvm.insertvalue {{.*}}, {{.*}}[2] : !llvm.struct<(i64, float, struct<(ptr, ptr, i64, array<4 x i64>, array<4 x i64>)>)> +// CHECK-NEXT: llvm.return {{.*}} : !llvm.struct<(i64, float, struct<(ptr, ptr, i64, array<4 x i64>, array<4 x i64>)>)> +// CHECK32-NEXT: {{.*}} = llvm.mlir.undef : !llvm.struct<(i64, float, struct<(ptr, ptr, i32, array<4 x i32>, array<4 x i32>)>)> +// CHECK32-NEXT: {{.*}} = llvm.insertvalue {{.*}}, {{.*}}[0] : !llvm.struct<(i64, float, struct<(ptr, ptr, i32, array<4 x i32>, array<4 x i32>)>)> +// CHECK32-NEXT: {{.*}} = llvm.insertvalue {{.*}}, {{.*}}[1] : !llvm.struct<(i64, float, struct<(ptr, ptr, i32, array<4 x i32>, array<4 x i32>)>)> +// CHECK32-NEXT: {{.*}} = llvm.insertvalue {{.*}}, {{.*}}[2] : !llvm.struct<(i64, float, struct<(ptr, ptr, i32, array<4 x i32>, array<4 x i32>)>)> +// CHECK32-NEXT: llvm.return {{.*}} : !llvm.struct<(i64, float, struct<(ptr, ptr, i32, array<4 x i32>, array<4 x i32>)>)> return %0, %1, %2 : i64, f32, memref<42x?x10x?xf32> } @@ -468,14 +468,14 @@ // CHECK32-LABEL: func @multireturn_caller() { func @multireturn_caller() { ^bb0: -// CHECK-NEXT: {{.*}} = llvm.call @multireturn() : () -> !llvm<"{ i64, float, { float*, float*, i64, [4 x i64], [4 x i64] } }"> -// CHECK-NEXT: {{.*}} = llvm.extractvalue {{.*}}[0] : !llvm<"{ i64, float, { float*, float*, i64, [4 x i64], [4 x i64] } }"> -// CHECK-NEXT: {{.*}} = llvm.extractvalue {{.*}}[1] : !llvm<"{ i64, float, { float*, float*, i64, [4 x i64], [4 x i64] } }"> -// CHECK-NEXT: {{.*}} = llvm.extractvalue {{.*}}[2] : !llvm<"{ i64, float, { float*, float*, i64, [4 x i64], [4 x i64] } }"> -// CHECK32-NEXT: {{.*}} = llvm.call @multireturn() : () -> !llvm<"{ i64, float, { float*, float*, i32, [4 x i32], [4 x i32] } }"> -// CHECK32-NEXT: {{.*}} = llvm.extractvalue {{.*}}[0] : !llvm<"{ i64, float, { float*, float*, i32, [4 x i32], [4 x i32] } }"> -// CHECK32-NEXT: {{.*}} = llvm.extractvalue {{.*}}[1] : !llvm<"{ i64, float, { float*, float*, i32, [4 x i32], [4 x i32] } }"> -// CHECK32-NEXT: {{.*}} = llvm.extractvalue {{.*}}[2] : !llvm<"{ i64, float, { float*, float*, i32, [4 x i32], [4 x i32] } }"> +// CHECK-NEXT: {{.*}} = llvm.call @multireturn() : () -> !llvm.struct<(i64, float, struct<(ptr, ptr, i64, array<4 x i64>, array<4 x i64>)>)> +// CHECK-NEXT: {{.*}} = llvm.extractvalue {{.*}}[0] : !llvm.struct<(i64, float, struct<(ptr, ptr, i64, array<4 x i64>, array<4 x i64>)>)> +// CHECK-NEXT: {{.*}} = llvm.extractvalue {{.*}}[1] : !llvm.struct<(i64, float, struct<(ptr, ptr, i64, array<4 x i64>, array<4 x i64>)>)> +// CHECK-NEXT: {{.*}} = llvm.extractvalue {{.*}}[2] : !llvm.struct<(i64, float, struct<(ptr, ptr, i64, array<4 x i64>, array<4 x i64>)>)> +// CHECK32-NEXT: {{.*}} = llvm.call @multireturn() : () -> !llvm.struct<(i64, float, struct<(ptr, ptr, i32, array<4 x i32>, array<4 x i32>)>)> +// CHECK32-NEXT: {{.*}} = llvm.extractvalue {{.*}}[0] : !llvm.struct<(i64, float, struct<(ptr, ptr, i32, array<4 x i32>, array<4 x i32>)>)> +// CHECK32-NEXT: {{.*}} = llvm.extractvalue {{.*}}[1] : !llvm.struct<(i64, float, struct<(ptr, ptr, i32, array<4 x i32>, array<4 x i32>)>)> +// CHECK32-NEXT: {{.*}} = llvm.extractvalue {{.*}}[2] : !llvm.struct<(i64, float, struct<(ptr, ptr, i32, array<4 x i32>, array<4 x i32>)>)> %0:3 = call @multireturn() : () -> (i64, f32, memref<42x?x10x?xf32>) %1 = constant 42 : i64 // CHECK: {{.*}} = llvm.add {{.*}}, {{.*}} : !llvm.i64 @@ -487,35 +487,35 @@ return } -// CHECK-LABEL: func @vector_ops(%arg0: !llvm<"<4 x float>">, %arg1: !llvm<"<4 x i1>">, %arg2: !llvm<"<4 x i64>">, %arg3: !llvm<"<4 x i64>">) -> !llvm<"<4 x float>"> { +// CHECK-LABEL: func @vector_ops(%arg0: !llvm.vec<4 x float>, %arg1: !llvm.vec<4 x i1>, %arg2: !llvm.vec<4 x i64>, %arg3: !llvm.vec<4 x i64>) -> !llvm.vec<4 x float> { func @vector_ops(%arg0: vector<4xf32>, %arg1: vector<4xi1>, %arg2: vector<4xi64>, %arg3: vector<4xi64>) -> vector<4xf32> { -// CHECK-NEXT: %0 = llvm.mlir.constant(dense<4.200000e+01> : vector<4xf32>) : !llvm<"<4 x float>"> +// CHECK-NEXT: %0 = llvm.mlir.constant(dense<4.200000e+01> : vector<4xf32>) : !llvm.vec<4 x float> %0 = constant dense<42.> : vector<4xf32> -// CHECK-NEXT: %1 = llvm.fadd %arg0, %0 : !llvm<"<4 x float>"> +// CHECK-NEXT: %1 = llvm.fadd %arg0, %0 : !llvm.vec<4 x float> %1 = addf %arg0, %0 : vector<4xf32> -// CHECK-NEXT: %2 = llvm.sdiv %arg2, %arg2 : !llvm<"<4 x i64>"> +// CHECK-NEXT: %2 = llvm.sdiv %arg2, %arg2 : !llvm.vec<4 x i64> %3 = divi_signed %arg2, %arg2 : vector<4xi64> -// CHECK-NEXT: %3 = llvm.udiv %arg2, %arg2 : !llvm<"<4 x i64>"> +// CHECK-NEXT: %3 = llvm.udiv %arg2, %arg2 : !llvm.vec<4 x i64> %4 = divi_unsigned %arg2, %arg2 : vector<4xi64> -// CHECK-NEXT: %4 = llvm.srem %arg2, %arg2 : !llvm<"<4 x i64>"> +// CHECK-NEXT: %4 = llvm.srem %arg2, %arg2 : !llvm.vec<4 x i64> %5 = remi_signed %arg2, %arg2 : vector<4xi64> -// CHECK-NEXT: %5 = llvm.urem %arg2, %arg2 : !llvm<"<4 x i64>"> +// CHECK-NEXT: %5 = llvm.urem %arg2, %arg2 : !llvm.vec<4 x i64> %6 = remi_unsigned %arg2, %arg2 : vector<4xi64> -// CHECK-NEXT: %6 = llvm.fdiv %arg0, %0 : !llvm<"<4 x float>"> +// CHECK-NEXT: %6 = llvm.fdiv %arg0, %0 : !llvm.vec<4 x float> %7 = divf %arg0, %0 : vector<4xf32> -// CHECK-NEXT: %7 = llvm.frem %arg0, %0 : !llvm<"<4 x float>"> +// CHECK-NEXT: %7 = llvm.frem %arg0, %0 : !llvm.vec<4 x float> %8 = remf %arg0, %0 : vector<4xf32> -// CHECK-NEXT: %8 = llvm.and %arg2, %arg3 : !llvm<"<4 x i64>"> +// CHECK-NEXT: %8 = llvm.and %arg2, %arg3 : !llvm.vec<4 x i64> %9 = and %arg2, %arg3 : vector<4xi64> -// CHECK-NEXT: %9 = llvm.or %arg2, %arg3 : !llvm<"<4 x i64>"> +// CHECK-NEXT: %9 = llvm.or %arg2, %arg3 : !llvm.vec<4 x i64> %10 = or %arg2, %arg3 : vector<4xi64> -// CHECK-NEXT: %10 = llvm.xor %arg2, %arg3 : !llvm<"<4 x i64>"> +// CHECK-NEXT: %10 = llvm.xor %arg2, %arg3 : !llvm.vec<4 x i64> %11 = xor %arg2, %arg3 : vector<4xi64> -// CHECK-NEXT: %11 = llvm.shl %arg2, %arg2 : !llvm<"<4 x i64>"> +// CHECK-NEXT: %11 = llvm.shl %arg2, %arg2 : !llvm.vec<4 x i64> %12 = shift_left %arg2, %arg2 : vector<4xi64> -// CHECK-NEXT: %12 = llvm.ashr %arg2, %arg2 : !llvm<"<4 x i64>"> +// CHECK-NEXT: %12 = llvm.ashr %arg2, %arg2 : !llvm.vec<4 x i64> %13 = shift_right_signed %arg2, %arg2 : vector<4xi64> -// CHECK-NEXT: %13 = llvm.lshr %arg2, %arg2 : !llvm<"<4 x i64>"> +// CHECK-NEXT: %13 = llvm.lshr %arg2, %arg2 : !llvm.vec<4 x i64> %14 = shift_right_unsigned %arg2, %arg2 : vector<4xi64> return %1 : vector<4xf32> } @@ -583,13 +583,13 @@ // Checking conversion of integer types to floating point. // CHECK-LABEL: @sitofp func @sitofp(%arg0 : i32, %arg1 : i64) { -// CHECK-NEXT: = llvm.sitofp {{.*}} : !llvm.i{{.*}} to !llvm.float +// CHECK-NEXT: = llvm.sitofp {{.*}} : !llvm.i32 to !llvm.float %0 = sitofp %arg0: i32 to f32 -// CHECK-NEXT: = llvm.sitofp {{.*}} : !llvm.i{{.*}} to !llvm.double +// CHECK-NEXT: = llvm.sitofp {{.*}} : !llvm.i32 to !llvm.double %1 = sitofp %arg0: i32 to f64 -// CHECK-NEXT: = llvm.sitofp {{.*}} : !llvm.i{{.*}} to !llvm.float +// CHECK-NEXT: = llvm.sitofp {{.*}} : !llvm.i64 to !llvm.float %2 = sitofp %arg1: i64 to f32 -// CHECK-NEXT: = llvm.sitofp {{.*}} : !llvm.i{{.*}} to !llvm.double +// CHECK-NEXT: = llvm.sitofp {{.*}} : !llvm.i64 to !llvm.double %3 = sitofp %arg1: i64 to f64 return } @@ -609,11 +609,11 @@ // Checking conversion of integer types to floating point. // CHECK-LABEL: @fpext func @fpext_vector(%arg0 : vector<2xf16>, %arg1 : vector<2xf32>) { -// CHECK-NEXT: = llvm.fpext {{.*}} : !llvm<"<2 x half>"> to !llvm<"<2 x float>"> +// CHECK-NEXT: = llvm.fpext {{.*}} : !llvm.vec<2 x half> to !llvm.vec<2 x float> %0 = fpext %arg0: vector<2xf16> to vector<2xf32> -// CHECK-NEXT: = llvm.fpext {{.*}} : !llvm<"<2 x half>"> to !llvm<"<2 x double>"> +// CHECK-NEXT: = llvm.fpext {{.*}} : !llvm.vec<2 x half> to !llvm.vec<2 x double> %1 = fpext %arg0: vector<2xf16> to vector<2xf64> -// CHECK-NEXT: = llvm.fpext {{.*}} : !llvm<"<2 x float>"> to !llvm<"<2 x double>"> +// CHECK-NEXT: = llvm.fpext {{.*}} : !llvm.vec<2 x float> to !llvm.vec<2 x double> %2 = fpext %arg1: vector<2xf32> to vector<2xf64> return } @@ -647,11 +647,11 @@ // Checking conversion of integer types to floating point. // CHECK-LABEL: @fptrunc func @fptrunc_vector(%arg0 : vector<2xf32>, %arg1 : vector<2xf64>) { -// CHECK-NEXT: = llvm.fptrunc {{.*}} : !llvm<"<2 x float>"> to !llvm<"<2 x half>"> +// CHECK-NEXT: = llvm.fptrunc {{.*}} : !llvm.vec<2 x float> to !llvm.vec<2 x half> %0 = fptrunc %arg0: vector<2xf32> to vector<2xf16> -// CHECK-NEXT: = llvm.fptrunc {{.*}} : !llvm<"<2 x double>"> to !llvm<"<2 x half>"> +// CHECK-NEXT: = llvm.fptrunc {{.*}} : !llvm.vec<2 x double> to !llvm.vec<2 x half> %1 = fptrunc %arg1: vector<2xf64> to vector<2xf16> -// CHECK-NEXT: = llvm.fptrunc {{.*}} : !llvm<"<2 x double>"> to !llvm<"<2 x float>"> +// CHECK-NEXT: = llvm.fptrunc {{.*}} : !llvm.vec<2 x double> to !llvm.vec<2 x float> %2 = fptrunc %arg1: vector<2xf64> to vector<2xf32> return } @@ -731,110 +731,110 @@ %0 = addf %arg0, %arg0 : vector<2x2x2xf32> return %0 : vector<2x2x2xf32> -// CHECK-NEXT: llvm.mlir.undef : !llvm<"[2 x [2 x <2 x float>]]"> +// CHECK-NEXT: llvm.mlir.undef : !llvm.array<2 x array<2 x vec<2 x float>>> // This block appears 2x2 times -// CHECK-NEXT: llvm.extractvalue %{{.*}}[0, 0] : !llvm<"[2 x [2 x <2 x float>]]"> -// CHECK-NEXT: llvm.extractvalue %{{.*}}[0, 0] : !llvm<"[2 x [2 x <2 x float>]]"> -// CHECK-NEXT: llvm.fadd %{{.*}} : !llvm<"<2 x float>"> -// CHECK-NEXT: llvm.insertvalue %{{.*}}[0, 0] : !llvm<"[2 x [2 x <2 x float>]]"> +// CHECK-NEXT: llvm.extractvalue %{{.*}}[0, 0] : !llvm.array<2 x array<2 x vec<2 x float>>> +// CHECK-NEXT: llvm.extractvalue %{{.*}}[0, 0] : !llvm.array<2 x array<2 x vec<2 x float>>> +// CHECK-NEXT: llvm.fadd %{{.*}} : !llvm.vec<2 x float> +// CHECK-NEXT: llvm.insertvalue %{{.*}}[0, 0] : !llvm.array<2 x array<2 x vec<2 x float>>> // We check the proper indexing of extract/insert in the remaining 3 positions. -// CHECK: llvm.extractvalue %{{.*}}[0, 1] : !llvm<"[2 x [2 x <2 x float>]]"> -// CHECK: llvm.insertvalue %{{.*}}[0, 1] : !llvm<"[2 x [2 x <2 x float>]]"> -// CHECK: llvm.extractvalue %{{.*}}[1, 0] : !llvm<"[2 x [2 x <2 x float>]]"> -// CHECK: llvm.insertvalue %{{.*}}[1, 0] : !llvm<"[2 x [2 x <2 x float>]]"> -// CHECK: llvm.extractvalue %{{.*}}[1, 1] : !llvm<"[2 x [2 x <2 x float>]]"> -// CHECK: llvm.insertvalue %{{.*}}[1, 1] : !llvm<"[2 x [2 x <2 x float>]]"> +// CHECK: llvm.extractvalue %{{.*}}[0, 1] : !llvm.array<2 x array<2 x vec<2 x float>>> +// CHECK: llvm.insertvalue %{{.*}}[0, 1] : !llvm.array<2 x array<2 x vec<2 x float>>> +// CHECK: llvm.extractvalue %{{.*}}[1, 0] : !llvm.array<2 x array<2 x vec<2 x float>>> +// CHECK: llvm.insertvalue %{{.*}}[1, 0] : !llvm.array<2 x array<2 x vec<2 x float>>> +// CHECK: llvm.extractvalue %{{.*}}[1, 1] : !llvm.array<2 x array<2 x vec<2 x float>>> +// CHECK: llvm.insertvalue %{{.*}}[1, 1] : !llvm.array<2 x array<2 x vec<2 x float>>> // And we're done // CHECK-NEXT: return } // CHECK-LABEL: @splat -// CHECK-SAME: %[[A:arg[0-9]+]]: !llvm<"<4 x float>"> +// CHECK-SAME: %[[A:arg[0-9]+]]: !llvm.vec<4 x float> // CHECK-SAME: %[[ELT:arg[0-9]+]]: !llvm.float func @splat(%a: vector<4xf32>, %b: f32) -> vector<4xf32> { %vb = splat %b : vector<4xf32> %r = mulf %a, %vb : vector<4xf32> return %r : vector<4xf32> } -// CHECK-NEXT: %[[UNDEF:[0-9]+]] = llvm.mlir.undef : !llvm<"<4 x float>"> +// CHECK-NEXT: %[[UNDEF:[0-9]+]] = llvm.mlir.undef : !llvm.vec<4 x float> // CHECK-NEXT: %[[ZERO:[0-9]+]] = llvm.mlir.constant(0 : i32) : !llvm.i32 -// CHECK-NEXT: %[[V:[0-9]+]] = llvm.insertelement %[[ELT]], %[[UNDEF]][%[[ZERO]] : !llvm.i32] : !llvm<"<4 x float>"> +// CHECK-NEXT: %[[V:[0-9]+]] = llvm.insertelement %[[ELT]], %[[UNDEF]][%[[ZERO]] : !llvm.i32] : !llvm.vec<4 x float> // CHECK-NEXT: %[[SPLAT:[0-9]+]] = llvm.shufflevector %[[V]], %[[UNDEF]] [0 : i32, 0 : i32, 0 : i32, 0 : i32] -// CHECK-NEXT: %[[SCALE:[0-9]+]] = llvm.fmul %[[A]], %[[SPLAT]] : !llvm<"<4 x float>"> -// CHECK-NEXT: llvm.return %[[SCALE]] : !llvm<"<4 x float>"> +// CHECK-NEXT: %[[SCALE:[0-9]+]] = llvm.fmul %[[A]], %[[SPLAT]] : !llvm.vec<4 x float> +// CHECK-NEXT: llvm.return %[[SCALE]] : !llvm.vec<4 x float> // CHECK-LABEL: func @view( // CHECK: %[[ARG0:.*]]: !llvm.i64, %[[ARG1:.*]]: !llvm.i64, %[[ARG2:.*]]: !llvm.i64 func @view(%arg0 : index, %arg1 : index, %arg2 : index) { // CHECK: llvm.mlir.constant(2048 : index) : !llvm.i64 - // CHECK: llvm.mlir.undef : !llvm<"{ i8*, i8*, i64, [1 x i64], [1 x i64] }"> + // CHECK: llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> %0 = alloc() : memref<2048xi8> // Test two dynamic sizes. - // CHECK: llvm.mlir.undef : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[BASE_PTR:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm<"{ i8*, i8*, i64, [1 x i64], [1 x i64] }"> - // CHECK: %[[SHIFTED_BASE_PTR:.*]] = llvm.getelementptr %[[BASE_PTR]][%[[ARG2]]] : (!llvm<"i8*">, !llvm.i64) -> !llvm<"i8*"> - // CHECK: %[[CAST_SHIFTED_BASE_PTR:.*]] = llvm.bitcast %[[SHIFTED_BASE_PTR]] : !llvm<"i8*"> to !llvm<"float*"> - // CHECK: llvm.insertvalue %[[CAST_SHIFTED_BASE_PTR]], %{{.*}}[1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[BASE_PTR:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + // CHECK: %[[SHIFTED_BASE_PTR:.*]] = llvm.getelementptr %[[BASE_PTR]][%[[ARG2]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + // CHECK: %[[CAST_SHIFTED_BASE_PTR:.*]] = llvm.bitcast %[[SHIFTED_BASE_PTR]] : !llvm.ptr to !llvm.ptr + // CHECK: llvm.insertvalue %[[CAST_SHIFTED_BASE_PTR]], %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[C0:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 - // CHECK: llvm.insertvalue %[[C0]], %{{.*}}[2] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: llvm.insertvalue %[[ARG1]], %{{.*}}[3, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: llvm.insertvalue %[[C0]], %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: llvm.insertvalue %[[ARG1]], %{{.*}}[3, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: llvm.mlir.constant(1 : index) : !llvm.i64 - // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: llvm.insertvalue %[[ARG0]], %{{.*}}[3, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: llvm.insertvalue %[[ARG0]], %{{.*}}[3, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: llvm.mul %{{.*}}, %[[ARG1]] - // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> %1 = view %0[%arg2][%arg0, %arg1] : memref<2048xi8> to memref // Test one dynamic size. - // CHECK: llvm.mlir.undef : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[BASE_PTR_2:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm<"{ i8*, i8*, i64, [1 x i64], [1 x i64] }"> - // CHECK: %[[SHIFTED_BASE_PTR_2:.*]] = llvm.getelementptr %[[BASE_PTR_2]][%[[ARG2]]] : (!llvm<"i8*">, !llvm.i64) -> !llvm<"i8*"> - // CHECK: %[[CAST_SHIFTED_BASE_PTR_2:.*]] = llvm.bitcast %[[SHIFTED_BASE_PTR_2]] : !llvm<"i8*"> to !llvm<"float*"> - // CHECK: llvm.insertvalue %[[CAST_SHIFTED_BASE_PTR_2]], %{{.*}}[1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[BASE_PTR_2:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + // CHECK: %[[SHIFTED_BASE_PTR_2:.*]] = llvm.getelementptr %[[BASE_PTR_2]][%[[ARG2]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + // CHECK: %[[CAST_SHIFTED_BASE_PTR_2:.*]] = llvm.bitcast %[[SHIFTED_BASE_PTR_2]] : !llvm.ptr to !llvm.ptr + // CHECK: llvm.insertvalue %[[CAST_SHIFTED_BASE_PTR_2]], %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[C0_2:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 - // CHECK: llvm.insertvalue %[[C0_2]], %{{.*}}[2] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: llvm.insertvalue %[[ARG1]], %{{.*}}[3, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: llvm.insertvalue %[[C0_2]], %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: llvm.insertvalue %[[ARG1]], %{{.*}}[3, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: llvm.mlir.constant(1 : index) : !llvm.i64 - // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: llvm.mlir.constant(4 : index) : !llvm.i64 - // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: llvm.mul %{{.*}}, %[[ARG1]] - // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> %3 = view %0[%arg2][%arg1] : memref<2048xi8> to memref<4x?xf32> // Test static sizes. - // CHECK: llvm.mlir.undef : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[BASE_PTR_3:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm<"{ i8*, i8*, i64, [1 x i64], [1 x i64] }"> - // CHECK: %[[SHIFTED_BASE_PTR_3:.*]] = llvm.getelementptr %[[BASE_PTR_3]][%[[ARG2]]] : (!llvm<"i8*">, !llvm.i64) -> !llvm<"i8*"> - // CHECK: %[[CAST_SHIFTED_BASE_PTR_3:.*]] = llvm.bitcast %[[SHIFTED_BASE_PTR_3]] : !llvm<"i8*"> to !llvm<"float*"> - // CHECK: llvm.insertvalue %[[CAST_SHIFTED_BASE_PTR_3]], %{{.*}}[1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[BASE_PTR_3:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + // CHECK: %[[SHIFTED_BASE_PTR_3:.*]] = llvm.getelementptr %[[BASE_PTR_3]][%[[ARG2]]] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + // CHECK: %[[CAST_SHIFTED_BASE_PTR_3:.*]] = llvm.bitcast %[[SHIFTED_BASE_PTR_3]] : !llvm.ptr to !llvm.ptr + // CHECK: llvm.insertvalue %[[CAST_SHIFTED_BASE_PTR_3]], %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[C0_3:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 - // CHECK: llvm.insertvalue %[[C0_3]], %{{.*}}[2] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: llvm.insertvalue %[[C0_3]], %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: llvm.mlir.constant(4 : index) : !llvm.i64 - // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: llvm.mlir.constant(1 : index) : !llvm.i64 - // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: llvm.mlir.constant(64 : index) : !llvm.i64 - // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: llvm.mlir.constant(4 : index) : !llvm.i64 - // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> %5 = view %0[%arg2][] : memref<2048xi8> to memref<64x4xf32> return } // CHECK-LABEL: func @subview( -// CHECK-COUNT-2: !llvm<"float*">, +// CHECK-COUNT-2: !llvm.ptr, // CHECK-COUNT-5: {{%[a-zA-Z0-9]*}}: !llvm.i64, // CHECK: %[[ARG0:[a-zA-Z0-9]*]]: !llvm.i64, // CHECK: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.i64, // CHECK: %[[ARG2:.*]]: !llvm.i64) // CHECK32-LABEL: func @subview( -// CHECK32-COUNT-2: !llvm<"float*">, +// CHECK32-COUNT-2: !llvm.ptr, // CHECK32-COUNT-5: {{%[a-zA-Z0-9]*}}: !llvm.i32, // CHECK32: %[[ARG0:[a-zA-Z0-9]*]]: !llvm.i32, // CHECK32: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.i32, @@ -844,42 +844,42 @@ // CHECK: %[[MEMREF:.*]] = llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] // CHECK32: %[[MEMREF:.*]] = llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] - // CHECK: %[[DESC:.*]] = llvm.mlir.undef : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm<"float*"> to !llvm<"float*"> - // CHECK: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm<"float*"> to !llvm<"float*"> - // CHECK: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: %[[DESC:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[OFFINC:.*]] = llvm.mul %[[ARG0]], %[[STRIDE0]] : !llvm.i64 // CHECK: %[[OFF1:.*]] = llvm.add %[[OFF]], %[[OFFINC]] : !llvm.i64 // CHECK: %[[OFFINC1:.*]] = llvm.mul %[[ARG1]], %[[STRIDE1]] : !llvm.i64 // CHECK: %[[OFF2:.*]] = llvm.add %[[OFF1]], %[[OFFINC1]] : !llvm.i64 - // CHECK: %[[DESC2:.*]] = llvm.insertvalue %[[OFF2]], %[[DESC1]][2] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[DESC3:.*]] = llvm.insertvalue %[[ARG1]], %[[DESC2]][3, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: %[[DESC2:.*]] = llvm.insertvalue %[[OFF2]], %[[DESC1]][2] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[DESC3:.*]] = llvm.insertvalue %[[ARG1]], %[[DESC2]][3, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[DESCSTRIDE1:.*]] = llvm.mul %[[ARG1]], %[[STRIDE1]] : !llvm.i64 - // CHECK: %[[DESC4:.*]] = llvm.insertvalue %[[DESCSTRIDE1]], %[[DESC3]][4, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[DESC5:.*]] = llvm.insertvalue %[[ARG0]], %[[DESC4]][3, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: %[[DESC4:.*]] = llvm.insertvalue %[[DESCSTRIDE1]], %[[DESC3]][4, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[DESC5:.*]] = llvm.insertvalue %[[ARG0]], %[[DESC4]][3, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[DESCSTRIDE0:.*]] = llvm.mul %[[ARG0]], %[[STRIDE0]] : !llvm.i64 - // CHECK: llvm.insertvalue %[[DESCSTRIDE0]], %[[DESC5]][4, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK32: %[[DESC:.*]] = llvm.mlir.undef : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm<"float*"> to !llvm<"float*"> - // CHECK32: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm<"float*"> to !llvm<"float*"> - // CHECK32: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK: llvm.insertvalue %[[DESCSTRIDE0]], %[[DESC5]][4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK32: %[[DESC:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK32: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK32: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[OFFINC:.*]] = llvm.mul %[[ARG0]], %[[STRIDE0]] : !llvm.i32 // CHECK32: %[[OFF1:.*]] = llvm.add %[[OFF]], %[[OFFINC]] : !llvm.i32 // CHECK32: %[[OFFINC1:.*]] = llvm.mul %[[ARG1]], %[[STRIDE1]] : !llvm.i32 // CHECK32: %[[OFF2:.*]] = llvm.add %[[OFF1]], %[[OFFINC1]] : !llvm.i32 - // CHECK32: %[[DESC2:.*]] = llvm.insertvalue %[[OFF2]], %[[DESC1]][2] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[DESC3:.*]] = llvm.insertvalue %[[ARG1]], %[[DESC2]][3, 1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC2:.*]] = llvm.insertvalue %[[OFF2]], %[[DESC1]][2] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[DESC3:.*]] = llvm.insertvalue %[[ARG1]], %[[DESC2]][3, 1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[DESCSTRIDE1:.*]] = llvm.mul %[[ARG1]], %[[STRIDE1]] : !llvm.i32 - // CHECK32: %[[DESC4:.*]] = llvm.insertvalue %[[DESCSTRIDE1]], %[[DESC3]][4, 1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[DESC5:.*]] = llvm.insertvalue %[[ARG0]], %[[DESC4]][3, 0] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC4:.*]] = llvm.insertvalue %[[DESCSTRIDE1]], %[[DESC3]][4, 1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[DESC5:.*]] = llvm.insertvalue %[[ARG0]], %[[DESC4]][3, 0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[DESCSTRIDE0:.*]] = llvm.mul %[[ARG0]], %[[STRIDE0]] : !llvm.i32 %1 = subview %0[%arg0, %arg1][%arg0, %arg1][%arg0, %arg1] : @@ -889,13 +889,13 @@ } // CHECK-LABEL: func @subview_non_zero_addrspace( -// CHECK-COUNT-2: !llvm<"float addrspace(3)*">, +// CHECK-COUNT-2: !llvm.ptr, // CHECK-COUNT-5: {{%[a-zA-Z0-9]*}}: !llvm.i64, // CHECK: %[[ARG0:[a-zA-Z0-9]*]]: !llvm.i64, // CHECK: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.i64, // CHECK: %[[ARG2:.*]]: !llvm.i64) // CHECK32-LABEL: func @subview_non_zero_addrspace( -// CHECK32-COUNT-2: !llvm<"float addrspace(3)*">, +// CHECK32-COUNT-2: !llvm.ptr, // CHECK32-COUNT-5: {{%[a-zA-Z0-9]*}}: !llvm.i32, // CHECK32: %[[ARG0:[a-zA-Z0-9]*]]: !llvm.i32, // CHECK32: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.i32, @@ -905,42 +905,42 @@ // CHECK: %[[MEMREF:.*]] = llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] // CHECK32: %[[MEMREF:.*]] = llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] - // CHECK: %[[DESC:.*]] = llvm.mlir.undef : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm<"float addrspace(3)*"> to !llvm<"float addrspace(3)*"> - // CHECK: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm<"float addrspace(3)*"> to !llvm<"float addrspace(3)*"> - // CHECK: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i64, [2 x i64], [2 x i64] }"> + // CHECK: %[[DESC:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[OFFINC:.*]] = llvm.mul %[[ARG0]], %[[STRIDE0]] : !llvm.i64 // CHECK: %[[OFF1:.*]] = llvm.add %[[OFF]], %[[OFFINC]] : !llvm.i64 // CHECK: %[[OFFINC1:.*]] = llvm.mul %[[ARG1]], %[[STRIDE1]] : !llvm.i64 // CHECK: %[[OFF2:.*]] = llvm.add %[[OFF1]], %[[OFFINC1]] : !llvm.i64 - // CHECK: %[[DESC2:.*]] = llvm.insertvalue %[[OFF2]], %[[DESC1]][2] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[DESC3:.*]] = llvm.insertvalue %[[ARG1]], %[[DESC2]][3, 1] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i64, [2 x i64], [2 x i64] }"> + // CHECK: %[[DESC2:.*]] = llvm.insertvalue %[[OFF2]], %[[DESC1]][2] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[DESC3:.*]] = llvm.insertvalue %[[ARG1]], %[[DESC2]][3, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[DESCSTRIDE1:.*]] = llvm.mul %[[ARG1]], %[[STRIDE1]] : !llvm.i64 - // CHECK: %[[DESC4:.*]] = llvm.insertvalue %[[DESCSTRIDE1]], %[[DESC3]][4, 1] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[DESC5:.*]] = llvm.insertvalue %[[ARG0]], %[[DESC4]][3, 0] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i64, [2 x i64], [2 x i64] }"> + // CHECK: %[[DESC4:.*]] = llvm.insertvalue %[[DESCSTRIDE1]], %[[DESC3]][4, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[DESC5:.*]] = llvm.insertvalue %[[ARG0]], %[[DESC4]][3, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[DESCSTRIDE0:.*]] = llvm.mul %[[ARG0]], %[[STRIDE0]] : !llvm.i64 - // CHECK: llvm.insertvalue %[[DESCSTRIDE0]], %[[DESC5]][4, 0] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i64, [2 x i64], [2 x i64] }"> - // CHECK32: %[[DESC:.*]] = llvm.mlir.undef : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm<"float addrspace(3)*"> to !llvm<"float addrspace(3)*"> - // CHECK32: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm<"float addrspace(3)*"> to !llvm<"float addrspace(3)*"> - // CHECK32: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i32, [2 x i32], [2 x i32] }"> + // CHECK: llvm.insertvalue %[[DESCSTRIDE0]], %[[DESC5]][4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK32: %[[DESC:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK32: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK32: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[OFFINC:.*]] = llvm.mul %[[ARG0]], %[[STRIDE0]] : !llvm.i32 // CHECK32: %[[OFF1:.*]] = llvm.add %[[OFF]], %[[OFFINC]] : !llvm.i32 // CHECK32: %[[OFFINC1:.*]] = llvm.mul %[[ARG1]], %[[STRIDE1]] : !llvm.i32 // CHECK32: %[[OFF2:.*]] = llvm.add %[[OFF1]], %[[OFFINC1]] : !llvm.i32 - // CHECK32: %[[DESC2:.*]] = llvm.insertvalue %[[OFF2]], %[[DESC1]][2] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[DESC3:.*]] = llvm.insertvalue %[[ARG1]], %[[DESC2]][3, 1] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC2:.*]] = llvm.insertvalue %[[OFF2]], %[[DESC1]][2] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[DESC3:.*]] = llvm.insertvalue %[[ARG1]], %[[DESC2]][3, 1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[DESCSTRIDE1:.*]] = llvm.mul %[[ARG1]], %[[STRIDE1]] : !llvm.i32 - // CHECK32: %[[DESC4:.*]] = llvm.insertvalue %[[DESCSTRIDE1]], %[[DESC3]][4, 1] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[DESC5:.*]] = llvm.insertvalue %[[ARG0]], %[[DESC4]][3, 0] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC4:.*]] = llvm.insertvalue %[[DESCSTRIDE1]], %[[DESC3]][4, 1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[DESC5:.*]] = llvm.insertvalue %[[ARG0]], %[[DESC4]][3, 0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[DESCSTRIDE0:.*]] = llvm.mul %[[ARG0]], %[[STRIDE0]] : !llvm.i32 %1 = subview %0[%arg0, %arg1][%arg0, %arg1][%arg0, %arg1] : @@ -950,8 +950,8 @@ } // CHECK-LABEL: func @subview_const_size( -// CHECK-SAME: %[[ARG0:[a-zA-Z0-9]*]]: !llvm<"float*">, -// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm<"float*">, +// CHECK-SAME: %[[ARG0:[a-zA-Z0-9]*]]: !llvm.ptr, +// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.ptr, // CHECK-SAME: %[[ARG2:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[ARG3:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[ARG4:[a-zA-Z0-9]*]]: !llvm.i64 @@ -961,8 +961,8 @@ // CHECK-SAME: %[[ARG8:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[ARG9:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK32-LABEL: func @subview_const_size( -// CHECK32-SAME: %[[ARG0:[a-zA-Z0-9]*]]: !llvm<"float*">, -// CHECK32-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm<"float*">, +// CHECK32-SAME: %[[ARG0:[a-zA-Z0-9]*]]: !llvm.ptr, +// CHECK32-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.ptr, // CHECK32-SAME: %[[ARG2:[a-zA-Z0-9]*]]: !llvm.i32 // CHECK32-SAME: %[[ARG3:[a-zA-Z0-9]*]]: !llvm.i32 // CHECK32-SAME: %[[ARG4:[a-zA-Z0-9]*]]: !llvm.i32 @@ -976,48 +976,48 @@ // CHECK: %[[MEMREF:.*]] = llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] // CHECK32: %[[MEMREF:.*]] = llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] - // CHECK: %[[DESC:.*]] = llvm.mlir.undef : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm<"float*"> to !llvm<"float*"> - // CHECK: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm<"float*"> to !llvm<"float*"> - // CHECK: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: %[[DESC:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[OFFINC:.*]] = llvm.mul %[[ARG7]], %[[STRIDE0]] : !llvm.i64 // CHECK: %[[OFF1:.*]] = llvm.add %[[OFF]], %[[OFFINC]] : !llvm.i64 // CHECK: %[[OFFINC1:.*]] = llvm.mul %[[ARG8]], %[[STRIDE1]] : !llvm.i64 // CHECK: %[[OFF2:.*]] = llvm.add %[[OFF1]], %[[OFFINC1]] : !llvm.i64 - // CHECK: %[[DESC2:.*]] = llvm.insertvalue %[[OFF2]], %[[DESC1]][2] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: %[[DESC2:.*]] = llvm.insertvalue %[[OFF2]], %[[DESC1]][2] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[CST2:.*]] = llvm.mlir.constant(2 : i64) - // CHECK: %[[DESC3:.*]] = llvm.insertvalue %[[CST2]], %[[DESC2]][3, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: %[[DESC3:.*]] = llvm.insertvalue %[[CST2]], %[[DESC2]][3, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[DESCSTRIDE1:.*]] = llvm.mul %[[ARG8]], %[[STRIDE1]] : !llvm.i64 - // CHECK: %[[DESC4:.*]] = llvm.insertvalue %[[DESCSTRIDE1]], %[[DESC3]][4, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: %[[DESC4:.*]] = llvm.insertvalue %[[DESCSTRIDE1]], %[[DESC3]][4, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[CST4:.*]] = llvm.mlir.constant(4 : i64) - // CHECK: %[[DESC5:.*]] = llvm.insertvalue %[[CST4]], %[[DESC4]][3, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: %[[DESC5:.*]] = llvm.insertvalue %[[CST4]], %[[DESC4]][3, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[DESCSTRIDE0:.*]] = llvm.mul %[[ARG7]], %[[STRIDE0]] : !llvm.i64 - // CHECK: llvm.insertvalue %[[DESCSTRIDE0]], %[[DESC5]][4, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK32: %[[DESC:.*]] = llvm.mlir.undef : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm<"float*"> to !llvm<"float*"> - // CHECK32: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm<"float*"> to !llvm<"float*"> - // CHECK32: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK: llvm.insertvalue %[[DESCSTRIDE0]], %[[DESC5]][4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK32: %[[DESC:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK32: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK32: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[OFFINC:.*]] = llvm.mul %[[ARG7]], %[[STRIDE0]] : !llvm.i32 // CHECK32: %[[OFF1:.*]] = llvm.add %[[OFF]], %[[OFFINC]] : !llvm.i32 // CHECK32: %[[OFFINC1:.*]] = llvm.mul %[[ARG8]], %[[STRIDE1]] : !llvm.i32 // CHECK32: %[[OFF2:.*]] = llvm.add %[[OFF1]], %[[OFFINC1]] : !llvm.i32 - // CHECK32: %[[DESC2:.*]] = llvm.insertvalue %[[OFF2]], %[[DESC1]][2] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC2:.*]] = llvm.insertvalue %[[OFF2]], %[[DESC1]][2] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[CST2:.*]] = llvm.mlir.constant(2 : i64) - // CHECK32: %[[DESC3:.*]] = llvm.insertvalue %[[CST2]], %[[DESC2]][3, 1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC3:.*]] = llvm.insertvalue %[[CST2]], %[[DESC2]][3, 1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[DESCSTRIDE1:.*]] = llvm.mul %[[ARG8]], %[[STRIDE1]] : !llvm.i32 - // CHECK32: %[[DESC4:.*]] = llvm.insertvalue %[[DESCSTRIDE1]], %[[DESC3]][4, 1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC4:.*]] = llvm.insertvalue %[[DESCSTRIDE1]], %[[DESC3]][4, 1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[CST4:.*]] = llvm.mlir.constant(4 : i64) - // CHECK32: %[[DESC5:.*]] = llvm.insertvalue %[[CST4]], %[[DESC4]][3, 0] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC5:.*]] = llvm.insertvalue %[[CST4]], %[[DESC4]][3, 0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[DESCSTRIDE0:.*]] = llvm.mul %[[ARG7]], %[[STRIDE0]] : !llvm.i32 - // CHECK32: llvm.insertvalue %[[DESCSTRIDE0]], %[[DESC5]][4, 0] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: llvm.insertvalue %[[DESCSTRIDE0]], %[[DESC5]][4, 0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> %1 = subview %0[%arg0, %arg1][4, 2][%arg0, %arg1] : memref<64x4xf32, offset: 0, strides: [4, 1]> to memref<4x2xf32, offset: ?, strides: [?, ?]> @@ -1025,8 +1025,8 @@ } // CHECK-LABEL: func @subview_const_stride( -// CHECK-SAME: %[[ARG0:[a-zA-Z0-9]*]]: !llvm<"float*">, -// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm<"float*">, +// CHECK-SAME: %[[ARG0:[a-zA-Z0-9]*]]: !llvm.ptr, +// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.ptr, // CHECK-SAME: %[[ARG2:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[ARG3:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[ARG4:[a-zA-Z0-9]*]]: !llvm.i64 @@ -1036,8 +1036,8 @@ // CHECK-SAME: %[[ARG8:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK-SAME: %[[ARG9:[a-zA-Z0-9]*]]: !llvm.i64 // CHECK32-LABEL: func @subview_const_stride( -// CHECK32-SAME: %[[ARG0:[a-zA-Z0-9]*]]: !llvm<"float*">, -// CHECK32-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm<"float*">, +// CHECK32-SAME: %[[ARG0:[a-zA-Z0-9]*]]: !llvm.ptr, +// CHECK32-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.ptr, // CHECK32-SAME: %[[ARG2:[a-zA-Z0-9]*]]: !llvm.i32 // CHECK32-SAME: %[[ARG3:[a-zA-Z0-9]*]]: !llvm.i32 // CHECK32-SAME: %[[ARG4:[a-zA-Z0-9]*]]: !llvm.i32 @@ -1051,44 +1051,44 @@ // CHECK: %[[MEMREF:.*]] = llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] // CHECK32: %[[MEMREF:.*]] = llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] - // CHECK: %[[DESC:.*]] = llvm.mlir.undef : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm<"float*"> to !llvm<"float*"> - // CHECK: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm<"float*"> to !llvm<"float*"> - // CHECK: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: %[[DESC:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[OFFINC:.*]] = llvm.mul %[[ARG7]], %[[STRIDE0]] : !llvm.i64 // CHECK: %[[OFF1:.*]] = llvm.add %[[OFF]], %[[OFFINC]] : !llvm.i64 // CHECK: %[[OFFINC1:.*]] = llvm.mul %[[ARG8]], %[[STRIDE1]] : !llvm.i64 // CHECK: %[[OFF2:.*]] = llvm.add %[[OFF1]], %[[OFFINC1]] : !llvm.i64 - // CHECK: %[[DESC2:.*]] = llvm.insertvalue %[[OFF2]], %[[DESC1]][2] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[DESC3:.*]] = llvm.insertvalue %[[ARG8]], %[[DESC2]][3, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: %[[DESC2:.*]] = llvm.insertvalue %[[OFF2]], %[[DESC1]][2] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[DESC3:.*]] = llvm.insertvalue %[[ARG8]], %[[DESC2]][3, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[CST2:.*]] = llvm.mlir.constant(2 : i64) - // CHECK: %[[DESC4:.*]] = llvm.insertvalue %[[CST2]], %[[DESC3]][4, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK: %[[DESC5:.*]] = llvm.insertvalue %[[ARG7]], %[[DESC4]][3, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> + // CHECK: %[[DESC4:.*]] = llvm.insertvalue %[[CST2]], %[[DESC3]][4, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK: %[[DESC5:.*]] = llvm.insertvalue %[[ARG7]], %[[DESC4]][3, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[CST4:.*]] = llvm.mlir.constant(4 : i64) - // CHECK: llvm.insertvalue %[[CST4]], %[[DESC5]][4, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> - // CHECK32: %[[DESC:.*]] = llvm.mlir.undef : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm<"float*"> to !llvm<"float*"> - // CHECK32: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm<"float*"> to !llvm<"float*"> - // CHECK32: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK: llvm.insertvalue %[[CST4]], %[[DESC5]][4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> + // CHECK32: %[[DESC:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK32: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK32: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[OFFINC:.*]] = llvm.mul %[[ARG7]], %[[STRIDE0]] : !llvm.i32 // CHECK32: %[[OFF1:.*]] = llvm.add %[[OFF]], %[[OFFINC]] : !llvm.i32 // CHECK32: %[[OFFINC1:.*]] = llvm.mul %[[ARG8]], %[[STRIDE1]] : !llvm.i32 // CHECK32: %[[OFF2:.*]] = llvm.add %[[OFF1]], %[[OFFINC1]] : !llvm.i32 - // CHECK32: %[[DESC2:.*]] = llvm.insertvalue %[[OFF2]], %[[DESC1]][2] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[DESC3:.*]] = llvm.insertvalue %[[ARG8]], %[[DESC2]][3, 1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC2:.*]] = llvm.insertvalue %[[OFF2]], %[[DESC1]][2] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[DESC3:.*]] = llvm.insertvalue %[[ARG8]], %[[DESC2]][3, 1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[CST2:.*]] = llvm.mlir.constant(2 : i64) - // CHECK32: %[[DESC4:.*]] = llvm.insertvalue %[[CST2]], %[[DESC3]][4, 1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[DESC5:.*]] = llvm.insertvalue %[[ARG7]], %[[DESC4]][3, 0] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC4:.*]] = llvm.insertvalue %[[CST2]], %[[DESC3]][4, 1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[DESC5:.*]] = llvm.insertvalue %[[ARG7]], %[[DESC4]][3, 0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[CST4:.*]] = llvm.mlir.constant(4 : i64) - // CHECK32: llvm.insertvalue %[[CST4]], %[[DESC5]][4, 0] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: llvm.insertvalue %[[CST4]], %[[DESC5]][4, 0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> %1 = subview %0[%arg0, %arg1][%arg0, %arg1][1, 2] : memref<64x4xf32, offset: 0, strides: [4, 1]> to memref @@ -1102,23 +1102,23 @@ // CHECK: %[[MEMREF:.*]] = llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] // CHECK32: %[[MEMREF:.*]] = llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] - // CHECK32: %[[DESC:.*]] = llvm.mlir.undef : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm<"float*"> to !llvm<"float*"> - // CHECK32: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm<"float*"> to !llvm<"float*"> - // CHECK32: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK32: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK32: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[CST8:.*]] = llvm.mlir.constant(8 : index) - // CHECK32: %[[DESC2:.*]] = llvm.insertvalue %[[CST8]], %[[DESC1]][2] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC2:.*]] = llvm.insertvalue %[[CST8]], %[[DESC1]][2] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[CST3:.*]] = llvm.mlir.constant(3 : i64) - // CHECK32: %[[DESC3:.*]] = llvm.insertvalue %[[CST3]], %[[DESC2]][3, 1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC3:.*]] = llvm.insertvalue %[[CST3]], %[[DESC2]][3, 1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[CST1:.*]] = llvm.mlir.constant(1 : i64) - // CHECK32: %[[DESC4:.*]] = llvm.insertvalue %[[CST1]], %[[DESC3]][4, 1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC4:.*]] = llvm.insertvalue %[[CST1]], %[[DESC3]][4, 1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[CST62:.*]] = llvm.mlir.constant(62 : i64) - // CHECK32: %[[DESC5:.*]] = llvm.insertvalue %[[CST62]], %[[DESC4]][3, 0] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC5:.*]] = llvm.insertvalue %[[CST62]], %[[DESC4]][3, 0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[CST4:.*]] = llvm.mlir.constant(4 : i64) - // CHECK32: llvm.insertvalue %[[CST4]], %[[DESC5]][4, 0] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: llvm.insertvalue %[[CST4]], %[[DESC5]][4, 0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> %1 = subview %0[0, 8][62, 3][1, 1] : memref<64x4xf32, offset: 0, strides: [4, 1]> to memref<62x3xf32, offset: 8, strides: [4, 1]> @@ -1126,13 +1126,13 @@ } // CHECK-LABEL: func @subview_mixed_static_dynamic( -// CHECK-COUNT-2: !llvm<"float*">, +// CHECK-COUNT-2: !llvm.ptr, // CHECK-COUNT-5: {{%[a-zA-Z0-9]*}}: !llvm.i64, // CHECK: %[[ARG0:[a-zA-Z0-9]*]]: !llvm.i64, // CHECK: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.i64, // CHECK: %[[ARG2:.*]]: !llvm.i64) // CHECK32-LABEL: func @subview_mixed_static_dynamic( -// CHECK32-COUNT-2: !llvm<"float*">, +// CHECK32-COUNT-2: !llvm.ptr, // CHECK32-COUNT-5: {{%[a-zA-Z0-9]*}}: !llvm.i32, // CHECK32: %[[ARG0:[a-zA-Z0-9]*]]: !llvm.i32, // CHECK32: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.i32, @@ -1142,28 +1142,28 @@ // CHECK: %[[MEMREF:.*]] = llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] // CHECK32: %[[MEMREF:.*]] = llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] - // CHECK32: %[[DESC:.*]] = llvm.mlir.undef : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm<"float*"> to !llvm<"float*"> - // CHECK32: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm<"float*"> to !llvm<"float*"> - // CHECK32: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> - // CHECK32: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK32: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr to !llvm.ptr + // CHECK32: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> + // CHECK32: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[OFFM1:.*]] = llvm.mul %[[ARG1]], %[[STRIDE0]] : !llvm.i32 // CHECK32: %[[OFFA1:.*]] = llvm.add %[[OFF]], %[[OFFM1]] : !llvm.i32 // CHECK32: %[[CST8:.*]] = llvm.mlir.constant(8 : i64) : !llvm.i32 // CHECK32: %[[OFFM2:.*]] = llvm.mul %[[CST8]], %[[STRIDE1]] : !llvm.i32 // CHECK32: %[[OFFA2:.*]] = llvm.add %[[OFFA1]], %[[OFFM2]] : !llvm.i32 - // CHECK32: %[[DESC2:.*]] = llvm.insertvalue %[[OFFA2]], %[[DESC1]][2] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC2:.*]] = llvm.insertvalue %[[OFFA2]], %[[DESC1]][2] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> - // CHECK32: %[[DESC3:.*]] = llvm.insertvalue %[[ARG2]], %[[DESC2]][3, 1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC3:.*]] = llvm.insertvalue %[[ARG2]], %[[DESC2]][3, 1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[CST1:.*]] = llvm.mlir.constant(1 : i64) : !llvm.i32 - // CHECK32: %[[DESC4:.*]] = llvm.insertvalue %[[CST1]], %[[DESC3]][4, 1] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC4:.*]] = llvm.insertvalue %[[CST1]], %[[DESC3]][4, 1] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[CST62:.*]] = llvm.mlir.constant(62 : i64) : !llvm.i32 - // CHECK32: %[[DESC5:.*]] = llvm.insertvalue %[[CST62]], %[[DESC4]][3, 0] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: %[[DESC5:.*]] = llvm.insertvalue %[[CST62]], %[[DESC4]][3, 0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> // CHECK32: %[[DESCSTRIDE0:.*]] = llvm.mul %[[ARG0]], %[[STRIDE0]] : !llvm.i32 - // CHECK32: llvm.insertvalue %[[DESCSTRIDE0]], %[[DESC5]][4, 0] : !llvm<"{ float*, float*, i32, [2 x i32], [2 x i32] }"> + // CHECK32: llvm.insertvalue %[[DESCSTRIDE0]], %[[DESC5]][4, 0] : !llvm.struct<(ptr, ptr, i32, array<2 x i32>, array<2 x i32>)> %1 = subview %0[%arg1, 8][62, %arg2][%arg0, 1] : memref<64x4xf32, offset: 0, strides: [4, 1]> to memref<62x?xf32, offset: ?, strides: [?, 1]> @@ -1200,7 +1200,7 @@ %c1 = constant 1.0 : f32 atomic_yield %c1 : f32 } - // CHECK: [[init:%.*]] = llvm.load %{{.*}} : !llvm<"float*"> + // CHECK: [[init:%.*]] = llvm.load %{{.*}} : !llvm.ptr // CHECK-NEXT: llvm.br ^bb1([[init]] : !llvm.float) // CHECK-NEXT: ^bb1([[loaded:%.*]]: !llvm.float): // CHECK-NEXT: [[c1:%.*]] = llvm.mlir.constant(1.000000e+00 : f32) @@ -1222,10 +1222,10 @@ // CHECK-LABEL: func @assume_alignment func @assume_alignment(%0 : memref<4x4xf16>) { - // CHECK: %[[PTR:.*]] = llvm.extractvalue %[[MEMREF:.*]][1] : !llvm<"{ half*, half*, i64, [2 x i64], [2 x i64] }"> + // CHECK: %[[PTR:.*]] = llvm.extractvalue %[[MEMREF:.*]][1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK-NEXT: %[[ZERO:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 // CHECK-NEXT: %[[MASK:.*]] = llvm.mlir.constant(15 : index) : !llvm.i64 - // CHECK-NEXT: %[[INT:.*]] = llvm.ptrtoint %[[PTR]] : !llvm<"half*"> to !llvm.i64 + // CHECK-NEXT: %[[INT:.*]] = llvm.ptrtoint %[[PTR]] : !llvm.ptr to !llvm.i64 // CHECK-NEXT: %[[MASKED_PTR:.*]] = llvm.and %[[INT]], %[[MASK:.*]] : !llvm.i64 // CHECK-NEXT: %[[CONDITION:.*]] = llvm.icmp "eq" %[[MASKED_PTR]], %[[ZERO]] : !llvm.i64 // CHECK-NEXT: "llvm.intr.assume"(%[[CONDITION]]) : (!llvm.i1) -> () @@ -1237,16 +1237,16 @@ // CHECK-LABEL: func @mlir_cast_to_llvm // CHECK-SAME: %[[ARG:.*]]: -func @mlir_cast_to_llvm(%0 : vector<2xf16>) -> !llvm<"<2 x half>"> { - %1 = llvm.mlir.cast %0 : vector<2xf16> to !llvm<"<2 x half>"> +func @mlir_cast_to_llvm(%0 : vector<2xf16>) -> !llvm.vec<2 x half> { + %1 = llvm.mlir.cast %0 : vector<2xf16> to !llvm.vec<2 x half> // CHECK-NEXT: llvm.return %[[ARG]] - return %1 : !llvm<"<2 x half>"> + return %1 : !llvm.vec<2 x half> } // CHECK-LABEL: func @mlir_cast_from_llvm // CHECK-SAME: %[[ARG:.*]]: -func @mlir_cast_from_llvm(%0 : !llvm<"<2 x half>">) -> vector<2xf16> { - %1 = llvm.mlir.cast %0 : !llvm<"<2 x half>"> to vector<2xf16> +func @mlir_cast_from_llvm(%0 : !llvm.vec<2 x half>) -> vector<2xf16> { + %1 = llvm.mlir.cast %0 : !llvm.vec<2 x half> to vector<2xf16> // CHECK-NEXT: llvm.return %[[ARG]] return %1 : vector<2xf16> } diff --git a/mlir/test/Conversion/StandardToLLVM/invalid.mlir b/mlir/test/Conversion/StandardToLLVM/invalid.mlir --- a/mlir/test/Conversion/StandardToLLVM/invalid.mlir +++ b/mlir/test/Conversion/StandardToLLVM/invalid.mlir @@ -24,8 +24,8 @@ // ----- -func @mlir_cast_to_llvm_vec(%0 : vector<1x1xf32>) -> !llvm<"<1 x float>"> { +func @mlir_cast_to_llvm_vec(%0 : vector<1x1xf32>) -> !llvm.vec<1 x float> { // expected-error@+1 {{'llvm.mlir.cast' op only 1-d vector is allowed}} - %1 = llvm.mlir.cast %0 : vector<1x1xf32> to !llvm<"<1 x float>"> - return %1 : !llvm<"<1 x float>"> + %1 = llvm.mlir.cast %0 : vector<1x1xf32> to !llvm.vec<1 x float> + return %1 : !llvm.vec<1 x float> } diff --git a/mlir/test/Conversion/StandardToLLVM/standard-to-llvm.mlir b/mlir/test/Conversion/StandardToLLVM/standard-to-llvm.mlir --- a/mlir/test/Conversion/StandardToLLVM/standard-to-llvm.mlir +++ b/mlir/test/Conversion/StandardToLLVM/standard-to-llvm.mlir @@ -1,11 +1,11 @@ // RUN: mlir-opt -allow-unregistered-dialect %s -convert-std-to-llvm -split-input-file -verify-diagnostics | FileCheck %s // CHECK-LABEL: func @address_space( -// CHECK-SAME: !llvm<"float addrspace(7)*"> +// CHECK-SAME: !llvm.ptr func @address_space(%arg0 : memref<32xf32, affine_map<(d0) -> (d0)>, 7>) { %0 = alloc() : memref<32xf32, affine_map<(d0) -> (d0)>, 5> %1 = constant 7 : index - // CHECK: llvm.load %{{.*}} : !llvm<"float addrspace(5)*"> + // CHECK: llvm.load %{{.*}} : !llvm.ptr %2 = load %0[%1] : memref<32xf32, affine_map<(d0) -> (d0)>, 5> std.return } @@ -53,11 +53,11 @@ // ----- // CHECK-LABEL: func @rsqrt_vector( -// CHECK-SAME: !llvm<"<4 x float>"> +// CHECK-SAME: !llvm.vec<4 x float> func @rsqrt_vector(%arg0 : vector<4xf32>) { - // CHECK: %[[ONE:.*]] = llvm.mlir.constant(dense<1.000000e+00> : vector<4xf32>) : !llvm<"<4 x float>"> - // CHECK: %[[SQRT:.*]] = "llvm.intr.sqrt"(%arg0) : (!llvm<"<4 x float>">) -> !llvm<"<4 x float>"> - // CHECK: %[[DIV:.*]] = llvm.fdiv %[[ONE]], %[[SQRT]] : !llvm<"<4 x float>"> + // CHECK: %[[ONE:.*]] = llvm.mlir.constant(dense<1.000000e+00> : vector<4xf32>) : !llvm.vec<4 x float> + // CHECK: %[[SQRT:.*]] = "llvm.intr.sqrt"(%arg0) : (!llvm.vec<4 x float>) -> !llvm.vec<4 x float> + // CHECK: %[[DIV:.*]] = llvm.fdiv %[[ONE]], %[[SQRT]] : !llvm.vec<4 x float> %0 = rsqrt %arg0 : vector<4xf32> std.return } @@ -65,13 +65,13 @@ // ----- // CHECK-LABEL: func @rsqrt_multidim_vector( -// CHECK-SAME: !llvm<"[4 x <3 x float>]"> +// CHECK-SAME: !llvm.array<4 x vec<3 x float>> func @rsqrt_multidim_vector(%arg0 : vector<4x3xf32>) { - // CHECK: %[[EXTRACT:.*]] = llvm.extractvalue %arg0[0] : !llvm<"[4 x <3 x float>]"> - // CHECK: %[[ONE:.*]] = llvm.mlir.constant(dense<1.000000e+00> : vector<3xf32>) : !llvm<"<3 x float>"> - // CHECK: %[[SQRT:.*]] = "llvm.intr.sqrt"(%[[EXTRACT]]) : (!llvm<"<3 x float>">) -> !llvm<"<3 x float>"> - // CHECK: %[[DIV:.*]] = llvm.fdiv %[[ONE]], %[[SQRT]] : !llvm<"<3 x float>"> - // CHECK: %[[INSERT:.*]] = llvm.insertvalue %[[DIV]], %0[0] : !llvm<"[4 x <3 x float>]"> + // CHECK: %[[EXTRACT:.*]] = llvm.extractvalue %arg0[0] : !llvm.array<4 x vec<3 x float>> + // CHECK: %[[ONE:.*]] = llvm.mlir.constant(dense<1.000000e+00> : vector<3xf32>) : !llvm.vec<3 x float> + // CHECK: %[[SQRT:.*]] = "llvm.intr.sqrt"(%[[EXTRACT]]) : (!llvm.vec<3 x float>) -> !llvm.vec<3 x float> + // CHECK: %[[DIV:.*]] = llvm.fdiv %[[ONE]], %[[SQRT]] : !llvm.vec<3 x float> + // CHECK: %[[INSERT:.*]] = llvm.insertvalue %[[DIV]], %0[0] : !llvm.array<4 x vec<3 x float>> %0 = rsqrt %arg0 : vector<4x3xf32> std.return } diff --git a/mlir/test/Conversion/VectorToLLVM/vector-reduction-to-llvm.mlir b/mlir/test/Conversion/VectorToLLVM/vector-reduction-to-llvm.mlir --- a/mlir/test/Conversion/VectorToLLVM/vector-reduction-to-llvm.mlir +++ b/mlir/test/Conversion/VectorToLLVM/vector-reduction-to-llvm.mlir @@ -3,17 +3,17 @@ // // CHECK-LABEL: llvm.func @reduce_add_f32( -// CHECK-SAME: %[[A:.*]]: !llvm<"<16 x float>">) +// CHECK-SAME: %[[A:.*]]: !llvm.vec<16 x float>) // CHECK: %[[C:.*]] = llvm.mlir.constant(0.000000e+00 : f32) : !llvm.float // CHECK: %[[V:.*]] = "llvm.intr.experimental.vector.reduce.v2.fadd"(%[[C]], %[[A]]) -// CHECK-SAME: {reassoc = false} : (!llvm.float, !llvm<"<16 x float>">) -> !llvm.float +// CHECK-SAME: {reassoc = false} : (!llvm.float, !llvm.vec<16 x float>) -> !llvm.float // CHECK: llvm.return %[[V]] : !llvm.float // // REASSOC-LABEL: llvm.func @reduce_add_f32( -// REASSOC-SAME: %[[A:.*]]: !llvm<"<16 x float>">) +// REASSOC-SAME: %[[A:.*]]: !llvm.vec<16 x float>) // REASSOC: %[[C:.*]] = llvm.mlir.constant(0.000000e+00 : f32) : !llvm.float // REASSOC: %[[V:.*]] = "llvm.intr.experimental.vector.reduce.v2.fadd"(%[[C]], %[[A]]) -// REASSOC-SAME: {reassoc = true} : (!llvm.float, !llvm<"<16 x float>">) -> !llvm.float +// REASSOC-SAME: {reassoc = true} : (!llvm.float, !llvm.vec<16 x float>) -> !llvm.float // REASSOC: llvm.return %[[V]] : !llvm.float // func @reduce_add_f32(%arg0: vector<16xf32>) -> f32 { @@ -23,17 +23,17 @@ // // CHECK-LABEL: llvm.func @reduce_mul_f32( -// CHECK-SAME: %[[A:.*]]: !llvm<"<16 x float>">) +// CHECK-SAME: %[[A:.*]]: !llvm.vec<16 x float>) // CHECK: %[[C:.*]] = llvm.mlir.constant(1.000000e+00 : f32) : !llvm.float // CHECK: %[[V:.*]] = "llvm.intr.experimental.vector.reduce.v2.fmul"(%[[C]], %[[A]]) -// CHECK-SAME: {reassoc = false} : (!llvm.float, !llvm<"<16 x float>">) -> !llvm.float +// CHECK-SAME: {reassoc = false} : (!llvm.float, !llvm.vec<16 x float>) -> !llvm.float // CHECK: llvm.return %[[V]] : !llvm.float // // REASSOC-LABEL: llvm.func @reduce_mul_f32( -// REASSOC-SAME: %[[A:.*]]: !llvm<"<16 x float>">) +// REASSOC-SAME: %[[A:.*]]: !llvm.vec<16 x float>) // REASSOC: %[[C:.*]] = llvm.mlir.constant(1.000000e+00 : f32) : !llvm.float // REASSOC: %[[V:.*]] = "llvm.intr.experimental.vector.reduce.v2.fmul"(%[[C]], %[[A]]) -// REASSOC-SAME: {reassoc = true} : (!llvm.float, !llvm<"<16 x float>">) -> !llvm.float +// REASSOC-SAME: {reassoc = true} : (!llvm.float, !llvm.vec<16 x float>) -> !llvm.float // REASSOC: llvm.return %[[V]] : !llvm.float // func @reduce_mul_f32(%arg0: vector<16xf32>) -> f32 { diff --git a/mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir b/mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir --- a/mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir +++ b/mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir @@ -6,11 +6,11 @@ } // CHECK-LABEL: llvm.func @broadcast_vec1d_from_scalar( // CHECK-SAME: %[[A:.*]]: !llvm.float) -// CHECK: %[[T0:.*]] = llvm.mlir.undef : !llvm<"<2 x float>"> +// CHECK: %[[T0:.*]] = llvm.mlir.undef : !llvm.vec<2 x float> // CHECK: %[[T1:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 -// CHECK: %[[T2:.*]] = llvm.insertelement %[[A]], %[[T0]][%[[T1]] : !llvm.i32] : !llvm<"<2 x float>"> -// CHECK: %[[T3:.*]] = llvm.shufflevector %[[T2]], %[[T0]] [0 : i32, 0 : i32] : !llvm<"<2 x float>">, !llvm<"<2 x float>"> -// CHECK: llvm.return %[[T3]] : !llvm<"<2 x float>"> +// CHECK: %[[T2:.*]] = llvm.insertelement %[[A]], %[[T0]][%[[T1]] : !llvm.i32] : !llvm.vec<2 x float> +// CHECK: %[[T3:.*]] = llvm.shufflevector %[[T2]], %[[T0]] [0 : i32, 0 : i32] : !llvm.vec<2 x float>, !llvm.vec<2 x float> +// CHECK: llvm.return %[[T3]] : !llvm.vec<2 x float> func @broadcast_vec2d_from_scalar(%arg0: f32) -> vector<2x3xf32> { %0 = vector.broadcast %arg0 : f32 to vector<2x3xf32> @@ -18,14 +18,14 @@ } // CHECK-LABEL: llvm.func @broadcast_vec2d_from_scalar( // CHECK-SAME: %[[A:.*]]: !llvm.float) -// CHECK: %[[T0:.*]] = llvm.mlir.undef : !llvm<"[2 x <3 x float>]"> -// CHECK: %[[T1:.*]] = llvm.mlir.undef : !llvm<"<3 x float>"> +// CHECK: %[[T0:.*]] = llvm.mlir.undef : !llvm.array<2 x vec<3 x float>> +// CHECK: %[[T1:.*]] = llvm.mlir.undef : !llvm.vec<3 x float> // CHECK: %[[T2:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 -// CHECK: %[[T3:.*]] = llvm.insertelement %[[A]], %[[T1]][%[[T2]] : !llvm.i32] : !llvm<"<3 x float>"> -// CHECK: %[[T4:.*]] = llvm.shufflevector %[[T3]], %[[T3]] [0 : i32, 0 : i32, 0 : i32] : !llvm<"<3 x float>">, !llvm<"<3 x float>"> -// CHECK: %[[T5:.*]] = llvm.insertvalue %[[T4]], %[[T0]][0] : !llvm<"[2 x <3 x float>]"> -// CHECK: %[[T6:.*]] = llvm.insertvalue %[[T4]], %[[T5]][1] : !llvm<"[2 x <3 x float>]"> -// CHECK: llvm.return %[[T6]] : !llvm<"[2 x <3 x float>]"> +// CHECK: %[[T3:.*]] = llvm.insertelement %[[A]], %[[T1]][%[[T2]] : !llvm.i32] : !llvm.vec<3 x float> +// CHECK: %[[T4:.*]] = llvm.shufflevector %[[T3]], %[[T3]] [0 : i32, 0 : i32, 0 : i32] : !llvm.vec<3 x float>, !llvm.vec<3 x float> +// CHECK: %[[T5:.*]] = llvm.insertvalue %[[T4]], %[[T0]][0] : !llvm.array<2 x vec<3 x float>> +// CHECK: %[[T6:.*]] = llvm.insertvalue %[[T4]], %[[T5]][1] : !llvm.array<2 x vec<3 x float>> +// CHECK: llvm.return %[[T6]] : !llvm.array<2 x vec<3 x float>> func @broadcast_vec3d_from_scalar(%arg0: f32) -> vector<2x3x4xf32> { %0 = vector.broadcast %arg0 : f32 to vector<2x3x4xf32> @@ -33,277 +33,277 @@ } // CHECK-LABEL: llvm.func @broadcast_vec3d_from_scalar( // CHECK-SAME: %[[A:.*]]: !llvm.float) -// CHECK: %[[T0:.*]] = llvm.mlir.undef : !llvm<"[2 x [3 x <4 x float>]]"> -// CHECK: %[[T1:.*]] = llvm.mlir.undef : !llvm<"<4 x float>"> +// CHECK: %[[T0:.*]] = llvm.mlir.undef : !llvm.array<2 x array<3 x vec<4 x float>>> +// CHECK: %[[T1:.*]] = llvm.mlir.undef : !llvm.vec<4 x float> // CHECK: %[[T2:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 -// CHECK: %[[T3:.*]] = llvm.insertelement %[[A]], %[[T1]][%[[T2]] : !llvm.i32] : !llvm<"<4 x float>"> -// CHECK: %[[T4:.*]] = llvm.shufflevector %[[T3]], %[[T3]] [0 : i32, 0 : i32, 0 : i32, 0 : i32] : !llvm<"<4 x float>">, !llvm<"<4 x float>"> -// CHECK: %[[T5:.*]] = llvm.insertvalue %[[T4]], %[[T0]][0, 0] : !llvm<"[2 x [3 x <4 x float>]]"> -// CHECK: %[[T6:.*]] = llvm.insertvalue %[[T4]], %[[T5]][0, 1] : !llvm<"[2 x [3 x <4 x float>]]"> -// CHECK: %[[T7:.*]] = llvm.insertvalue %[[T4]], %[[T6]][0, 2] : !llvm<"[2 x [3 x <4 x float>]]"> -// CHECK: %[[T8:.*]] = llvm.insertvalue %[[T4]], %[[T7]][1, 0] : !llvm<"[2 x [3 x <4 x float>]]"> -// CHECK: %[[T9:.*]] = llvm.insertvalue %[[T4]], %[[T8]][1, 1] : !llvm<"[2 x [3 x <4 x float>]]"> -// CHECK: %[[T10:.*]] = llvm.insertvalue %[[T4]], %[[T9]][1, 2] : !llvm<"[2 x [3 x <4 x float>]]"> -// CHECK: llvm.return %[[T10]] : !llvm<"[2 x [3 x <4 x float>]]"> +// CHECK: %[[T3:.*]] = llvm.insertelement %[[A]], %[[T1]][%[[T2]] : !llvm.i32] : !llvm.vec<4 x float> +// CHECK: %[[T4:.*]] = llvm.shufflevector %[[T3]], %[[T3]] [0 : i32, 0 : i32, 0 : i32, 0 : i32] : !llvm.vec<4 x float>, !llvm.vec<4 x float> +// CHECK: %[[T5:.*]] = llvm.insertvalue %[[T4]], %[[T0]][0, 0] : !llvm.array<2 x array<3 x vec<4 x float>>> +// CHECK: %[[T6:.*]] = llvm.insertvalue %[[T4]], %[[T5]][0, 1] : !llvm.array<2 x array<3 x vec<4 x float>>> +// CHECK: %[[T7:.*]] = llvm.insertvalue %[[T4]], %[[T6]][0, 2] : !llvm.array<2 x array<3 x vec<4 x float>>> +// CHECK: %[[T8:.*]] = llvm.insertvalue %[[T4]], %[[T7]][1, 0] : !llvm.array<2 x array<3 x vec<4 x float>>> +// CHECK: %[[T9:.*]] = llvm.insertvalue %[[T4]], %[[T8]][1, 1] : !llvm.array<2 x array<3 x vec<4 x float>>> +// CHECK: %[[T10:.*]] = llvm.insertvalue %[[T4]], %[[T9]][1, 2] : !llvm.array<2 x array<3 x vec<4 x float>>> +// CHECK: llvm.return %[[T10]] : !llvm.array<2 x array<3 x vec<4 x float>>> func @broadcast_vec1d_from_vec1d(%arg0: vector<2xf32>) -> vector<2xf32> { %0 = vector.broadcast %arg0 : vector<2xf32> to vector<2xf32> return %0 : vector<2xf32> } // CHECK-LABEL: llvm.func @broadcast_vec1d_from_vec1d( -// CHECK-SAME: %[[A:.*]]: !llvm<"<2 x float>">) -// CHECK: llvm.return %[[A]] : !llvm<"<2 x float>"> +// CHECK-SAME: %[[A:.*]]: !llvm.vec<2 x float>) +// CHECK: llvm.return %[[A]] : !llvm.vec<2 x float> func @broadcast_vec2d_from_vec1d(%arg0: vector<2xf32>) -> vector<3x2xf32> { %0 = vector.broadcast %arg0 : vector<2xf32> to vector<3x2xf32> return %0 : vector<3x2xf32> } // CHECK-LABEL: llvm.func @broadcast_vec2d_from_vec1d( -// CHECK-SAME: %[[A:.*]]: !llvm<"<2 x float>">) -// CHECK: %[[T0:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<3x2xf32>) : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T1:.*]] = llvm.insertvalue %[[A]], %[[T0]][0] : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T2:.*]] = llvm.insertvalue %[[A]], %[[T1]][1] : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T3:.*]] = llvm.insertvalue %[[A]], %[[T2]][2] : !llvm<"[3 x <2 x float>]"> -// CHECK: llvm.return %[[T3]] : !llvm<"[3 x <2 x float>]"> +// CHECK-SAME: %[[A:.*]]: !llvm.vec<2 x float>) +// CHECK: %[[T0:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<3x2xf32>) : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T1:.*]] = llvm.insertvalue %[[A]], %[[T0]][0] : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T2:.*]] = llvm.insertvalue %[[A]], %[[T1]][1] : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T3:.*]] = llvm.insertvalue %[[A]], %[[T2]][2] : !llvm.array<3 x vec<2 x float>> +// CHECK: llvm.return %[[T3]] : !llvm.array<3 x vec<2 x float>> func @broadcast_vec3d_from_vec1d(%arg0: vector<2xf32>) -> vector<4x3x2xf32> { %0 = vector.broadcast %arg0 : vector<2xf32> to vector<4x3x2xf32> return %0 : vector<4x3x2xf32> } // CHECK-LABEL: llvm.func @broadcast_vec3d_from_vec1d( -// CHECK-SAME: %[[A:.*]]: !llvm<"<2 x float>">) -// CHECK: %[[T0:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<3x2xf32>) : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T1:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<4x3x2xf32>) : !llvm<"[4 x [3 x <2 x float>]]"> -// CHECK: %[[T2:.*]] = llvm.insertvalue %[[A]], %[[T0]][0] : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T3:.*]] = llvm.insertvalue %[[A]], %[[T2]][1] : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T4:.*]] = llvm.insertvalue %[[A]], %[[T3]][2] : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T5:.*]] = llvm.insertvalue %[[T4]], %[[T1]][0] : !llvm<"[4 x [3 x <2 x float>]]"> -// CHECK: %[[T6:.*]] = llvm.insertvalue %[[T4]], %[[T5]][1] : !llvm<"[4 x [3 x <2 x float>]]"> -// CHECK: %[[T7:.*]] = llvm.insertvalue %[[T4]], %[[T6]][2] : !llvm<"[4 x [3 x <2 x float>]]"> -// CHECK: %[[T8:.*]] = llvm.insertvalue %[[T4]], %[[T7]][3] : !llvm<"[4 x [3 x <2 x float>]]"> -// CHECK: llvm.return %[[T8]] : !llvm<"[4 x [3 x <2 x float>]]"> +// CHECK-SAME: %[[A:.*]]: !llvm.vec<2 x float>) +// CHECK: %[[T0:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<3x2xf32>) : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T1:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<4x3x2xf32>) : !llvm.array<4 x array<3 x vec<2 x float>>> +// CHECK: %[[T2:.*]] = llvm.insertvalue %[[A]], %[[T0]][0] : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T3:.*]] = llvm.insertvalue %[[A]], %[[T2]][1] : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T4:.*]] = llvm.insertvalue %[[A]], %[[T3]][2] : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T5:.*]] = llvm.insertvalue %[[T4]], %[[T1]][0] : !llvm.array<4 x array<3 x vec<2 x float>>> +// CHECK: %[[T6:.*]] = llvm.insertvalue %[[T4]], %[[T5]][1] : !llvm.array<4 x array<3 x vec<2 x float>>> +// CHECK: %[[T7:.*]] = llvm.insertvalue %[[T4]], %[[T6]][2] : !llvm.array<4 x array<3 x vec<2 x float>>> +// CHECK: %[[T8:.*]] = llvm.insertvalue %[[T4]], %[[T7]][3] : !llvm.array<4 x array<3 x vec<2 x float>>> +// CHECK: llvm.return %[[T8]] : !llvm.array<4 x array<3 x vec<2 x float>>> func @broadcast_vec3d_from_vec2d(%arg0: vector<3x2xf32>) -> vector<4x3x2xf32> { %0 = vector.broadcast %arg0 : vector<3x2xf32> to vector<4x3x2xf32> return %0 : vector<4x3x2xf32> } // CHECK-LABEL: llvm.func @broadcast_vec3d_from_vec2d( -// CHECK-SAME: %[[A:.*]]: !llvm<"[3 x <2 x float>]">) -// CHECK: %[[T0:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<4x3x2xf32>) : !llvm<"[4 x [3 x <2 x float>]]"> -// CHECK: %[[T1:.*]] = llvm.insertvalue %[[A]], %[[T0]][0] : !llvm<"[4 x [3 x <2 x float>]]"> -// CHECK: %[[T2:.*]] = llvm.insertvalue %[[A]], %[[T1]][1] : !llvm<"[4 x [3 x <2 x float>]]"> -// CHECK: %[[T3:.*]] = llvm.insertvalue %[[A]], %[[T2]][2] : !llvm<"[4 x [3 x <2 x float>]]"> -// CHECK: %[[T4:.*]] = llvm.insertvalue %[[A]], %[[T3]][3] : !llvm<"[4 x [3 x <2 x float>]]"> -// CHECK: llvm.return %[[T4]] : !llvm<"[4 x [3 x <2 x float>]]"> +// CHECK-SAME: %[[A:.*]]: !llvm.array<3 x vec<2 x float>>) +// CHECK: %[[T0:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<4x3x2xf32>) : !llvm.array<4 x array<3 x vec<2 x float>>> +// CHECK: %[[T1:.*]] = llvm.insertvalue %[[A]], %[[T0]][0] : !llvm.array<4 x array<3 x vec<2 x float>>> +// CHECK: %[[T2:.*]] = llvm.insertvalue %[[A]], %[[T1]][1] : !llvm.array<4 x array<3 x vec<2 x float>>> +// CHECK: %[[T3:.*]] = llvm.insertvalue %[[A]], %[[T2]][2] : !llvm.array<4 x array<3 x vec<2 x float>>> +// CHECK: %[[T4:.*]] = llvm.insertvalue %[[A]], %[[T3]][3] : !llvm.array<4 x array<3 x vec<2 x float>>> +// CHECK: llvm.return %[[T4]] : !llvm.array<4 x array<3 x vec<2 x float>>> func @broadcast_stretch(%arg0: vector<1xf32>) -> vector<4xf32> { %0 = vector.broadcast %arg0 : vector<1xf32> to vector<4xf32> return %0 : vector<4xf32> } // CHECK-LABEL: llvm.func @broadcast_stretch( -// CHECK-SAME: %[[A:.*]]: !llvm<"<1 x float>">) +// CHECK-SAME: %[[A:.*]]: !llvm.vec<1 x float>) // CHECK: %[[T0:.*]] = llvm.mlir.constant(0 : i64) : !llvm.i64 -// CHECK: %[[T1:.*]] = llvm.extractelement %[[A]][%[[T0]] : !llvm.i64] : !llvm<"<1 x float>"> -// CHECK: %[[T2:.*]] = llvm.mlir.undef : !llvm<"<4 x float>"> +// CHECK: %[[T1:.*]] = llvm.extractelement %[[A]][%[[T0]] : !llvm.i64] : !llvm.vec<1 x float> +// CHECK: %[[T2:.*]] = llvm.mlir.undef : !llvm.vec<4 x float> // CHECK: %[[T3:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 -// CHECK: %[[T4:.*]] = llvm.insertelement %[[T1]], %[[T2]][%3 : !llvm.i32] : !llvm<"<4 x float>"> -// CHECK: %[[T5:.*]] = llvm.shufflevector %[[T4]], %[[T2]] [0 : i32, 0 : i32, 0 : i32, 0 : i32] : !llvm<"<4 x float>">, !llvm<"<4 x float>"> -// CHECK: llvm.return %[[T5]] : !llvm<"<4 x float>"> +// CHECK: %[[T4:.*]] = llvm.insertelement %[[T1]], %[[T2]][%3 : !llvm.i32] : !llvm.vec<4 x float> +// CHECK: %[[T5:.*]] = llvm.shufflevector %[[T4]], %[[T2]] [0 : i32, 0 : i32, 0 : i32, 0 : i32] : !llvm.vec<4 x float>, !llvm.vec<4 x float> +// CHECK: llvm.return %[[T5]] : !llvm.vec<4 x float> func @broadcast_stretch_at_start(%arg0: vector<1x4xf32>) -> vector<3x4xf32> { %0 = vector.broadcast %arg0 : vector<1x4xf32> to vector<3x4xf32> return %0 : vector<3x4xf32> } // CHECK-LABEL: llvm.func @broadcast_stretch_at_start( -// CHECK-SAME: %[[A:.*]]: !llvm<"[1 x <4 x float>]">) -// CHECK: %[[T0:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<3x4xf32>) : !llvm<"[3 x <4 x float>]"> -// CHECK: %[[T1:.*]] = llvm.extractvalue %[[A]][0] : !llvm<"[1 x <4 x float>]"> -// CHECK: %[[T2:.*]] = llvm.insertvalue %[[T1]], %[[T0]][0] : !llvm<"[3 x <4 x float>]"> -// CHECK: %[[T3:.*]] = llvm.insertvalue %[[T1]], %[[T2]][1] : !llvm<"[3 x <4 x float>]"> -// CHECK: %[[T4:.*]] = llvm.insertvalue %[[T1]], %[[T3]][2] : !llvm<"[3 x <4 x float>]"> -// CHECK: llvm.return %[[T4]] : !llvm<"[3 x <4 x float>]"> +// CHECK-SAME: %[[A:.*]]: !llvm.array<1 x vec<4 x float>>) +// CHECK: %[[T0:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<3x4xf32>) : !llvm.array<3 x vec<4 x float>> +// CHECK: %[[T1:.*]] = llvm.extractvalue %[[A]][0] : !llvm.array<1 x vec<4 x float>> +// CHECK: %[[T2:.*]] = llvm.insertvalue %[[T1]], %[[T0]][0] : !llvm.array<3 x vec<4 x float>> +// CHECK: %[[T3:.*]] = llvm.insertvalue %[[T1]], %[[T2]][1] : !llvm.array<3 x vec<4 x float>> +// CHECK: %[[T4:.*]] = llvm.insertvalue %[[T1]], %[[T3]][2] : !llvm.array<3 x vec<4 x float>> +// CHECK: llvm.return %[[T4]] : !llvm.array<3 x vec<4 x float>> func @broadcast_stretch_at_end(%arg0: vector<4x1xf32>) -> vector<4x3xf32> { %0 = vector.broadcast %arg0 : vector<4x1xf32> to vector<4x3xf32> return %0 : vector<4x3xf32> } // CHECK-LABEL: llvm.func @broadcast_stretch_at_end( -// CHECK-SAME: %[[A:.*]]: !llvm<"[4 x <1 x float>]">) -// CHECK: %[[T0:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<4x3xf32>) : !llvm<"[4 x <3 x float>]"> -// CHECK: %[[T1:.*]] = llvm.extractvalue %[[A]][0] : !llvm<"[4 x <1 x float>]"> +// CHECK-SAME: %[[A:.*]]: !llvm.array<4 x vec<1 x float>>) +// CHECK: %[[T0:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<4x3xf32>) : !llvm.array<4 x vec<3 x float>> +// CHECK: %[[T1:.*]] = llvm.extractvalue %[[A]][0] : !llvm.array<4 x vec<1 x float>> // CHECK: %[[T2:.*]] = llvm.mlir.constant(0 : i64) : !llvm.i64 -// CHECK: %[[T3:.*]] = llvm.extractelement %[[T1]][%[[T2]] : !llvm.i64] : !llvm<"<1 x float>"> -// CHECK: %[[T4:.*]] = llvm.mlir.undef : !llvm<"<3 x float>"> +// CHECK: %[[T3:.*]] = llvm.extractelement %[[T1]][%[[T2]] : !llvm.i64] : !llvm.vec<1 x float> +// CHECK: %[[T4:.*]] = llvm.mlir.undef : !llvm.vec<3 x float> // CHECK: %[[T5:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 -// CHECK: %[[T6:.*]] = llvm.insertelement %[[T3]], %[[T4]][%[[T5]] : !llvm.i32] : !llvm<"<3 x float>"> -// CHECK: %[[T7:.*]] = llvm.shufflevector %[[T6]], %[[T4]] [0 : i32, 0 : i32, 0 : i32] : !llvm<"<3 x float>">, !llvm<"<3 x float>"> -// CHECK: %[[T8:.*]] = llvm.insertvalue %[[T7]], %[[T0]][0] : !llvm<"[4 x <3 x float>]"> -// CHECK: %[[T9:.*]] = llvm.extractvalue %[[A]][1] : !llvm<"[4 x <1 x float>]"> +// CHECK: %[[T6:.*]] = llvm.insertelement %[[T3]], %[[T4]][%[[T5]] : !llvm.i32] : !llvm.vec<3 x float> +// CHECK: %[[T7:.*]] = llvm.shufflevector %[[T6]], %[[T4]] [0 : i32, 0 : i32, 0 : i32] : !llvm.vec<3 x float>, !llvm.vec<3 x float> +// CHECK: %[[T8:.*]] = llvm.insertvalue %[[T7]], %[[T0]][0] : !llvm.array<4 x vec<3 x float>> +// CHECK: %[[T9:.*]] = llvm.extractvalue %[[A]][1] : !llvm.array<4 x vec<1 x float>> // CHECK: %[[T10:.*]] = llvm.mlir.constant(0 : i64) : !llvm.i64 -// CHECK: %[[T11:.*]] = llvm.extractelement %[[T9]][%[[T10]] : !llvm.i64] : !llvm<"<1 x float>"> -// CHECK: %[[T12:.*]] = llvm.mlir.undef : !llvm<"<3 x float>"> +// CHECK: %[[T11:.*]] = llvm.extractelement %[[T9]][%[[T10]] : !llvm.i64] : !llvm.vec<1 x float> +// CHECK: %[[T12:.*]] = llvm.mlir.undef : !llvm.vec<3 x float> // CHECK: %[[T13:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 -// CHECK: %[[T14:.*]] = llvm.insertelement %[[T11]], %[[T12]][%[[T13]] : !llvm.i32] : !llvm<"<3 x float>"> -// CHECK: %[[T15:.*]] = llvm.shufflevector %[[T14]], %[[T12]] [0 : i32, 0 : i32, 0 : i32] : !llvm<"<3 x float>">, !llvm<"<3 x float>"> -// CHECK: %[[T16:.*]] = llvm.insertvalue %[[T15]], %[[T8]][1] : !llvm<"[4 x <3 x float>]"> -// CHECK: %[[T17:.*]] = llvm.extractvalue %[[A]][2] : !llvm<"[4 x <1 x float>]"> +// CHECK: %[[T14:.*]] = llvm.insertelement %[[T11]], %[[T12]][%[[T13]] : !llvm.i32] : !llvm.vec<3 x float> +// CHECK: %[[T15:.*]] = llvm.shufflevector %[[T14]], %[[T12]] [0 : i32, 0 : i32, 0 : i32] : !llvm.vec<3 x float>, !llvm.vec<3 x float> +// CHECK: %[[T16:.*]] = llvm.insertvalue %[[T15]], %[[T8]][1] : !llvm.array<4 x vec<3 x float>> +// CHECK: %[[T17:.*]] = llvm.extractvalue %[[A]][2] : !llvm.array<4 x vec<1 x float>> // CHECK: %[[T18:.*]] = llvm.mlir.constant(0 : i64) : !llvm.i64 -// CHECK: %[[T19:.*]] = llvm.extractelement %[[T17]][%[[T18]] : !llvm.i64] : !llvm<"<1 x float>"> -// CHECK: %[[T20:.*]] = llvm.mlir.undef : !llvm<"<3 x float>"> +// CHECK: %[[T19:.*]] = llvm.extractelement %[[T17]][%[[T18]] : !llvm.i64] : !llvm.vec<1 x float> +// CHECK: %[[T20:.*]] = llvm.mlir.undef : !llvm.vec<3 x float> // CHECK: %[[T21:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 -// CHECK: %[[T22:.*]] = llvm.insertelement %[[T19]], %[[T20]][%[[T21]] : !llvm.i32] : !llvm<"<3 x float>"> -// CHECK: %[[T23:.*]] = llvm.shufflevector %[[T22]], %[[T20]] [0 : i32, 0 : i32, 0 : i32] : !llvm<"<3 x float>">, !llvm<"<3 x float>"> -// CHECK: %[[T24:.*]] = llvm.insertvalue %[[T23]], %[[T16]][2] : !llvm<"[4 x <3 x float>]"> -// CHECK: %[[T25:.*]] = llvm.extractvalue %[[A]][3] : !llvm<"[4 x <1 x float>]"> +// CHECK: %[[T22:.*]] = llvm.insertelement %[[T19]], %[[T20]][%[[T21]] : !llvm.i32] : !llvm.vec<3 x float> +// CHECK: %[[T23:.*]] = llvm.shufflevector %[[T22]], %[[T20]] [0 : i32, 0 : i32, 0 : i32] : !llvm.vec<3 x float>, !llvm.vec<3 x float> +// CHECK: %[[T24:.*]] = llvm.insertvalue %[[T23]], %[[T16]][2] : !llvm.array<4 x vec<3 x float>> +// CHECK: %[[T25:.*]] = llvm.extractvalue %[[A]][3] : !llvm.array<4 x vec<1 x float>> // CHECK: %[[T26:.*]] = llvm.mlir.constant(0 : i64) : !llvm.i64 -// CHECK: %[[T27:.*]] = llvm.extractelement %[[T25]][%[[T26]] : !llvm.i64] : !llvm<"<1 x float>"> -// CHECK: %[[T28:.*]] = llvm.mlir.undef : !llvm<"<3 x float>"> +// CHECK: %[[T27:.*]] = llvm.extractelement %[[T25]][%[[T26]] : !llvm.i64] : !llvm.vec<1 x float> +// CHECK: %[[T28:.*]] = llvm.mlir.undef : !llvm.vec<3 x float> // CHECK: %[[T29:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 -// CHECK: %[[T30:.*]] = llvm.insertelement %[[T27]], %[[T28]][%[[T29]] : !llvm.i32] : !llvm<"<3 x float>"> -// CHECK: %[[T31:.*]] = llvm.shufflevector %[[T30]], %[[T28]] [0 : i32, 0 : i32, 0 : i32] : !llvm<"<3 x float>">, !llvm<"<3 x float>"> -// CHECK: %[[T32:.*]] = llvm.insertvalue %[[T31]], %[[T24]][3] : !llvm<"[4 x <3 x float>]"> -// CHECK: llvm.return %[[T32]] : !llvm<"[4 x <3 x float>]"> +// CHECK: %[[T30:.*]] = llvm.insertelement %[[T27]], %[[T28]][%[[T29]] : !llvm.i32] : !llvm.vec<3 x float> +// CHECK: %[[T31:.*]] = llvm.shufflevector %[[T30]], %[[T28]] [0 : i32, 0 : i32, 0 : i32] : !llvm.vec<3 x float>, !llvm.vec<3 x float> +// CHECK: %[[T32:.*]] = llvm.insertvalue %[[T31]], %[[T24]][3] : !llvm.array<4 x vec<3 x float>> +// CHECK: llvm.return %[[T32]] : !llvm.array<4 x vec<3 x float>> func @broadcast_stretch_in_middle(%arg0: vector<4x1x2xf32>) -> vector<4x3x2xf32> { %0 = vector.broadcast %arg0 : vector<4x1x2xf32> to vector<4x3x2xf32> return %0 : vector<4x3x2xf32> } // CHECK-LABEL: llvm.func @broadcast_stretch_in_middle( -// CHECK-SAME: %[[A:.*]]: !llvm<"[4 x [1 x <2 x float>]]">) -// CHECK: %[[T0:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<4x3x2xf32>) : !llvm<"[4 x [3 x <2 x float>]]"> -// CHECK: %[[T1:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<3x2xf32>) : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T2:.*]] = llvm.extractvalue %[[A]][0, 0] : !llvm<"[4 x [1 x <2 x float>]]"> -// CHECK: %[[T4:.*]] = llvm.insertvalue %[[T2]], %[[T1]][0] : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T5:.*]] = llvm.insertvalue %[[T2]], %[[T4]][1] : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T6:.*]] = llvm.insertvalue %[[T2]], %[[T5]][2] : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T7:.*]] = llvm.insertvalue %[[T6]], %[[T0]][0] : !llvm<"[4 x [3 x <2 x float>]]"> -// CHECK: %[[T8:.*]] = llvm.extractvalue %[[A]][1, 0] : !llvm<"[4 x [1 x <2 x float>]]"> -// CHECK: %[[T10:.*]] = llvm.insertvalue %[[T8]], %[[T1]][0] : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T11:.*]] = llvm.insertvalue %[[T8]], %[[T10]][1] : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T12:.*]] = llvm.insertvalue %[[T8]], %[[T11]][2] : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T13:.*]] = llvm.insertvalue %[[T12]], %[[T7]][1] : !llvm<"[4 x [3 x <2 x float>]]"> -// CHECK: %[[T14:.*]] = llvm.extractvalue %[[A]][2, 0] : !llvm<"[4 x [1 x <2 x float>]]"> -// CHECK: %[[T16:.*]] = llvm.insertvalue %[[T14]], %[[T1]][0] : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T17:.*]] = llvm.insertvalue %[[T14]], %[[T16]][1] : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T18:.*]] = llvm.insertvalue %[[T14]], %[[T17]][2] : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T19:.*]] = llvm.insertvalue %[[T18]], %[[T13]][2] : !llvm<"[4 x [3 x <2 x float>]]"> -// CHECK: %[[T20:.*]] = llvm.extractvalue %[[A]][3, 0] : !llvm<"[4 x [1 x <2 x float>]]"> -// CHECK: %[[T22:.*]] = llvm.insertvalue %[[T20]], %[[T1]][0] : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T23:.*]] = llvm.insertvalue %[[T20]], %[[T22]][1] : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T24:.*]] = llvm.insertvalue %[[T20]], %[[T23]][2] : !llvm<"[3 x <2 x float>]"> -// CHECK: %[[T25:.*]] = llvm.insertvalue %[[T24]], %[[T19]][3] : !llvm<"[4 x [3 x <2 x float>]]"> -// CHECK: llvm.return %[[T25]] : !llvm<"[4 x [3 x <2 x float>]]"> +// CHECK-SAME: %[[A:.*]]: !llvm.array<4 x array<1 x vec<2 x float>>>) +// CHECK: %[[T0:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<4x3x2xf32>) : !llvm.array<4 x array<3 x vec<2 x float>>> +// CHECK: %[[T1:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<3x2xf32>) : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T2:.*]] = llvm.extractvalue %[[A]][0, 0] : !llvm.array<4 x array<1 x vec<2 x float>>> +// CHECK: %[[T4:.*]] = llvm.insertvalue %[[T2]], %[[T1]][0] : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T5:.*]] = llvm.insertvalue %[[T2]], %[[T4]][1] : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T6:.*]] = llvm.insertvalue %[[T2]], %[[T5]][2] : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T7:.*]] = llvm.insertvalue %[[T6]], %[[T0]][0] : !llvm.array<4 x array<3 x vec<2 x float>>> +// CHECK: %[[T8:.*]] = llvm.extractvalue %[[A]][1, 0] : !llvm.array<4 x array<1 x vec<2 x float>>> +// CHECK: %[[T10:.*]] = llvm.insertvalue %[[T8]], %[[T1]][0] : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T11:.*]] = llvm.insertvalue %[[T8]], %[[T10]][1] : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T12:.*]] = llvm.insertvalue %[[T8]], %[[T11]][2] : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T13:.*]] = llvm.insertvalue %[[T12]], %[[T7]][1] : !llvm.array<4 x array<3 x vec<2 x float>>> +// CHECK: %[[T14:.*]] = llvm.extractvalue %[[A]][2, 0] : !llvm.array<4 x array<1 x vec<2 x float>>> +// CHECK: %[[T16:.*]] = llvm.insertvalue %[[T14]], %[[T1]][0] : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T17:.*]] = llvm.insertvalue %[[T14]], %[[T16]][1] : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T18:.*]] = llvm.insertvalue %[[T14]], %[[T17]][2] : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T19:.*]] = llvm.insertvalue %[[T18]], %[[T13]][2] : !llvm.array<4 x array<3 x vec<2 x float>>> +// CHECK: %[[T20:.*]] = llvm.extractvalue %[[A]][3, 0] : !llvm.array<4 x array<1 x vec<2 x float>>> +// CHECK: %[[T22:.*]] = llvm.insertvalue %[[T20]], %[[T1]][0] : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T23:.*]] = llvm.insertvalue %[[T20]], %[[T22]][1] : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T24:.*]] = llvm.insertvalue %[[T20]], %[[T23]][2] : !llvm.array<3 x vec<2 x float>> +// CHECK: %[[T25:.*]] = llvm.insertvalue %[[T24]], %[[T19]][3] : !llvm.array<4 x array<3 x vec<2 x float>>> +// CHECK: llvm.return %[[T25]] : !llvm.array<4 x array<3 x vec<2 x float>>> func @outerproduct(%arg0: vector<2xf32>, %arg1: vector<3xf32>) -> vector<2x3xf32> { %2 = vector.outerproduct %arg0, %arg1 : vector<2xf32>, vector<3xf32> return %2 : vector<2x3xf32> } // CHECK-LABEL: llvm.func @outerproduct( -// CHECK-SAME: %[[A:.*]]: !llvm<"<2 x float>">, -// CHECK-SAME: %[[B:.*]]: !llvm<"<3 x float>">) +// CHECK-SAME: %[[A:.*]]: !llvm.vec<2 x float>, +// CHECK-SAME: %[[B:.*]]: !llvm.vec<3 x float>) // CHECK: %[[T0:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<2x3xf32>) // CHECK: %[[T1:.*]] = llvm.mlir.constant(0 : i64) : !llvm.i64 -// CHECK: %[[T2:.*]] = llvm.extractelement %[[A]][%[[T1]] : !llvm.i64] : !llvm<"<2 x float>"> -// CHECK: %[[T3:.*]] = llvm.mlir.undef : !llvm<"<3 x float>"> +// CHECK: %[[T2:.*]] = llvm.extractelement %[[A]][%[[T1]] : !llvm.i64] : !llvm.vec<2 x float> +// CHECK: %[[T3:.*]] = llvm.mlir.undef : !llvm.vec<3 x float> // CHECK: %[[T4:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 -// CHECK: %[[T5:.*]] = llvm.insertelement %[[T2]], %[[T3]][%4 : !llvm.i32] : !llvm<"<3 x float>"> -// CHECK: %[[T6:.*]] = llvm.shufflevector %[[T5]], %[[T3]] [0 : i32, 0 : i32, 0 : i32] : !llvm<"<3 x float>">, !llvm<"<3 x float>"> -// CHECK: %[[T7:.*]] = llvm.fmul %[[T6]], %[[B]] : !llvm<"<3 x float>"> -// CHECK: %[[T8:.*]] = llvm.insertvalue %[[T7]], %[[T0]][0] : !llvm<"[2 x <3 x float>]"> +// CHECK: %[[T5:.*]] = llvm.insertelement %[[T2]], %[[T3]][%4 : !llvm.i32] : !llvm.vec<3 x float> +// CHECK: %[[T6:.*]] = llvm.shufflevector %[[T5]], %[[T3]] [0 : i32, 0 : i32, 0 : i32] : !llvm.vec<3 x float>, !llvm.vec<3 x float> +// CHECK: %[[T7:.*]] = llvm.fmul %[[T6]], %[[B]] : !llvm.vec<3 x float> +// CHECK: %[[T8:.*]] = llvm.insertvalue %[[T7]], %[[T0]][0] : !llvm.array<2 x vec<3 x float>> // CHECK: %[[T9:.*]] = llvm.mlir.constant(1 : i64) : !llvm.i64 -// CHECK: %[[T10:.*]] = llvm.extractelement %[[A]][%9 : !llvm.i64] : !llvm<"<2 x float>"> -// CHECK: %[[T11:.*]] = llvm.mlir.undef : !llvm<"<3 x float>"> +// CHECK: %[[T10:.*]] = llvm.extractelement %[[A]][%9 : !llvm.i64] : !llvm.vec<2 x float> +// CHECK: %[[T11:.*]] = llvm.mlir.undef : !llvm.vec<3 x float> // CHECK: %[[T12:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 -// CHECK: %[[T13:.*]] = llvm.insertelement %[[T10]], %[[T11]][%12 : !llvm.i32] : !llvm<"<3 x float>"> -// CHECK: %[[T14:.*]] = llvm.shufflevector %[[T13]], %[[T11]] [0 : i32, 0 : i32, 0 : i32] : !llvm<"<3 x float>">, !llvm<"<3 x float>"> -// CHECK: %[[T15:.*]] = llvm.fmul %[[T14]], %[[B]] : !llvm<"<3 x float>"> -// CHECK: %[[T16:.*]] = llvm.insertvalue %[[T15]], %[[T8]][1] : !llvm<"[2 x <3 x float>]"> -// CHECK: llvm.return %[[T16]] : !llvm<"[2 x <3 x float>]"> +// CHECK: %[[T13:.*]] = llvm.insertelement %[[T10]], %[[T11]][%12 : !llvm.i32] : !llvm.vec<3 x float> +// CHECK: %[[T14:.*]] = llvm.shufflevector %[[T13]], %[[T11]] [0 : i32, 0 : i32, 0 : i32] : !llvm.vec<3 x float>, !llvm.vec<3 x float> +// CHECK: %[[T15:.*]] = llvm.fmul %[[T14]], %[[B]] : !llvm.vec<3 x float> +// CHECK: %[[T16:.*]] = llvm.insertvalue %[[T15]], %[[T8]][1] : !llvm.array<2 x vec<3 x float>> +// CHECK: llvm.return %[[T16]] : !llvm.array<2 x vec<3 x float>> func @outerproduct_add(%arg0: vector<2xf32>, %arg1: vector<3xf32>, %arg2: vector<2x3xf32>) -> vector<2x3xf32> { %2 = vector.outerproduct %arg0, %arg1, %arg2 : vector<2xf32>, vector<3xf32> return %2 : vector<2x3xf32> } // CHECK-LABEL: llvm.func @outerproduct_add( -// CHECK-SAME: %[[A:.*]]: !llvm<"<2 x float>">, -// CHECK-SAME: %[[B:.*]]: !llvm<"<3 x float>">, -// CHECK-SAME: %[[C:.*]]: !llvm<"[2 x <3 x float>]">) +// CHECK-SAME: %[[A:.*]]: !llvm.vec<2 x float>, +// CHECK-SAME: %[[B:.*]]: !llvm.vec<3 x float>, +// CHECK-SAME: %[[C:.*]]: !llvm.array<2 x vec<3 x float>>) // CHECK: %[[T0:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<2x3xf32>) // CHECK: %[[T1:.*]] = llvm.mlir.constant(0 : i64) : !llvm.i64 -// CHECK: %[[T2:.*]] = llvm.extractelement %[[A]][%[[T1]] : !llvm.i64] : !llvm<"<2 x float>"> -// CHECK: %[[T3:.*]] = llvm.mlir.undef : !llvm<"<3 x float>"> +// CHECK: %[[T2:.*]] = llvm.extractelement %[[A]][%[[T1]] : !llvm.i64] : !llvm.vec<2 x float> +// CHECK: %[[T3:.*]] = llvm.mlir.undef : !llvm.vec<3 x float> // CHECK: %[[T4:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 -// CHECK: %[[T5:.*]] = llvm.insertelement %[[T2]], %[[T3]][%[[T4]] : !llvm.i32] : !llvm<"<3 x float>"> -// CHECK: %[[T6:.*]] = llvm.shufflevector %[[T5]], %[[T3]] [0 : i32, 0 : i32, 0 : i32] : !llvm<"<3 x float>">, !llvm<"<3 x float>"> -// CHECK: %[[T7:.*]] = llvm.extractvalue %[[C]][0] : !llvm<"[2 x <3 x float>]"> -// CHECK: %[[T8:.*]] = "llvm.intr.fmuladd"(%[[T6]], %[[B]], %[[T7]]) : (!llvm<"<3 x float>">, !llvm<"<3 x float>">, !llvm<"<3 x float>">) -// CHECK: %[[T9:.*]] = llvm.insertvalue %[[T8]], %[[T0]][0] : !llvm<"[2 x <3 x float>]"> +// CHECK: %[[T5:.*]] = llvm.insertelement %[[T2]], %[[T3]][%[[T4]] : !llvm.i32] : !llvm.vec<3 x float> +// CHECK: %[[T6:.*]] = llvm.shufflevector %[[T5]], %[[T3]] [0 : i32, 0 : i32, 0 : i32] : !llvm.vec<3 x float>, !llvm.vec<3 x float> +// CHECK: %[[T7:.*]] = llvm.extractvalue %[[C]][0] : !llvm.array<2 x vec<3 x float>> +// CHECK: %[[T8:.*]] = "llvm.intr.fmuladd"(%[[T6]], %[[B]], %[[T7]]) : (!llvm.vec<3 x float>, !llvm.vec<3 x float>, !llvm.vec<3 x float>) +// CHECK: %[[T9:.*]] = llvm.insertvalue %[[T8]], %[[T0]][0] : !llvm.array<2 x vec<3 x float>> // CHECK: %[[T10:.*]] = llvm.mlir.constant(1 : i64) : !llvm.i64 -// CHECK: %[[T11:.*]] = llvm.extractelement %[[A]][%[[T10]] : !llvm.i64] : !llvm<"<2 x float>"> -// CHECK: %[[T12:.*]] = llvm.mlir.undef : !llvm<"<3 x float>"> +// CHECK: %[[T11:.*]] = llvm.extractelement %[[A]][%[[T10]] : !llvm.i64] : !llvm.vec<2 x float> +// CHECK: %[[T12:.*]] = llvm.mlir.undef : !llvm.vec<3 x float> // CHECK: %[[T13:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 -// CHECK: %[[T14:.*]] = llvm.insertelement %[[T11]], %[[T12]][%[[T13]] : !llvm.i32] : !llvm<"<3 x float>"> -// CHECK: %[[T15:.*]] = llvm.shufflevector %[[T14]], %[[T12]] [0 : i32, 0 : i32, 0 : i32] : !llvm<"<3 x float>">, !llvm<"<3 x float>"> -// CHECK: %[[T16:.*]] = llvm.extractvalue %[[C]][1] : !llvm<"[2 x <3 x float>]"> -// CHECK: %[[T17:.*]] = "llvm.intr.fmuladd"(%[[T15]], %[[B]], %[[T16]]) : (!llvm<"<3 x float>">, !llvm<"<3 x float>">, !llvm<"<3 x float>">) -// CHECK: %[[T18:.*]] = llvm.insertvalue %[[T17]], %[[T9]][1] : !llvm<"[2 x <3 x float>]"> -// CHECK: llvm.return %[[T18]] : !llvm<"[2 x <3 x float>]"> +// CHECK: %[[T14:.*]] = llvm.insertelement %[[T11]], %[[T12]][%[[T13]] : !llvm.i32] : !llvm.vec<3 x float> +// CHECK: %[[T15:.*]] = llvm.shufflevector %[[T14]], %[[T12]] [0 : i32, 0 : i32, 0 : i32] : !llvm.vec<3 x float>, !llvm.vec<3 x float> +// CHECK: %[[T16:.*]] = llvm.extractvalue %[[C]][1] : !llvm.array<2 x vec<3 x float>> +// CHECK: %[[T17:.*]] = "llvm.intr.fmuladd"(%[[T15]], %[[B]], %[[T16]]) : (!llvm.vec<3 x float>, !llvm.vec<3 x float>, !llvm.vec<3 x float>) +// CHECK: %[[T18:.*]] = llvm.insertvalue %[[T17]], %[[T9]][1] : !llvm.array<2 x vec<3 x float>> +// CHECK: llvm.return %[[T18]] : !llvm.array<2 x vec<3 x float>> func @shuffle_1D_direct(%arg0: vector<2xf32>, %arg1: vector<2xf32>) -> vector<2xf32> { %1 = vector.shuffle %arg0, %arg1 [0, 1] : vector<2xf32>, vector<2xf32> return %1 : vector<2xf32> } // CHECK-LABEL: llvm.func @shuffle_1D_direct( -// CHECK-SAME: %[[A:.*]]: !llvm<"<2 x float>">, -// CHECK-SAME: %[[B:.*]]: !llvm<"<2 x float>">) -// CHECK: %[[s:.*]] = llvm.shufflevector %[[A]], %[[B]] [0, 1] : !llvm<"<2 x float>">, !llvm<"<2 x float>"> -// CHECK: llvm.return %[[s]] : !llvm<"<2 x float>"> +// CHECK-SAME: %[[A:.*]]: !llvm.vec<2 x float>, +// CHECK-SAME: %[[B:.*]]: !llvm.vec<2 x float>) +// CHECK: %[[s:.*]] = llvm.shufflevector %[[A]], %[[B]] [0, 1] : !llvm.vec<2 x float>, !llvm.vec<2 x float> +// CHECK: llvm.return %[[s]] : !llvm.vec<2 x float> func @shuffle_1D(%arg0: vector<2xf32>, %arg1: vector<3xf32>) -> vector<5xf32> { %1 = vector.shuffle %arg0, %arg1 [4, 3, 2, 1, 0] : vector<2xf32>, vector<3xf32> return %1 : vector<5xf32> } // CHECK-LABEL: llvm.func @shuffle_1D( -// CHECK-SAME: %[[A:.*]]: !llvm<"<2 x float>">, -// CHECK-SAME: %[[B:.*]]: !llvm<"<3 x float>">) -// CHECK: %[[u0:.*]] = llvm.mlir.undef : !llvm<"<5 x float>"> +// CHECK-SAME: %[[A:.*]]: !llvm.vec<2 x float>, +// CHECK-SAME: %[[B:.*]]: !llvm.vec<3 x float>) +// CHECK: %[[u0:.*]] = llvm.mlir.undef : !llvm.vec<5 x float> // CHECK: %[[c2:.*]] = llvm.mlir.constant(2 : index) : !llvm.i64 -// CHECK: %[[e1:.*]] = llvm.extractelement %[[B]][%[[c2]] : !llvm.i64] : !llvm<"<3 x float>"> +// CHECK: %[[e1:.*]] = llvm.extractelement %[[B]][%[[c2]] : !llvm.i64] : !llvm.vec<3 x float> // CHECK: %[[c0:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK: %[[i1:.*]] = llvm.insertelement %[[e1]], %[[u0]][%[[c0]] : !llvm.i64] : !llvm<"<5 x float>"> +// CHECK: %[[i1:.*]] = llvm.insertelement %[[e1]], %[[u0]][%[[c0]] : !llvm.i64] : !llvm.vec<5 x float> // CHECK: %[[c1:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK: %[[e2:.*]] = llvm.extractelement %[[B]][%[[c1]] : !llvm.i64] : !llvm<"<3 x float>"> +// CHECK: %[[e2:.*]] = llvm.extractelement %[[B]][%[[c1]] : !llvm.i64] : !llvm.vec<3 x float> // CHECK: %[[c1:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK: %[[i2:.*]] = llvm.insertelement %[[e2]], %[[i1]][%[[c1]] : !llvm.i64] : !llvm<"<5 x float>"> +// CHECK: %[[i2:.*]] = llvm.insertelement %[[e2]], %[[i1]][%[[c1]] : !llvm.i64] : !llvm.vec<5 x float> // CHECK: %[[c0:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK: %[[e3:.*]] = llvm.extractelement %[[B]][%[[c0]] : !llvm.i64] : !llvm<"<3 x float>"> +// CHECK: %[[e3:.*]] = llvm.extractelement %[[B]][%[[c0]] : !llvm.i64] : !llvm.vec<3 x float> // CHECK: %[[c2:.*]] = llvm.mlir.constant(2 : index) : !llvm.i64 -// CHECK: %[[i3:.*]] = llvm.insertelement %[[e3]], %[[i2]][%[[c2]] : !llvm.i64] : !llvm<"<5 x float>"> +// CHECK: %[[i3:.*]] = llvm.insertelement %[[e3]], %[[i2]][%[[c2]] : !llvm.i64] : !llvm.vec<5 x float> // CHECK: %[[c1:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK: %[[e4:.*]] = llvm.extractelement %[[A]][%[[c1]] : !llvm.i64] : !llvm<"<2 x float>"> +// CHECK: %[[e4:.*]] = llvm.extractelement %[[A]][%[[c1]] : !llvm.i64] : !llvm.vec<2 x float> // CHECK: %[[c3:.*]] = llvm.mlir.constant(3 : index) : !llvm.i64 -// CHECK: %[[i4:.*]] = llvm.insertelement %[[e4]], %[[i3]][%[[c3]] : !llvm.i64] : !llvm<"<5 x float>"> +// CHECK: %[[i4:.*]] = llvm.insertelement %[[e4]], %[[i3]][%[[c3]] : !llvm.i64] : !llvm.vec<5 x float> // CHECK: %[[c0:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK: %[[e5:.*]] = llvm.extractelement %[[A]][%[[c0]] : !llvm.i64] : !llvm<"<2 x float>"> +// CHECK: %[[e5:.*]] = llvm.extractelement %[[A]][%[[c0]] : !llvm.i64] : !llvm.vec<2 x float> // CHECK: %[[c4:.*]] = llvm.mlir.constant(4 : index) : !llvm.i64 -// CHECK: %[[i5:.*]] = llvm.insertelement %[[e5]], %[[i4]][%[[c4]] : !llvm.i64] : !llvm<"<5 x float>"> -// CHECK: llvm.return %[[i5]] : !llvm<"<5 x float>"> +// CHECK: %[[i5:.*]] = llvm.insertelement %[[e5]], %[[i4]][%[[c4]] : !llvm.i64] : !llvm.vec<5 x float> +// CHECK: llvm.return %[[i5]] : !llvm.vec<5 x float> func @shuffle_2D(%a: vector<1x4xf32>, %b: vector<2x4xf32>) -> vector<3x4xf32> { %1 = vector.shuffle %a, %b[1, 0, 2] : vector<1x4xf32>, vector<2x4xf32> return %1 : vector<3x4xf32> } // CHECK-LABEL: llvm.func @shuffle_2D( -// CHECK-SAME: %[[A:.*]]: !llvm<"[1 x <4 x float>]">, -// CHECK-SAME: %[[B:.*]]: !llvm<"[2 x <4 x float>]">) -// CHECK: %[[u0:.*]] = llvm.mlir.undef : !llvm<"[3 x <4 x float>]"> -// CHECK: %[[e1:.*]] = llvm.extractvalue %[[B]][0] : !llvm<"[2 x <4 x float>]"> -// CHECK: %[[i1:.*]] = llvm.insertvalue %[[e1]], %[[u0]][0] : !llvm<"[3 x <4 x float>]"> -// CHECK: %[[e2:.*]] = llvm.extractvalue %[[A]][0] : !llvm<"[1 x <4 x float>]"> -// CHECK: %[[i2:.*]] = llvm.insertvalue %[[e2]], %[[i1]][1] : !llvm<"[3 x <4 x float>]"> -// CHECK: %[[e3:.*]] = llvm.extractvalue %[[B]][1] : !llvm<"[2 x <4 x float>]"> -// CHECK: %[[i3:.*]] = llvm.insertvalue %[[e3]], %[[i2]][2] : !llvm<"[3 x <4 x float>]"> -// CHECK: llvm.return %[[i3]] : !llvm<"[3 x <4 x float>]"> +// CHECK-SAME: %[[A:.*]]: !llvm.array<1 x vec<4 x float>>, +// CHECK-SAME: %[[B:.*]]: !llvm.array<2 x vec<4 x float>>) +// CHECK: %[[u0:.*]] = llvm.mlir.undef : !llvm.array<3 x vec<4 x float>> +// CHECK: %[[e1:.*]] = llvm.extractvalue %[[B]][0] : !llvm.array<2 x vec<4 x float>> +// CHECK: %[[i1:.*]] = llvm.insertvalue %[[e1]], %[[u0]][0] : !llvm.array<3 x vec<4 x float>> +// CHECK: %[[e2:.*]] = llvm.extractvalue %[[A]][0] : !llvm.array<1 x vec<4 x float>> +// CHECK: %[[i2:.*]] = llvm.insertvalue %[[e2]], %[[i1]][1] : !llvm.array<3 x vec<4 x float>> +// CHECK: %[[e3:.*]] = llvm.extractvalue %[[B]][1] : !llvm.array<2 x vec<4 x float>> +// CHECK: %[[i3:.*]] = llvm.insertvalue %[[e3]], %[[i2]][2] : !llvm.array<3 x vec<4 x float>> +// CHECK: llvm.return %[[i3]] : !llvm.array<3 x vec<4 x float>> func @extract_element(%arg0: vector<16xf32>) -> f32 { %0 = constant 15 : i32 @@ -311,9 +311,9 @@ return %1 : f32 } // CHECK-LABEL: llvm.func @extract_element( -// CHECK-SAME: %[[A:.*]]: !llvm<"<16 x float>">) +// CHECK-SAME: %[[A:.*]]: !llvm.vec<16 x float>) // CHECK: %[[c:.*]] = llvm.mlir.constant(15 : i32) : !llvm.i32 -// CHECK: %[[x:.*]] = llvm.extractelement %[[A]][%[[c]] : !llvm.i32] : !llvm<"<16 x float>"> +// CHECK: %[[x:.*]] = llvm.extractelement %[[A]][%[[c]] : !llvm.i32] : !llvm.vec<16 x float> // CHECK: llvm.return %[[x]] : !llvm.float func @extract_element_from_vec_1d(%arg0: vector<16xf32>) -> f32 { @@ -322,7 +322,7 @@ } // CHECK-LABEL: llvm.func @extract_element_from_vec_1d // CHECK: llvm.mlir.constant(15 : i64) : !llvm.i64 -// CHECK: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<16 x float>"> +// CHECK: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<16 x float> // CHECK: llvm.return {{.*}} : !llvm.float func @extract_vec_2d_from_vec_3d(%arg0: vector<4x3x16xf32>) -> vector<3x16xf32> { @@ -330,25 +330,25 @@ return %0 : vector<3x16xf32> } // CHECK-LABEL: llvm.func @extract_vec_2d_from_vec_3d -// CHECK: llvm.extractvalue {{.*}}[0] : !llvm<"[4 x [3 x <16 x float>]]"> -// CHECK: llvm.return {{.*}} : !llvm<"[3 x <16 x float>]"> +// CHECK: llvm.extractvalue {{.*}}[0] : !llvm.array<4 x array<3 x vec<16 x float>>> +// CHECK: llvm.return {{.*}} : !llvm.array<3 x vec<16 x float>> func @extract_vec_1d_from_vec_3d(%arg0: vector<4x3x16xf32>) -> vector<16xf32> { %0 = vector.extract %arg0[0, 0]: vector<4x3x16xf32> return %0 : vector<16xf32> } // CHECK-LABEL: llvm.func @extract_vec_1d_from_vec_3d -// CHECK: llvm.extractvalue {{.*}}[0, 0] : !llvm<"[4 x [3 x <16 x float>]]"> -// CHECK: llvm.return {{.*}} : !llvm<"<16 x float>"> +// CHECK: llvm.extractvalue {{.*}}[0, 0] : !llvm.array<4 x array<3 x vec<16 x float>>> +// CHECK: llvm.return {{.*}} : !llvm.vec<16 x float> func @extract_element_from_vec_3d(%arg0: vector<4x3x16xf32>) -> f32 { %0 = vector.extract %arg0[0, 0, 0]: vector<4x3x16xf32> return %0 : f32 } // CHECK-LABEL: llvm.func @extract_element_from_vec_3d -// CHECK: llvm.extractvalue {{.*}}[0, 0] : !llvm<"[4 x [3 x <16 x float>]]"> +// CHECK: llvm.extractvalue {{.*}}[0, 0] : !llvm.array<4 x array<3 x vec<16 x float>>> // CHECK: llvm.mlir.constant(0 : i64) : !llvm.i64 -// CHECK: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<16 x float>"> +// CHECK: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<16 x float> // CHECK: llvm.return {{.*}} : !llvm.float func @insert_element(%arg0: f32, %arg1: vector<4xf32>) -> vector<4xf32> { @@ -358,10 +358,10 @@ } // CHECK-LABEL: llvm.func @insert_element( // CHECK-SAME: %[[A:.*]]: !llvm.float, -// CHECK-SAME: %[[B:.*]]: !llvm<"<4 x float>">) +// CHECK-SAME: %[[B:.*]]: !llvm.vec<4 x float>) // CHECK: %[[c:.*]] = llvm.mlir.constant(3 : i32) : !llvm.i32 -// CHECK: %[[x:.*]] = llvm.insertelement %[[A]], %[[B]][%[[c]] : !llvm.i32] : !llvm<"<4 x float>"> -// CHECK: llvm.return %[[x]] : !llvm<"<4 x float>"> +// CHECK: %[[x:.*]] = llvm.insertelement %[[A]], %[[B]][%[[c]] : !llvm.i32] : !llvm.vec<4 x float> +// CHECK: llvm.return %[[x]] : !llvm.vec<4 x float> func @insert_element_into_vec_1d(%arg0: f32, %arg1: vector<4xf32>) -> vector<4xf32> { %0 = vector.insert %arg0, %arg1[3] : f32 into vector<4xf32> @@ -369,65 +369,65 @@ } // CHECK-LABEL: llvm.func @insert_element_into_vec_1d // CHECK: llvm.mlir.constant(3 : i64) : !llvm.i64 -// CHECK: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<4 x float>"> -// CHECK: llvm.return {{.*}} : !llvm<"<4 x float>"> +// CHECK: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<4 x float> +// CHECK: llvm.return {{.*}} : !llvm.vec<4 x float> func @insert_vec_2d_into_vec_3d(%arg0: vector<8x16xf32>, %arg1: vector<4x8x16xf32>) -> vector<4x8x16xf32> { %0 = vector.insert %arg0, %arg1[3] : vector<8x16xf32> into vector<4x8x16xf32> return %0 : vector<4x8x16xf32> } // CHECK-LABEL: llvm.func @insert_vec_2d_into_vec_3d -// CHECK: llvm.insertvalue {{.*}}, {{.*}}[3] : !llvm<"[4 x [8 x <16 x float>]]"> -// CHECK: llvm.return {{.*}} : !llvm<"[4 x [8 x <16 x float>]]"> +// CHECK: llvm.insertvalue {{.*}}, {{.*}}[3] : !llvm.array<4 x array<8 x vec<16 x float>>> +// CHECK: llvm.return {{.*}} : !llvm.array<4 x array<8 x vec<16 x float>>> func @insert_vec_1d_into_vec_3d(%arg0: vector<16xf32>, %arg1: vector<4x8x16xf32>) -> vector<4x8x16xf32> { %0 = vector.insert %arg0, %arg1[3, 7] : vector<16xf32> into vector<4x8x16xf32> return %0 : vector<4x8x16xf32> } // CHECK-LABEL: llvm.func @insert_vec_1d_into_vec_3d -// CHECK: llvm.insertvalue {{.*}}, {{.*}}[3, 7] : !llvm<"[4 x [8 x <16 x float>]]"> -// CHECK: llvm.return {{.*}} : !llvm<"[4 x [8 x <16 x float>]]"> +// CHECK: llvm.insertvalue {{.*}}, {{.*}}[3, 7] : !llvm.array<4 x array<8 x vec<16 x float>>> +// CHECK: llvm.return {{.*}} : !llvm.array<4 x array<8 x vec<16 x float>>> func @insert_element_into_vec_3d(%arg0: f32, %arg1: vector<4x8x16xf32>) -> vector<4x8x16xf32> { %0 = vector.insert %arg0, %arg1[3, 7, 15] : f32 into vector<4x8x16xf32> return %0 : vector<4x8x16xf32> } // CHECK-LABEL: llvm.func @insert_element_into_vec_3d -// CHECK: llvm.extractvalue {{.*}}[3, 7] : !llvm<"[4 x [8 x <16 x float>]]"> +// CHECK: llvm.extractvalue {{.*}}[3, 7] : !llvm.array<4 x array<8 x vec<16 x float>>> // CHECK: llvm.mlir.constant(15 : i64) : !llvm.i64 -// CHECK: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<16 x float>"> -// CHECK: llvm.insertvalue {{.*}}, {{.*}}[3, 7] : !llvm<"[4 x [8 x <16 x float>]]"> -// CHECK: llvm.return {{.*}} : !llvm<"[4 x [8 x <16 x float>]]"> +// CHECK: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<16 x float> +// CHECK: llvm.insertvalue {{.*}}, {{.*}}[3, 7] : !llvm.array<4 x array<8 x vec<16 x float>>> +// CHECK: llvm.return {{.*}} : !llvm.array<4 x array<8 x vec<16 x float>>> func @vector_type_cast(%arg0: memref<8x8x8xf32>) -> memref> { %0 = vector.type_cast %arg0: memref<8x8x8xf32> to memref> return %0 : memref> } // CHECK-LABEL: llvm.func @vector_type_cast -// CHECK: llvm.mlir.undef : !llvm<"{ [8 x [8 x <8 x float>]]*, [8 x [8 x <8 x float>]]*, i64 }"> -// CHECK: %[[allocated:.*]] = llvm.extractvalue {{.*}}[0] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK: %[[allocatedBit:.*]] = llvm.bitcast %[[allocated]] : !llvm<"float*"> to !llvm<"[8 x [8 x <8 x float>]]*"> -// CHECK: llvm.insertvalue %[[allocatedBit]], {{.*}}[0] : !llvm<"{ [8 x [8 x <8 x float>]]*, [8 x [8 x <8 x float>]]*, i64 }"> -// CHECK: %[[aligned:.*]] = llvm.extractvalue {{.*}}[1] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK: %[[alignedBit:.*]] = llvm.bitcast %[[aligned]] : !llvm<"float*"> to !llvm<"[8 x [8 x <8 x float>]]*"> -// CHECK: llvm.insertvalue %[[alignedBit]], {{.*}}[1] : !llvm<"{ [8 x [8 x <8 x float>]]*, [8 x [8 x <8 x float>]]*, i64 }"> +// CHECK: llvm.mlir.undef : !llvm.struct<(ptr>>>, ptr>>>, i64)> +// CHECK: %[[allocated:.*]] = llvm.extractvalue {{.*}}[0] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK: %[[allocatedBit:.*]] = llvm.bitcast %[[allocated]] : !llvm.ptr to !llvm.ptr>>> +// CHECK: llvm.insertvalue %[[allocatedBit]], {{.*}}[0] : !llvm.struct<(ptr>>>, ptr>>>, i64)> +// CHECK: %[[aligned:.*]] = llvm.extractvalue {{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK: %[[alignedBit:.*]] = llvm.bitcast %[[aligned]] : !llvm.ptr to !llvm.ptr>>> +// CHECK: llvm.insertvalue %[[alignedBit]], {{.*}}[1] : !llvm.struct<(ptr>>>, ptr>>>, i64)> // CHECK: llvm.mlir.constant(0 : index -// CHECK: llvm.insertvalue {{.*}}[2] : !llvm<"{ [8 x [8 x <8 x float>]]*, [8 x [8 x <8 x float>]]*, i64 }"> +// CHECK: llvm.insertvalue {{.*}}[2] : !llvm.struct<(ptr>>>, ptr>>>, i64)> func @vector_type_cast_non_zero_addrspace(%arg0: memref<8x8x8xf32, 3>) -> memref, 3> { %0 = vector.type_cast %arg0: memref<8x8x8xf32, 3> to memref, 3> return %0 : memref, 3> } // CHECK-LABEL: llvm.func @vector_type_cast_non_zero_addrspace -// CHECK: llvm.mlir.undef : !llvm<"{ [8 x [8 x <8 x float>]] addrspace(3)*, [8 x [8 x <8 x float>]] addrspace(3)*, i64 }"> -// CHECK: %[[allocated:.*]] = llvm.extractvalue {{.*}}[0] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i64, [3 x i64], [3 x i64] }"> -// CHECK: %[[allocatedBit:.*]] = llvm.bitcast %[[allocated]] : !llvm<"float addrspace(3)*"> to !llvm<"[8 x [8 x <8 x float>]] addrspace(3)*"> -// CHECK: llvm.insertvalue %[[allocatedBit]], {{.*}}[0] : !llvm<"{ [8 x [8 x <8 x float>]] addrspace(3)*, [8 x [8 x <8 x float>]] addrspace(3)*, i64 }"> -// CHECK: %[[aligned:.*]] = llvm.extractvalue {{.*}}[1] : !llvm<"{ float addrspace(3)*, float addrspace(3)*, i64, [3 x i64], [3 x i64] }"> -// CHECK: %[[alignedBit:.*]] = llvm.bitcast %[[aligned]] : !llvm<"float addrspace(3)*"> to !llvm<"[8 x [8 x <8 x float>]] addrspace(3)*"> -// CHECK: llvm.insertvalue %[[alignedBit]], {{.*}}[1] : !llvm<"{ [8 x [8 x <8 x float>]] addrspace(3)*, [8 x [8 x <8 x float>]] addrspace(3)*, i64 }"> +// CHECK: llvm.mlir.undef : !llvm.struct<(ptr>>, 3>, ptr>>, 3>, i64)> +// CHECK: %[[allocated:.*]] = llvm.extractvalue {{.*}}[0] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK: %[[allocatedBit:.*]] = llvm.bitcast %[[allocated]] : !llvm.ptr to !llvm.ptr>>, 3> +// CHECK: llvm.insertvalue %[[allocatedBit]], {{.*}}[0] : !llvm.struct<(ptr>>, 3>, ptr>>, 3>, i64)> +// CHECK: %[[aligned:.*]] = llvm.extractvalue {{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK: %[[alignedBit:.*]] = llvm.bitcast %[[aligned]] : !llvm.ptr to !llvm.ptr>>, 3> +// CHECK: llvm.insertvalue %[[alignedBit]], {{.*}}[1] : !llvm.struct<(ptr>>, 3>, ptr>>, 3>, i64)> // CHECK: llvm.mlir.constant(0 : index -// CHECK: llvm.insertvalue {{.*}}[2] : !llvm<"{ [8 x [8 x <8 x float>]] addrspace(3)*, [8 x [8 x <8 x float>]] addrspace(3)*, i64 }"> +// CHECK: llvm.insertvalue {{.*}}[2] : !llvm.struct<(ptr>>, 3>, ptr>>, 3>, i64)> func @vector_print_scalar_i1(%arg0: i1) { vector.print %arg0 : i1 @@ -482,27 +482,27 @@ return } // CHECK-LABEL: llvm.func @vector_print_vector( -// CHECK-SAME: %[[A:.*]]: !llvm<"[2 x <2 x float>]">) +// CHECK-SAME: %[[A:.*]]: !llvm.array<2 x vec<2 x float>>) // CHECK: llvm.call @print_open() : () -> () -// CHECK: %[[x0:.*]] = llvm.extractvalue %[[A]][0] : !llvm<"[2 x <2 x float>]"> +// CHECK: %[[x0:.*]] = llvm.extractvalue %[[A]][0] : !llvm.array<2 x vec<2 x float>> // CHECK: llvm.call @print_open() : () -> () // CHECK: %[[x1:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK: %[[x2:.*]] = llvm.extractelement %[[x0]][%[[x1]] : !llvm.i64] : !llvm<"<2 x float>"> +// CHECK: %[[x2:.*]] = llvm.extractelement %[[x0]][%[[x1]] : !llvm.i64] : !llvm.vec<2 x float> // CHECK: llvm.call @print_f32(%[[x2]]) : (!llvm.float) -> () // CHECK: llvm.call @print_comma() : () -> () // CHECK: %[[x3:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK: %[[x4:.*]] = llvm.extractelement %[[x0]][%[[x3]] : !llvm.i64] : !llvm<"<2 x float>"> +// CHECK: %[[x4:.*]] = llvm.extractelement %[[x0]][%[[x3]] : !llvm.i64] : !llvm.vec<2 x float> // CHECK: llvm.call @print_f32(%[[x4]]) : (!llvm.float) -> () // CHECK: llvm.call @print_close() : () -> () // CHECK: llvm.call @print_comma() : () -> () -// CHECK: %[[x5:.*]] = llvm.extractvalue %[[A]][1] : !llvm<"[2 x <2 x float>]"> +// CHECK: %[[x5:.*]] = llvm.extractvalue %[[A]][1] : !llvm.array<2 x vec<2 x float>> // CHECK: llvm.call @print_open() : () -> () // CHECK: %[[x6:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK: %[[x7:.*]] = llvm.extractelement %[[x5]][%[[x6]] : !llvm.i64] : !llvm<"<2 x float>"> +// CHECK: %[[x7:.*]] = llvm.extractelement %[[x5]][%[[x6]] : !llvm.i64] : !llvm.vec<2 x float> // CHECK: llvm.call @print_f32(%[[x7]]) : (!llvm.float) -> () // CHECK: llvm.call @print_comma() : () -> () // CHECK: %[[x8:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK: %[[x9:.*]] = llvm.extractelement %[[x5]][%[[x8]] : !llvm.i64] : !llvm<"<2 x float>"> +// CHECK: %[[x9:.*]] = llvm.extractelement %[[x5]][%[[x8]] : !llvm.i64] : !llvm.vec<2 x float> // CHECK: llvm.call @print_f32(%[[x9]]) : (!llvm.float) -> () // CHECK: llvm.call @print_close() : () -> () // CHECK: llvm.call @print_close() : () -> () @@ -514,15 +514,15 @@ } // CHECK-LABEL: llvm.func @extract_strided_slice1 // CHECK: llvm.mlir.constant(0.000000e+00 : f32) : !llvm.float -// CHECK: llvm.mlir.constant(dense<0.000000e+00> : vector<2xf32>) : !llvm<"<2 x float>"> +// CHECK: llvm.mlir.constant(dense<0.000000e+00> : vector<2xf32>) : !llvm.vec<2 x float> // CHECK: llvm.mlir.constant(2 : index) : !llvm.i64 -// CHECK: llvm.extractelement %{{.*}}[%{{.*}} : !llvm.i64] : !llvm<"<4 x float>"> +// CHECK: llvm.extractelement %{{.*}}[%{{.*}} : !llvm.i64] : !llvm.vec<4 x float> // CHECK: llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK: llvm.insertelement %{{.*}}, %{{.*}}[%{{.*}} : !llvm.i64] : !llvm<"<2 x float>"> +// CHECK: llvm.insertelement %{{.*}}, %{{.*}}[%{{.*}} : !llvm.i64] : !llvm.vec<2 x float> // CHECK: llvm.mlir.constant(3 : index) : !llvm.i64 -// CHECK: llvm.extractelement %{{.*}}[%{{.*}} : !llvm.i64] : !llvm<"<4 x float>"> +// CHECK: llvm.extractelement %{{.*}}[%{{.*}} : !llvm.i64] : !llvm.vec<4 x float> // CHECK: llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK: llvm.insertelement %{{.*}}, %{{.*}}[%{{.*}} : !llvm.i64] : !llvm<"<2 x float>"> +// CHECK: llvm.insertelement %{{.*}}, %{{.*}}[%{{.*}} : !llvm.i64] : !llvm.vec<2 x float> func @extract_strided_slice2(%arg0: vector<4x8xf32>) -> vector<2x8xf32> { %0 = vector.extract_strided_slice %arg0 {offsets = [2], sizes = [2], strides = [1]} : vector<4x8xf32> to vector<2x8xf32> @@ -530,11 +530,11 @@ } // CHECK-LABEL: llvm.func @extract_strided_slice2 // CHECK: llvm.mlir.constant(0.000000e+00 : f32) : !llvm.float -// CHECK: llvm.mlir.constant(dense<0.000000e+00> : vector<2x8xf32>) : !llvm<"[2 x <8 x float>]"> -// CHECK: llvm.extractvalue %{{.*}}[2] : !llvm<"[4 x <8 x float>]"> -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"[2 x <8 x float>]"> -// CHECK: llvm.extractvalue %{{.*}}[3] : !llvm<"[4 x <8 x float>]"> -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"[2 x <8 x float>]"> +// CHECK: llvm.mlir.constant(dense<0.000000e+00> : vector<2x8xf32>) : !llvm.array<2 x vec<8 x float>> +// CHECK: llvm.extractvalue %{{.*}}[2] : !llvm.array<4 x vec<8 x float>> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm.array<2 x vec<8 x float>> +// CHECK: llvm.extractvalue %{{.*}}[3] : !llvm.array<4 x vec<8 x float>> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm.array<2 x vec<8 x float>> func @extract_strided_slice3(%arg0: vector<4x8xf32>) -> vector<2x2xf32> { %0 = vector.extract_strided_slice %arg0 {offsets = [2, 2], sizes = [2, 2], strides = [1, 1]} : vector<4x8xf32> to vector<2x2xf32> @@ -542,43 +542,43 @@ } // CHECK-LABEL: llvm.func @extract_strided_slice3 // CHECK: llvm.mlir.constant(0.000000e+00 : f32) : !llvm.float -// CHECK: llvm.mlir.constant(dense<0.000000e+00> : vector<2x2xf32>) : !llvm<"[2 x <2 x float>]"> +// CHECK: llvm.mlir.constant(dense<0.000000e+00> : vector<2x2xf32>) : !llvm.array<2 x vec<2 x float>> // // Subvector vector<8xf32> @2 -// CHECK: llvm.extractvalue {{.*}}[2] : !llvm<"[4 x <8 x float>]"> +// CHECK: llvm.extractvalue {{.*}}[2] : !llvm.array<4 x vec<8 x float>> // CHECK: llvm.mlir.constant(0.000000e+00 : f32) : !llvm.float -// CHECK: llvm.mlir.constant(dense<0.000000e+00> : vector<2xf32>) : !llvm<"<2 x float>"> +// CHECK: llvm.mlir.constant(dense<0.000000e+00> : vector<2xf32>) : !llvm.vec<2 x float> // CHECK: llvm.mlir.constant(2 : index) : !llvm.i64 -// CHECK: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<8 x float>"> +// CHECK: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<8 x float> // CHECK: llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<2 x float>"> +// CHECK: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<2 x float> // CHECK: llvm.mlir.constant(3 : index) : !llvm.i64 -// CHECK: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<8 x float>"> +// CHECK: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<8 x float> // CHECK: llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<2 x float>"> -// CHECK: llvm.insertvalue {{.*}}, {{.*}}[0] : !llvm<"[2 x <2 x float>]"> +// CHECK: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<2 x float> +// CHECK: llvm.insertvalue {{.*}}, {{.*}}[0] : !llvm.array<2 x vec<2 x float>> // // Subvector vector<8xf32> @3 -// CHECK: llvm.extractvalue {{.*}}[3] : !llvm<"[4 x <8 x float>]"> +// CHECK: llvm.extractvalue {{.*}}[3] : !llvm.array<4 x vec<8 x float>> // CHECK: llvm.mlir.constant(0.000000e+00 : f32) : !llvm.float -// CHECK: llvm.mlir.constant(dense<0.000000e+00> : vector<2xf32>) : !llvm<"<2 x float>"> +// CHECK: llvm.mlir.constant(dense<0.000000e+00> : vector<2xf32>) : !llvm.vec<2 x float> // CHECK: llvm.mlir.constant(2 : index) : !llvm.i64 -// CHECK: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<8 x float>"> +// CHECK: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<8 x float> // CHECK: llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<2 x float>"> +// CHECK: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<2 x float> // CHECK: llvm.mlir.constant(3 : index) : !llvm.i64 -// CHECK: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<8 x float>"> +// CHECK: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<8 x float> // CHECK: llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<2 x float>"> -// CHECK: llvm.insertvalue {{.*}}, {{.*}}[1] : !llvm<"[2 x <2 x float>]"> +// CHECK: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<2 x float> +// CHECK: llvm.insertvalue {{.*}}, {{.*}}[1] : !llvm.array<2 x vec<2 x float>> func @insert_strided_slice1(%b: vector<4x4xf32>, %c: vector<4x4x4xf32>) -> vector<4x4x4xf32> { %0 = vector.insert_strided_slice %b, %c {offsets = [2, 0, 0], strides = [1, 1]} : vector<4x4xf32> into vector<4x4x4xf32> return %0 : vector<4x4x4xf32> } // CHECK-LABEL: llvm.func @insert_strided_slice1 -// CHECK: llvm.extractvalue {{.*}}[2] : !llvm<"[4 x [4 x <4 x float>]]"> -// CHECK-NEXT: llvm.insertvalue {{.*}}, {{.*}}[2] : !llvm<"[4 x [4 x <4 x float>]]"> +// CHECK: llvm.extractvalue {{.*}}[2] : !llvm.array<4 x array<4 x vec<4 x float>>> +// CHECK-NEXT: llvm.insertvalue {{.*}}, {{.*}}[2] : !llvm.array<4 x array<4 x vec<4 x float>>> func @insert_strided_slice2(%a: vector<2x2xf32>, %b: vector<4x4xf32>) -> vector<4x4xf32> { %0 = vector.insert_strided_slice %a, %b {offsets = [2, 2], strides = [1, 1]} : vector<2x2xf32> into vector<4x4xf32> @@ -587,34 +587,34 @@ // CHECK-LABEL: llvm.func @insert_strided_slice2 // // Subvector vector<2xf32> @0 into vector<4xf32> @2 -// CHECK: llvm.extractvalue {{.*}}[0] : !llvm<"[2 x <2 x float>]"> -// CHECK-NEXT: llvm.extractvalue {{.*}}[2] : !llvm<"[4 x <4 x float>]"> +// CHECK: llvm.extractvalue {{.*}}[0] : !llvm.array<2 x vec<2 x float>> +// CHECK-NEXT: llvm.extractvalue {{.*}}[2] : !llvm.array<4 x vec<4 x float>> // Element @0 -> element @2 // CHECK-NEXT: llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK-NEXT: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<2 x float>"> +// CHECK-NEXT: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<2 x float> // CHECK-NEXT: llvm.mlir.constant(2 : index) : !llvm.i64 -// CHECK-NEXT: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<4 x float>"> +// CHECK-NEXT: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<4 x float> // Element @1 -> element @3 // CHECK-NEXT: llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK-NEXT: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<2 x float>"> +// CHECK-NEXT: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<2 x float> // CHECK-NEXT: llvm.mlir.constant(3 : index) : !llvm.i64 -// CHECK-NEXT: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<4 x float>"> -// CHECK-NEXT: llvm.insertvalue {{.*}}, {{.*}}[2] : !llvm<"[4 x <4 x float>]"> +// CHECK-NEXT: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<4 x float> +// CHECK-NEXT: llvm.insertvalue {{.*}}, {{.*}}[2] : !llvm.array<4 x vec<4 x float>> // // Subvector vector<2xf32> @1 into vector<4xf32> @3 -// CHECK: llvm.extractvalue {{.*}}[1] : !llvm<"[2 x <2 x float>]"> -// CHECK-NEXT: llvm.extractvalue {{.*}}[3] : !llvm<"[4 x <4 x float>]"> +// CHECK: llvm.extractvalue {{.*}}[1] : !llvm.array<2 x vec<2 x float>> +// CHECK-NEXT: llvm.extractvalue {{.*}}[3] : !llvm.array<4 x vec<4 x float>> // Element @0 -> element @2 // CHECK-NEXT: llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK-NEXT: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<2 x float>"> +// CHECK-NEXT: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<2 x float> // CHECK-NEXT: llvm.mlir.constant(2 : index) : !llvm.i64 -// CHECK-NEXT: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<4 x float>"> +// CHECK-NEXT: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<4 x float> // Element @1 -> element @3 // CHECK-NEXT: llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK-NEXT: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<2 x float>"> +// CHECK-NEXT: llvm.extractelement {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<2 x float> // CHECK-NEXT: llvm.mlir.constant(3 : index) : !llvm.i64 -// CHECK-NEXT: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm<"<4 x float>"> -// CHECK-NEXT: llvm.insertvalue {{.*}}, {{.*}}[3] : !llvm<"[4 x <4 x float>]"> +// CHECK-NEXT: llvm.insertelement {{.*}}, {{.*}}[{{.*}} : !llvm.i64] : !llvm.vec<4 x float> +// CHECK-NEXT: llvm.insertvalue {{.*}}, {{.*}}[3] : !llvm.array<4 x vec<4 x float>> func @insert_strided_slice3(%arg0: vector<2x4xf32>, %arg1: vector<16x4x8xf32>) -> vector<16x4x8xf32> { %0 = vector.insert_strided_slice %arg0, %arg1 {offsets = [0, 0, 2], strides = [1, 1]}: @@ -622,49 +622,49 @@ return %0 : vector<16x4x8xf32> } // CHECK-LABEL: llvm.func @insert_strided_slice3( -// CHECK-SAME: %[[A:.*]]: !llvm<"[2 x <4 x float>]">, -// CHECK-SAME: %[[B:.*]]: !llvm<"[16 x [4 x <8 x float>]]">) -// CHECK: %[[s0:.*]] = llvm.extractvalue %[[B]][0] : !llvm<"[16 x [4 x <8 x float>]]"> -// CHECK: %[[s1:.*]] = llvm.extractvalue %[[A]][0] : !llvm<"[2 x <4 x float>]"> -// CHECK: %[[s2:.*]] = llvm.extractvalue %[[B]][0, 0] : !llvm<"[16 x [4 x <8 x float>]]"> +// CHECK-SAME: %[[A:.*]]: !llvm.array<2 x vec<4 x float>>, +// CHECK-SAME: %[[B:.*]]: !llvm.array<16 x array<4 x vec<8 x float>>>) +// CHECK: %[[s0:.*]] = llvm.extractvalue %[[B]][0] : !llvm.array<16 x array<4 x vec<8 x float>>> +// CHECK: %[[s1:.*]] = llvm.extractvalue %[[A]][0] : !llvm.array<2 x vec<4 x float>> +// CHECK: %[[s2:.*]] = llvm.extractvalue %[[B]][0, 0] : !llvm.array<16 x array<4 x vec<8 x float>>> // CHECK: %[[s3:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK: %[[s4:.*]] = llvm.extractelement %[[s1]][%[[s3]] : !llvm.i64] : !llvm<"<4 x float>"> +// CHECK: %[[s4:.*]] = llvm.extractelement %[[s1]][%[[s3]] : !llvm.i64] : !llvm.vec<4 x float> // CHECK: %[[s5:.*]] = llvm.mlir.constant(2 : index) : !llvm.i64 -// CHECK: %[[s6:.*]] = llvm.insertelement %[[s4]], %[[s2]][%[[s5]] : !llvm.i64] : !llvm<"<8 x float>"> +// CHECK: %[[s6:.*]] = llvm.insertelement %[[s4]], %[[s2]][%[[s5]] : !llvm.i64] : !llvm.vec<8 x float> // CHECK: %[[s7:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK: %[[s8:.*]] = llvm.extractelement %[[s1]][%[[s7]] : !llvm.i64] : !llvm<"<4 x float>"> +// CHECK: %[[s8:.*]] = llvm.extractelement %[[s1]][%[[s7]] : !llvm.i64] : !llvm.vec<4 x float> // CHECK: %[[s9:.*]] = llvm.mlir.constant(3 : index) : !llvm.i64 -// CHECK: %[[s10:.*]] = llvm.insertelement %[[s8]], %[[s6]][%[[s9]] : !llvm.i64] : !llvm<"<8 x float>"> +// CHECK: %[[s10:.*]] = llvm.insertelement %[[s8]], %[[s6]][%[[s9]] : !llvm.i64] : !llvm.vec<8 x float> // CHECK: %[[s11:.*]] = llvm.mlir.constant(2 : index) : !llvm.i64 -// CHECK: %[[s12:.*]] = llvm.extractelement %[[s1]][%[[s11]] : !llvm.i64] : !llvm<"<4 x float>"> +// CHECK: %[[s12:.*]] = llvm.extractelement %[[s1]][%[[s11]] : !llvm.i64] : !llvm.vec<4 x float> // CHECK: %[[s13:.*]] = llvm.mlir.constant(4 : index) : !llvm.i64 -// CHECK: %[[s14:.*]] = llvm.insertelement %[[s12]], %[[s10]][%[[s13]] : !llvm.i64] : !llvm<"<8 x float>"> +// CHECK: %[[s14:.*]] = llvm.insertelement %[[s12]], %[[s10]][%[[s13]] : !llvm.i64] : !llvm.vec<8 x float> // CHECK: %[[s15:.*]] = llvm.mlir.constant(3 : index) : !llvm.i64 -// CHECK: %[[s16:.*]] = llvm.extractelement %[[s1]][%[[s15]] : !llvm.i64] : !llvm<"<4 x float>"> +// CHECK: %[[s16:.*]] = llvm.extractelement %[[s1]][%[[s15]] : !llvm.i64] : !llvm.vec<4 x float> // CHECK: %[[s17:.*]] = llvm.mlir.constant(5 : index) : !llvm.i64 -// CHECK: %[[s18:.*]] = llvm.insertelement %[[s16]], %[[s14]][%[[s17]] : !llvm.i64] : !llvm<"<8 x float>"> -// CHECK: %[[s19:.*]] = llvm.insertvalue %[[s18]], %[[s0]][0] : !llvm<"[4 x <8 x float>]"> -// CHECK: %[[s20:.*]] = llvm.extractvalue %[[A]][1] : !llvm<"[2 x <4 x float>]"> -// CHECK: %[[s21:.*]] = llvm.extractvalue %[[B]][0, 1] : !llvm<"[16 x [4 x <8 x float>]]"> +// CHECK: %[[s18:.*]] = llvm.insertelement %[[s16]], %[[s14]][%[[s17]] : !llvm.i64] : !llvm.vec<8 x float> +// CHECK: %[[s19:.*]] = llvm.insertvalue %[[s18]], %[[s0]][0] : !llvm.array<4 x vec<8 x float>> +// CHECK: %[[s20:.*]] = llvm.extractvalue %[[A]][1] : !llvm.array<2 x vec<4 x float>> +// CHECK: %[[s21:.*]] = llvm.extractvalue %[[B]][0, 1] : !llvm.array<16 x array<4 x vec<8 x float>>> // CHECK: %[[s22:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK: %[[s23:.*]] = llvm.extractelement %[[s20]][%[[s22]] : !llvm.i64] : !llvm<"<4 x float>"> +// CHECK: %[[s23:.*]] = llvm.extractelement %[[s20]][%[[s22]] : !llvm.i64] : !llvm.vec<4 x float> // CHECK: %[[s24:.*]] = llvm.mlir.constant(2 : index) : !llvm.i64 -// CHECK: %[[s25:.*]] = llvm.insertelement %[[s23]], %[[s21]][%[[s24]] : !llvm.i64] : !llvm<"<8 x float>"> +// CHECK: %[[s25:.*]] = llvm.insertelement %[[s23]], %[[s21]][%[[s24]] : !llvm.i64] : !llvm.vec<8 x float> // CHECK: %[[s26:.*]] = llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK: %[[s27:.*]] = llvm.extractelement %[[s20]][%[[s26]] : !llvm.i64] : !llvm<"<4 x float>"> +// CHECK: %[[s27:.*]] = llvm.extractelement %[[s20]][%[[s26]] : !llvm.i64] : !llvm.vec<4 x float> // CHECK: %[[s28:.*]] = llvm.mlir.constant(3 : index) : !llvm.i64 -// CHECK: %[[s29:.*]] = llvm.insertelement %[[s27]], %[[s25]][%[[s28]] : !llvm.i64] : !llvm<"<8 x float>"> +// CHECK: %[[s29:.*]] = llvm.insertelement %[[s27]], %[[s25]][%[[s28]] : !llvm.i64] : !llvm.vec<8 x float> // CHECK: %[[s30:.*]] = llvm.mlir.constant(2 : index) : !llvm.i64 -// CHECK: %[[s31:.*]] = llvm.extractelement %[[s20]][%[[s30]] : !llvm.i64] : !llvm<"<4 x float>"> +// CHECK: %[[s31:.*]] = llvm.extractelement %[[s20]][%[[s30]] : !llvm.i64] : !llvm.vec<4 x float> // CHECK: %[[s32:.*]] = llvm.mlir.constant(4 : index) : !llvm.i64 -// CHECK: %[[s33:.*]] = llvm.insertelement %[[s31]], %[[s29]][%[[s32]] : !llvm.i64] : !llvm<"<8 x float>"> +// CHECK: %[[s33:.*]] = llvm.insertelement %[[s31]], %[[s29]][%[[s32]] : !llvm.i64] : !llvm.vec<8 x float> // CHECK: %[[s34:.*]] = llvm.mlir.constant(3 : index) : !llvm.i64 -// CHECK: %[[s35:.*]] = llvm.extractelement %[[s20]][%[[s34]] : !llvm.i64] : !llvm<"<4 x float>"> +// CHECK: %[[s35:.*]] = llvm.extractelement %[[s20]][%[[s34]] : !llvm.i64] : !llvm.vec<4 x float> // CHECK: %[[s36:.*]] = llvm.mlir.constant(5 : index) : !llvm.i64 -// CHECK: %[[s37:.*]] = llvm.insertelement %[[s35]], %[[s33]][%[[s36]] : !llvm.i64] : !llvm<"<8 x float>"> -// CHECK: %[[s38:.*]] = llvm.insertvalue %[[s37]], %[[s19]][1] : !llvm<"[4 x <8 x float>]"> -// CHECK: %[[s39:.*]] = llvm.insertvalue %[[s38]], %[[B]][0] : !llvm<"[16 x [4 x <8 x float>]]"> -// CHECK: llvm.return %[[s39]] : !llvm<"[16 x [4 x <8 x float>]]"> +// CHECK: %[[s37:.*]] = llvm.insertelement %[[s35]], %[[s33]][%[[s36]] : !llvm.i64] : !llvm.vec<8 x float> +// CHECK: %[[s38:.*]] = llvm.insertvalue %[[s37]], %[[s19]][1] : !llvm.array<4 x vec<8 x float>> +// CHECK: %[[s39:.*]] = llvm.insertvalue %[[s38]], %[[B]][0] : !llvm.array<16 x array<4 x vec<8 x float>>> +// CHECK: llvm.return %[[s39]] : !llvm.array<16 x array<4 x vec<8 x float>>> func @extract_strides(%arg0: vector<3x3xf32>) -> vector<1x1xf32> { %0 = vector.extract_slices %arg0, [2, 2], [1, 1] @@ -673,37 +673,37 @@ return %1 : vector<1x1xf32> } // CHECK-LABEL: llvm.func @extract_strides( -// CHECK-SAME: %[[A:.*]]: !llvm<"[3 x <3 x float>]">) -// CHECK: %[[s0:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<1x1xf32>) : !llvm<"[1 x <1 x float>]"> -// CHECK: %[[s1:.*]] = llvm.extractvalue %[[A]][2] : !llvm<"[3 x <3 x float>]"> -// CHECK: %[[s3:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<1xf32>) : !llvm<"<1 x float>"> +// CHECK-SAME: %[[A:.*]]: !llvm.array<3 x vec<3 x float>>) +// CHECK: %[[s0:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<1x1xf32>) : !llvm.array<1 x vec<1 x float>> +// CHECK: %[[s1:.*]] = llvm.extractvalue %[[A]][2] : !llvm.array<3 x vec<3 x float>> +// CHECK: %[[s3:.*]] = llvm.mlir.constant(dense<0.000000e+00> : vector<1xf32>) : !llvm.vec<1 x float> // CHECK: %[[s4:.*]] = llvm.mlir.constant(2 : index) : !llvm.i64 -// CHECK: %[[s5:.*]] = llvm.extractelement %[[s1]][%[[s4]] : !llvm.i64] : !llvm<"<3 x float>"> +// CHECK: %[[s5:.*]] = llvm.extractelement %[[s1]][%[[s4]] : !llvm.i64] : !llvm.vec<3 x float> // CHECK: %[[s6:.*]] = llvm.mlir.constant(0 : index) : !llvm.i64 -// CHECK: %[[s7:.*]] = llvm.insertelement %[[s5]], %[[s3]][%[[s6]] : !llvm.i64] : !llvm<"<1 x float>"> -// CHECK: %[[s8:.*]] = llvm.insertvalue %[[s7]], %[[s0]][0] : !llvm<"[1 x <1 x float>]"> -// CHECK: llvm.return %[[s8]] : !llvm<"[1 x <1 x float>]"> +// CHECK: %[[s7:.*]] = llvm.insertelement %[[s5]], %[[s3]][%[[s6]] : !llvm.i64] : !llvm.vec<1 x float> +// CHECK: %[[s8:.*]] = llvm.insertvalue %[[s7]], %[[s0]][0] : !llvm.array<1 x vec<1 x float>> +// CHECK: llvm.return %[[s8]] : !llvm.array<1 x vec<1 x float>> // CHECK-LABEL: llvm.func @vector_fma( -// CHECK-SAME: %[[A:.*]]: !llvm<"<8 x float>">, %[[B:.*]]: !llvm<"[2 x <4 x float>]">) -// CHECK-SAME: -> !llvm<"{ <8 x float>, [2 x <4 x float>] }"> { +// CHECK-SAME: %[[A:.*]]: !llvm.vec<8 x float>, %[[B:.*]]: !llvm.array<2 x vec<4 x float>>) +// CHECK-SAME: -> !llvm.struct<(vec<8 x float>, array<2 x vec<4 x float>>)> { func @vector_fma(%a: vector<8xf32>, %b: vector<2x4xf32>) -> (vector<8xf32>, vector<2x4xf32>) { // CHECK: "llvm.intr.fmuladd"(%[[A]], %[[A]], %[[A]]) : - // CHECK-SAME: (!llvm<"<8 x float>">, !llvm<"<8 x float>">, !llvm<"<8 x float>">) -> !llvm<"<8 x float>"> + // CHECK-SAME: (!llvm.vec<8 x float>, !llvm.vec<8 x float>, !llvm.vec<8 x float>) -> !llvm.vec<8 x float> %0 = vector.fma %a, %a, %a : vector<8xf32> - // CHECK: %[[b00:.*]] = llvm.extractvalue %[[B]][0] : !llvm<"[2 x <4 x float>]"> - // CHECK: %[[b01:.*]] = llvm.extractvalue %[[B]][0] : !llvm<"[2 x <4 x float>]"> - // CHECK: %[[b02:.*]] = llvm.extractvalue %[[B]][0] : !llvm<"[2 x <4 x float>]"> + // CHECK: %[[b00:.*]] = llvm.extractvalue %[[B]][0] : !llvm.array<2 x vec<4 x float>> + // CHECK: %[[b01:.*]] = llvm.extractvalue %[[B]][0] : !llvm.array<2 x vec<4 x float>> + // CHECK: %[[b02:.*]] = llvm.extractvalue %[[B]][0] : !llvm.array<2 x vec<4 x float>> // CHECK: %[[B0:.*]] = "llvm.intr.fmuladd"(%[[b00]], %[[b01]], %[[b02]]) : - // CHECK-SAME: (!llvm<"<4 x float>">, !llvm<"<4 x float>">, !llvm<"<4 x float>">) -> !llvm<"<4 x float>"> - // CHECK: llvm.insertvalue %[[B0]], {{.*}}[0] : !llvm<"[2 x <4 x float>]"> - // CHECK: %[[b10:.*]] = llvm.extractvalue %[[B]][1] : !llvm<"[2 x <4 x float>]"> - // CHECK: %[[b11:.*]] = llvm.extractvalue %[[B]][1] : !llvm<"[2 x <4 x float>]"> - // CHECK: %[[b12:.*]] = llvm.extractvalue %[[B]][1] : !llvm<"[2 x <4 x float>]"> + // CHECK-SAME: (!llvm.vec<4 x float>, !llvm.vec<4 x float>, !llvm.vec<4 x float>) -> !llvm.vec<4 x float> + // CHECK: llvm.insertvalue %[[B0]], {{.*}}[0] : !llvm.array<2 x vec<4 x float>> + // CHECK: %[[b10:.*]] = llvm.extractvalue %[[B]][1] : !llvm.array<2 x vec<4 x float>> + // CHECK: %[[b11:.*]] = llvm.extractvalue %[[B]][1] : !llvm.array<2 x vec<4 x float>> + // CHECK: %[[b12:.*]] = llvm.extractvalue %[[B]][1] : !llvm.array<2 x vec<4 x float>> // CHECK: %[[B1:.*]] = "llvm.intr.fmuladd"(%[[b10]], %[[b11]], %[[b12]]) : - // CHECK-SAME: (!llvm<"<4 x float>">, !llvm<"<4 x float>">, !llvm<"<4 x float>">) -> !llvm<"<4 x float>"> - // CHECK: llvm.insertvalue %[[B1]], {{.*}}[1] : !llvm<"[2 x <4 x float>]"> + // CHECK-SAME: (!llvm.vec<4 x float>, !llvm.vec<4 x float>, !llvm.vec<4 x float>) -> !llvm.vec<4 x float> + // CHECK: llvm.insertvalue %[[B1]], {{.*}}[1] : !llvm.array<2 x vec<4 x float>> %1 = vector.fma %b, %b, %b : vector<2x4xf32> return %0, %1: vector<8xf32>, vector<2x4xf32> @@ -714,10 +714,10 @@ return %0 : f32 } // CHECK-LABEL: llvm.func @reduce_f32( -// CHECK-SAME: %[[A:.*]]: !llvm<"<16 x float>">) +// CHECK-SAME: %[[A:.*]]: !llvm.vec<16 x float>) // CHECK: %[[C:.*]] = llvm.mlir.constant(0.000000e+00 : f32) : !llvm.float // CHECK: %[[V:.*]] = "llvm.intr.experimental.vector.reduce.v2.fadd"(%[[C]], %[[A]]) -// CHECK-SAME: {reassoc = false} : (!llvm.float, !llvm<"<16 x float>">) -> !llvm.float +// CHECK-SAME: {reassoc = false} : (!llvm.float, !llvm.vec<16 x float>) -> !llvm.float // CHECK: llvm.return %[[V]] : !llvm.float func @reduce_f64(%arg0: vector<16xf64>) -> f64 { @@ -725,10 +725,10 @@ return %0 : f64 } // CHECK-LABEL: llvm.func @reduce_f64( -// CHECK-SAME: %[[A:.*]]: !llvm<"<16 x double>">) +// CHECK-SAME: %[[A:.*]]: !llvm.vec<16 x double>) // CHECK: %[[C:.*]] = llvm.mlir.constant(0.000000e+00 : f64) : !llvm.double // CHECK: %[[V:.*]] = "llvm.intr.experimental.vector.reduce.v2.fadd"(%[[C]], %[[A]]) -// CHECK-SAME: {reassoc = false} : (!llvm.double, !llvm<"<16 x double>">) -> !llvm.double +// CHECK-SAME: {reassoc = false} : (!llvm.double, !llvm.vec<16 x double>) -> !llvm.double // CHECK: llvm.return %[[V]] : !llvm.double func @reduce_i32(%arg0: vector<16xi32>) -> i32 { @@ -736,7 +736,7 @@ return %0 : i32 } // CHECK-LABEL: llvm.func @reduce_i32( -// CHECK-SAME: %[[A:.*]]: !llvm<"<16 x i32>">) +// CHECK-SAME: %[[A:.*]]: !llvm.vec<16 x i32>) // CHECK: %[[V:.*]] = "llvm.intr.experimental.vector.reduce.add"(%[[A]]) // CHECK: llvm.return %[[V]] : !llvm.i32 @@ -745,7 +745,7 @@ return %0 : i64 } // CHECK-LABEL: llvm.func @reduce_i64( -// CHECK-SAME: %[[A:.*]]: !llvm<"<16 x i64>">) +// CHECK-SAME: %[[A:.*]]: !llvm.vec<16 x i64>) // CHECK: %[[V:.*]] = "llvm.intr.experimental.vector.reduce.add"(%[[A]]) // CHECK: llvm.return %[[V]] : !llvm.i64 @@ -760,7 +760,7 @@ // CHECK-LABEL: llvm.func @matrix_ops // CHECK: llvm.intr.matrix.multiply %{{.*}}, %{{.*}} { // CHECK-SAME: lhs_columns = 16 : i32, lhs_rows = 4 : i32, rhs_columns = 3 : i32 -// CHECK-SAME: } : (!llvm<"<64 x double>">, !llvm<"<48 x double>">) -> !llvm<"<12 x double>"> +// CHECK-SAME: } : (!llvm.vec<64 x double>, !llvm.vec<48 x double>) -> !llvm.vec<12 x double> func @transfer_read_1d(%A : memref, %base: index) -> vector<17xf32> { %f7 = constant 7.0: f32 @@ -773,72 +773,72 @@ return %f: vector<17xf32> } // CHECK-LABEL: func @transfer_read_1d -// CHECK-SAME: %[[BASE:[a-zA-Z0-9]*]]: !llvm.i64) -> !llvm<"<17 x float>"> +// CHECK-SAME: %[[BASE:[a-zA-Z0-9]*]]: !llvm.i64) -> !llvm.vec<17 x float> // // 1. Bitcast to vector form. // CHECK: %[[gep:.*]] = llvm.getelementptr {{.*}} : -// CHECK-SAME: (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> +// CHECK-SAME: (!llvm.ptr, !llvm.i64) -> !llvm.ptr // CHECK: %[[vecPtr:.*]] = llvm.bitcast %[[gep]] : -// CHECK-SAME: !llvm<"float*"> to !llvm<"<17 x float>*"> +// CHECK-SAME: !llvm.ptr to !llvm.ptr> // // 2. Create a vector with linear indices [ 0 .. vector_length - 1 ]. // CHECK: %[[linearIndex:.*]] = llvm.mlir.constant( // CHECK-SAME: dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]> : -// CHECK-SAME: vector<17xi64>) : !llvm<"<17 x i64>"> +// CHECK-SAME: vector<17xi64>) : !llvm.vec<17 x i64> // // 3. Create offsetVector = [ offset + 0 .. offset + vector_length - 1 ]. -// CHECK: %[[offsetVec:.*]] = llvm.mlir.undef : !llvm<"<17 x i64>"> +// CHECK: %[[offsetVec:.*]] = llvm.mlir.undef : !llvm.vec<17 x i64> // CHECK: %[[c0:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 // CHECK: %[[offsetVec2:.*]] = llvm.insertelement %[[BASE]], %[[offsetVec]][%[[c0]] : -// CHECK-SAME: !llvm.i32] : !llvm<"<17 x i64>"> +// CHECK-SAME: !llvm.i32] : !llvm.vec<17 x i64> // CHECK: %[[offsetVec3:.*]] = llvm.shufflevector %[[offsetVec2]], %{{.*}} [ // CHECK-SAME: 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, // CHECK-SAME: 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, // CHECK-SAME: 0 : i32, 0 : i32, 0 : i32] : -// CHECK-SAME: !llvm<"<17 x i64>">, !llvm<"<17 x i64>"> +// CHECK-SAME: !llvm.vec<17 x i64>, !llvm.vec<17 x i64> // CHECK: %[[offsetVec4:.*]] = llvm.add %[[offsetVec3]], %[[linearIndex]] : -// CHECK-SAME: !llvm<"<17 x i64>"> +// CHECK-SAME: !llvm.vec<17 x i64> // // 4. Let dim the memref dimension, compute the vector comparison mask: // [ offset + 0 .. offset + vector_length - 1 ] < [ dim .. dim ] // CHECK: %[[DIM:.*]] = llvm.extractvalue %{{.*}}[3, 0] : -// CHECK-SAME: !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> -// CHECK: %[[dimVec:.*]] = llvm.mlir.undef : !llvm<"<17 x i64>"> +// CHECK-SAME: !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> +// CHECK: %[[dimVec:.*]] = llvm.mlir.undef : !llvm.vec<17 x i64> // CHECK: %[[c01:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 // CHECK: %[[dimVec2:.*]] = llvm.insertelement %[[DIM]], %[[dimVec]][%[[c01]] : -// CHECK-SAME: !llvm.i32] : !llvm<"<17 x i64>"> +// CHECK-SAME: !llvm.i32] : !llvm.vec<17 x i64> // CHECK: %[[dimVec3:.*]] = llvm.shufflevector %[[dimVec2]], %{{.*}} [ // CHECK-SAME: 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, // CHECK-SAME: 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, // CHECK-SAME: 0 : i32, 0 : i32, 0 : i32] : -// CHECK-SAME: !llvm<"<17 x i64>">, !llvm<"<17 x i64>"> +// CHECK-SAME: !llvm.vec<17 x i64>, !llvm.vec<17 x i64> // CHECK: %[[mask:.*]] = llvm.icmp "slt" %[[offsetVec4]], %[[dimVec3]] : -// CHECK-SAME: !llvm<"<17 x i64>"> +// CHECK-SAME: !llvm.vec<17 x i64> // // 5. Rewrite as a masked read. // CHECK: %[[PASS_THROUGH:.*]] = llvm.mlir.constant(dense<7.000000e+00> : -// CHECK-SAME: vector<17xf32>) : !llvm<"<17 x float>"> +// CHECK-SAME: vector<17xf32>) : !llvm.vec<17 x float> // CHECK: %[[loaded:.*]] = llvm.intr.masked.load %[[vecPtr]], %[[mask]], // CHECK-SAME: %[[PASS_THROUGH]] {alignment = 4 : i32} : -// CHECK-SAME: (!llvm<"<17 x float>*">, !llvm<"<17 x i1>">, !llvm<"<17 x float>">) -> !llvm<"<17 x float>"> +// CHECK-SAME: (!llvm.ptr>, !llvm.vec<17 x i1>, !llvm.vec<17 x float>) -> !llvm.vec<17 x float> // // 1. Bitcast to vector form. // CHECK: %[[gep_b:.*]] = llvm.getelementptr {{.*}} : -// CHECK-SAME: (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> +// CHECK-SAME: (!llvm.ptr, !llvm.i64) -> !llvm.ptr // CHECK: %[[vecPtr_b:.*]] = llvm.bitcast %[[gep_b]] : -// CHECK-SAME: !llvm<"float*"> to !llvm<"<17 x float>*"> +// CHECK-SAME: !llvm.ptr to !llvm.ptr> // // 2. Create a vector with linear indices [ 0 .. vector_length - 1 ]. // CHECK: %[[linearIndex_b:.*]] = llvm.mlir.constant( // CHECK-SAME: dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]> : -// CHECK-SAME: vector<17xi64>) : !llvm<"<17 x i64>"> +// CHECK-SAME: vector<17xi64>) : !llvm.vec<17 x i64> // // 3. Create offsetVector = [ offset + 0 .. offset + vector_length - 1 ]. // CHECK: llvm.shufflevector {{.*}} [0 : i32, 0 : i32, 0 : i32, 0 : i32, // CHECK-SAME: 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, // CHECK-SAME: 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32] : -// CHECK-SAME: !llvm<"<17 x i64>">, !llvm<"<17 x i64>"> +// CHECK-SAME: !llvm.vec<17 x i64>, !llvm.vec<17 x i64> // CHECK: llvm.add // // 4. Let dim the memref dimension, compute the vector comparison mask: @@ -846,13 +846,13 @@ // CHECK: llvm.shufflevector {{.*}} [0 : i32, 0 : i32, 0 : i32, 0 : i32, // CHECK-SAME: 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, // CHECK-SAME: 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32] : -// CHECK-SAME: !llvm<"<17 x i64>">, !llvm<"<17 x i64>"> -// CHECK: %[[mask_b:.*]] = llvm.icmp "slt" {{.*}} : !llvm<"<17 x i64>"> +// CHECK-SAME: !llvm.vec<17 x i64>, !llvm.vec<17 x i64> +// CHECK: %[[mask_b:.*]] = llvm.icmp "slt" {{.*}} : !llvm.vec<17 x i64> // // 5. Rewrite as a masked write. // CHECK: llvm.intr.masked.store %[[loaded]], %[[vecPtr_b]], %[[mask_b]] // CHECK-SAME: {alignment = 4 : i32} : -// CHECK-SAME: !llvm<"<17 x float>">, !llvm<"<17 x i1>"> into !llvm<"<17 x float>*"> +// CHECK-SAME: !llvm.vec<17 x float>, !llvm.vec<17 x i1> into !llvm.ptr> func @transfer_read_2d_to_1d(%A : memref, %base0: index, %base1: index) -> vector<17xf32> { %f7 = constant 7.0: f32 @@ -862,14 +862,14 @@ return %f: vector<17xf32> } // CHECK-LABEL: func @transfer_read_2d_to_1d -// CHECK-SAME: %[[BASE_0:[a-zA-Z0-9]*]]: !llvm.i64, %[[BASE_1:[a-zA-Z0-9]*]]: !llvm.i64) -> !llvm<"<17 x float>"> +// CHECK-SAME: %[[BASE_0:[a-zA-Z0-9]*]]: !llvm.i64, %[[BASE_1:[a-zA-Z0-9]*]]: !llvm.i64) -> !llvm.vec<17 x float> // // Create offsetVector = [ offset + 0 .. offset + vector_length - 1 ]. -// CHECK: %[[offsetVec:.*]] = llvm.mlir.undef : !llvm<"<17 x i64>"> +// CHECK: %[[offsetVec:.*]] = llvm.mlir.undef : !llvm.vec<17 x i64> // CHECK: %[[c0:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 // Here we check we properly use %BASE_1 // CHECK: %[[offsetVec2:.*]] = llvm.insertelement %[[BASE_1]], %[[offsetVec]][%[[c0]] : -// CHECK-SAME: !llvm.i32] : !llvm<"<17 x i64>"> +// CHECK-SAME: !llvm.i32] : !llvm.vec<17 x i64> // CHECK: %[[offsetVec3:.*]] = llvm.shufflevector %[[offsetVec2]], %{{.*}} [ // CHECK-SAME: 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, // CHECK-SAME: 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, @@ -879,16 +879,16 @@ // [ offset + 0 .. offset + vector_length - 1 ] < [ dim .. dim ] // Here we check we properly use %DIM[1] // CHECK: %[[DIM:.*]] = llvm.extractvalue %{{.*}}[3, 1] : -// CHECK-SAME: !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK: %[[dimVec:.*]] = llvm.mlir.undef : !llvm<"<17 x i64>"> +// CHECK-SAME: !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK: %[[dimVec:.*]] = llvm.mlir.undef : !llvm.vec<17 x i64> // CHECK: %[[c01:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 // CHECK: %[[dimVec2:.*]] = llvm.insertelement %[[DIM]], %[[dimVec]][%[[c01]] : -// CHECK-SAME: !llvm.i32] : !llvm<"<17 x i64>"> +// CHECK-SAME: !llvm.i32] : !llvm.vec<17 x i64> // CHECK: %[[dimVec3:.*]] = llvm.shufflevector %[[dimVec2]], %{{.*}} [ // CHECK-SAME: 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, // CHECK-SAME: 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, 0 : i32, // CHECK-SAME: 0 : i32, 0 : i32, 0 : i32] : -// CHECK-SAME: !llvm<"<17 x i64>">, !llvm<"<17 x i64>"> +// CHECK-SAME: !llvm.vec<17 x i64>, !llvm.vec<17 x i64> func @transfer_read_1d_non_zero_addrspace(%A : memref, %base: index) -> vector<17xf32> { %f7 = constant 7.0: f32 @@ -901,23 +901,23 @@ return %f: vector<17xf32> } // CHECK-LABEL: func @transfer_read_1d_non_zero_addrspace -// CHECK-SAME: %[[BASE:[a-zA-Z0-9]*]]: !llvm.i64) -> !llvm<"<17 x float>"> +// CHECK-SAME: %[[BASE:[a-zA-Z0-9]*]]: !llvm.i64) -> !llvm.vec<17 x float> // // 1. Check address space for GEP is correct. // CHECK: %[[gep:.*]] = llvm.getelementptr {{.*}} : -// CHECK-SAME: (!llvm<"float addrspace(3)*">, !llvm.i64) -> !llvm<"float addrspace(3)*"> +// CHECK-SAME: (!llvm.ptr, !llvm.i64) -> !llvm.ptr // CHECK: %[[vecPtr:.*]] = llvm.addrspacecast %[[gep]] : -// CHECK-SAME: !llvm<"float addrspace(3)*"> to !llvm<"<17 x float>*"> +// CHECK-SAME: !llvm.ptr to !llvm.ptr> // // 2. Check address space of the memref is correct. // CHECK: %[[DIM:.*]] = llvm.extractvalue %{{.*}}[3, 0] : -// CHECK-SAME: !llvm<"{ float addrspace(3)*, float addrspace(3)*, i64, [1 x i64], [1 x i64] }"> +// CHECK-SAME: !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> // // 3. Check address apce for GEP is correct. // CHECK: %[[gep_b:.*]] = llvm.getelementptr {{.*}} : -// CHECK-SAME: (!llvm<"float addrspace(3)*">, !llvm.i64) -> !llvm<"float addrspace(3)*"> +// CHECK-SAME: (!llvm.ptr, !llvm.i64) -> !llvm.ptr // CHECK: %[[vecPtr_b:.*]] = llvm.addrspacecast %[[gep_b]] : -// CHECK-SAME: !llvm<"float addrspace(3)*"> to !llvm<"<17 x float>*"> +// CHECK-SAME: !llvm.ptr to !llvm.ptr> func @transfer_read_1d_not_masked(%A : memref, %base: index) -> vector<17xf32> { %f7 = constant 7.0: f32 @@ -926,24 +926,24 @@ return %f: vector<17xf32> } // CHECK-LABEL: func @transfer_read_1d_not_masked -// CHECK-SAME: %[[BASE:[a-zA-Z0-9]*]]: !llvm.i64) -> !llvm<"<17 x float>"> +// CHECK-SAME: %[[BASE:[a-zA-Z0-9]*]]: !llvm.i64) -> !llvm.vec<17 x float> // // 1. Bitcast to vector form. // CHECK: %[[gep:.*]] = llvm.getelementptr {{.*}} : -// CHECK-SAME: (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> +// CHECK-SAME: (!llvm.ptr, !llvm.i64) -> !llvm.ptr // CHECK: %[[vecPtr:.*]] = llvm.bitcast %[[gep]] : -// CHECK-SAME: !llvm<"float*"> to !llvm<"<17 x float>*"> +// CHECK-SAME: !llvm.ptr to !llvm.ptr> // // 2. Rewrite as a load. -// CHECK: %[[loaded:.*]] = llvm.load %[[vecPtr]] {alignment = 4 : i64} : !llvm<"<17 x float>*"> +// CHECK: %[[loaded:.*]] = llvm.load %[[vecPtr]] {alignment = 4 : i64} : !llvm.ptr> func @genbool_1d() -> vector<8xi1> { %0 = vector.constant_mask [4] : vector<8xi1> return %0 : vector<8xi1> } // CHECK-LABEL: func @genbool_1d -// CHECK: %[[C1:.*]] = llvm.mlir.constant(dense<[true, true, true, true, false, false, false, false]> : vector<8xi1>) : !llvm<"<8 x i1>"> -// CHECK: llvm.return %[[C1]] : !llvm<"<8 x i1>"> +// CHECK: %[[C1:.*]] = llvm.mlir.constant(dense<[true, true, true, true, false, false, false, false]> : vector<8xi1>) : !llvm.vec<8 x i1> +// CHECK: llvm.return %[[C1]] : !llvm.vec<8 x i1> func @genbool_2d() -> vector<4x4xi1> { %v = vector.constant_mask [2, 2] : vector<4x4xi1> @@ -951,11 +951,11 @@ } // CHECK-LABEL: func @genbool_2d -// CHECK: %[[C1:.*]] = llvm.mlir.constant(dense<[true, true, false, false]> : vector<4xi1>) : !llvm<"<4 x i1>"> -// CHECK: %[[C2:.*]] = llvm.mlir.constant(dense : vector<4x4xi1>) : !llvm<"[4 x <4 x i1>]"> -// CHECK: %[[T0:.*]] = llvm.insertvalue %[[C1]], %[[C2]][0] : !llvm<"[4 x <4 x i1>]"> -// CHECK: %[[T1:.*]] = llvm.insertvalue %[[C1]], %[[T0]][1] : !llvm<"[4 x <4 x i1>]"> -// CHECK: llvm.return %[[T1]] : !llvm<"[4 x <4 x i1>]"> +// CHECK: %[[C1:.*]] = llvm.mlir.constant(dense<[true, true, false, false]> : vector<4xi1>) : !llvm.vec<4 x i1> +// CHECK: %[[C2:.*]] = llvm.mlir.constant(dense : vector<4x4xi1>) : !llvm.array<4 x vec<4 x i1>> +// CHECK: %[[T0:.*]] = llvm.insertvalue %[[C1]], %[[C2]][0] : !llvm.array<4 x vec<4 x i1>> +// CHECK: %[[T1:.*]] = llvm.insertvalue %[[C1]], %[[T0]][1] : !llvm.array<4 x vec<4 x i1>> +// CHECK: llvm.return %[[T1]] : !llvm.array<4 x vec<4 x i1>> func @flat_transpose(%arg0: vector<16xf32>) -> vector<16xf32> { %0 = vector.flat_transpose %arg0 { rows = 4: i32, columns = 4: i32 } @@ -964,11 +964,11 @@ } // CHECK-LABEL: func @flat_transpose -// CHECK-SAME: %[[A:.*]]: !llvm<"<16 x float>"> +// CHECK-SAME: %[[A:.*]]: !llvm.vec<16 x float> // CHECK: %[[T:.*]] = llvm.intr.matrix.transpose %[[A]] // CHECK-SAME: {columns = 4 : i32, rows = 4 : i32} : -// CHECK-SAME: !llvm<"<16 x float>"> into !llvm<"<16 x float>"> -// CHECK: llvm.return %[[T]] : !llvm<"<16 x float>"> +// CHECK-SAME: !llvm.vec<16 x float> into !llvm.vec<16 x float> +// CHECK: llvm.return %[[T]] : !llvm.vec<16 x float> func @gather_op(%arg0: memref, %arg1: vector<3xi32>, %arg2: vector<3xi1>, %arg3: vector<3xf32>) -> vector<3xf32> { %0 = vector.gather %arg0, %arg1, %arg2, %arg3 : (memref, vector<3xi32>, vector<3xi1>, vector<3xf32>) -> vector<3xf32> @@ -976,9 +976,9 @@ } // CHECK-LABEL: func @gather_op -// CHECK: %[[P:.*]] = llvm.getelementptr {{.*}}[%{{.*}}] : (!llvm<"float*">, !llvm<"<3 x i32>">) -> !llvm<"<3 x float*>"> -// CHECK: %[[G:.*]] = llvm.intr.masked.gather %[[P]], %{{.*}}, %{{.*}} {alignment = 4 : i32} : (!llvm<"<3 x float*>">, !llvm<"<3 x i1>">, !llvm<"<3 x float>">) -> !llvm<"<3 x float>"> -// CHECK: llvm.return %[[G]] : !llvm<"<3 x float>"> +// CHECK: %[[P:.*]] = llvm.getelementptr {{.*}}[%{{.*}}] : (!llvm.ptr, !llvm.vec<3 x i32>) -> !llvm.vec<3 x ptr> +// CHECK: %[[G:.*]] = llvm.intr.masked.gather %[[P]], %{{.*}}, %{{.*}} {alignment = 4 : i32} : (!llvm.vec<3 x ptr>, !llvm.vec<3 x i1>, !llvm.vec<3 x float>) -> !llvm.vec<3 x float> +// CHECK: llvm.return %[[G]] : !llvm.vec<3 x float> func @scatter_op(%arg0: memref, %arg1: vector<3xi32>, %arg2: vector<3xi1>, %arg3: vector<3xf32>) { vector.scatter %arg0, %arg1, %arg2, %arg3 : vector<3xi32>, vector<3xi1>, vector<3xf32> into memref @@ -986,6 +986,6 @@ } // CHECK-LABEL: func @scatter_op -// CHECK: %[[P:.*]] = llvm.getelementptr {{.*}}[%{{.*}}] : (!llvm<"float*">, !llvm<"<3 x i32>">) -> !llvm<"<3 x float*>"> -// CHECK: llvm.intr.masked.scatter %{{.*}}, %[[P]], %{{.*}} {alignment = 4 : i32} : !llvm<"<3 x float>">, !llvm<"<3 x i1>"> into !llvm<"<3 x float*>"> +// CHECK: %[[P:.*]] = llvm.getelementptr {{.*}}[%{{.*}}] : (!llvm.ptr, !llvm.vec<3 x i32>) -> !llvm.vec<3 x ptr> +// CHECK: llvm.intr.masked.scatter %{{.*}}, %[[P]], %{{.*}} {alignment = 4 : i32} : !llvm.vec<3 x float>, !llvm.vec<3 x i1> into !llvm.vec<3 x ptr> // CHECK: llvm.return diff --git a/mlir/test/Conversion/VectorToROCDL/vector-to-rocdl.mlir b/mlir/test/Conversion/VectorToROCDL/vector-to-rocdl.mlir --- a/mlir/test/Conversion/VectorToROCDL/vector-to-rocdl.mlir +++ b/mlir/test/Conversion/VectorToROCDL/vector-to-rocdl.mlir @@ -9,7 +9,7 @@ return %f: vector<2xf32> } // CHECK-LABEL: @transfer_readx2 -// CHECK: rocdl.buffer.load {{.*}} !llvm<"<2 x float>"> +// CHECK: rocdl.buffer.load {{.*}} !llvm.vec<2 x float> func @transfer_readx4(%A : memref, %base: index) -> vector<4xf32> { %f0 = constant 0.0: f32 @@ -19,7 +19,7 @@ return %f: vector<4xf32> } // CHECK-LABEL: @transfer_readx4 -// CHECK: rocdl.buffer.load {{.*}} !llvm<"<4 x float>"> +// CHECK: rocdl.buffer.load {{.*}} !llvm.vec<4 x float> func @transfer_read_dwordConfig(%A : memref, %base: index) -> vector<4xf32> { %f0 = constant 0.0: f32 @@ -43,7 +43,7 @@ return } // CHECK-LABEL: @transfer_writex2 -// CHECK: rocdl.buffer.store {{.*}} !llvm<"<2 x float>"> +// CHECK: rocdl.buffer.store {{.*}} !llvm.vec<2 x float> func @transfer_writex4(%A : memref, %B : vector<4xf32>, %base: index) { vector.transfer_write %B, %A[%base] @@ -52,7 +52,7 @@ return } // CHECK-LABEL: @transfer_writex4 -// CHECK: rocdl.buffer.store {{.*}} !llvm<"<4 x float>"> +// CHECK: rocdl.buffer.store {{.*}} !llvm.vec<4 x float> func @transfer_write_dwordConfig(%A : memref, %B : vector<2xf32>, %base: index) { vector.transfer_write %B, %A[%base] diff --git a/mlir/test/Dialect/GPU/invalid.mlir b/mlir/test/Dialect/GPU/invalid.mlir --- a/mlir/test/Dialect/GPU/invalid.mlir +++ b/mlir/test/Dialect/GPU/invalid.mlir @@ -89,7 +89,7 @@ module attributes {gpu.container_module} { module @kernels { // expected-error@+1 {{'gpu.func' op expects parent op 'gpu.module'}} - gpu.func @kernel_1(%arg1 : !llvm<"float*">) { + gpu.func @kernel_1(%arg1 : !llvm.ptr) { gpu.return } } @@ -128,16 +128,16 @@ module attributes {gpu.container_module} { module @kernels { - gpu.func @kernel_1(%arg1 : !llvm<"float*">) kernel { + gpu.func @kernel_1(%arg1 : !llvm.ptr) kernel { gpu.return } } - func @launch_func_missing_kernel_attr(%sz : index, %arg : !llvm<"float*">) { + func @launch_func_missing_kernel_attr(%sz : index, %arg : !llvm.ptr) { // expected-error@+1 {{kernel module 'kernels' is undefined}} "gpu.launch_func"(%sz, %sz, %sz, %sz, %sz, %sz, %arg) {kernel = @kernels::@kernel_1} - : (index, index, index, index, index, index, !llvm<"float*">) -> () + : (index, index, index, index, index, index, !llvm.ptr) -> () return } } @@ -146,16 +146,16 @@ module attributes {gpu.container_module} { gpu.module @kernels { - gpu.func @kernel_1(%arg1 : !llvm<"float*">) { + gpu.func @kernel_1(%arg1 : !llvm.ptr) { gpu.return } } - func @launch_func_missing_kernel_attr(%sz : index, %arg : !llvm<"float*">) { + func @launch_func_missing_kernel_attr(%sz : index, %arg : !llvm.ptr) { // expected-error@+1 {{kernel function is missing the 'gpu.kernel' attribute}} "gpu.launch_func"(%sz, %sz, %sz, %sz, %sz, %sz, %arg) {kernel = @kernels::@kernel_1} - : (index, index, index, index, index, index, !llvm<"float*">) -> () + : (index, index, index, index, index, index, !llvm.ptr) -> () return } } @@ -164,17 +164,17 @@ module attributes {gpu.container_module} { gpu.module @kernels { - gpu.func @kernel_1(%arg1 : !llvm<"float*">) kernel { + gpu.func @kernel_1(%arg1 : !llvm.ptr) kernel { gpu.return } } - func @launch_func_kernel_operand_size(%sz : index, %arg : !llvm<"float*">) { + func @launch_func_kernel_operand_size(%sz : index, %arg : !llvm.ptr) { // expected-error@+1 {{got 2 kernel operands but expected 1}} "gpu.launch_func"(%sz, %sz, %sz, %sz, %sz, %sz, %arg, %arg) {kernel = @kernels::@kernel_1} - : (index, index, index, index, index, index, !llvm<"float*">, - !llvm<"float*">) -> () + : (index, index, index, index, index, index, !llvm.ptr, + !llvm.ptr) -> () return } } diff --git a/mlir/test/Dialect/GPU/multiple-all-reduce.mlir b/mlir/test/Dialect/GPU/multiple-all-reduce.mlir --- a/mlir/test/Dialect/GPU/multiple-all-reduce.mlir +++ b/mlir/test/Dialect/GPU/multiple-all-reduce.mlir @@ -18,8 +18,8 @@ } // CHECK: gpu.module @main_kernel { -// CHECK-NEXT: llvm.mlir.global internal @{{.*}}() {addr_space = 3 : i32} : !llvm<"[32 x float]"> -// CHECK-NEXT: llvm.mlir.global internal @{{.*}}() {addr_space = 3 : i32} : !llvm<"[32 x float]"> +// CHECK-NEXT: llvm.mlir.global internal @{{.*}}() {addr_space = 3 : i32} : !llvm.array<32 x float> +// CHECK-NEXT: llvm.mlir.global internal @{{.*}}() {addr_space = 3 : i32} : !llvm.array<32 x float> return } diff --git a/mlir/test/Dialect/GPU/outlining.mlir b/mlir/test/Dialect/GPU/outlining.mlir --- a/mlir/test/Dialect/GPU/outlining.mlir +++ b/mlir/test/Dialect/GPU/outlining.mlir @@ -143,7 +143,7 @@ %block_z = %cst) { call @device_function() : () -> () call @device_function() : () -> () - %0 = llvm.mlir.addressof @global : !llvm<"i64*"> + %0 = llvm.mlir.addressof @global : !llvm.ptr gpu.terminator } return @@ -163,7 +163,7 @@ // CHECK: gpu.func @function_call_kernel() // CHECK: call @device_function() : () -> () // CHECK: call @device_function() : () -> () -// CHECK: llvm.mlir.addressof @global : !llvm<"i64*"> +// CHECK: llvm.mlir.addressof @global : !llvm.ptr // CHECK: gpu.return // // CHECK: llvm.mlir.global internal @global(42 : i64) : !llvm.i64 diff --git a/mlir/test/Dialect/LLVMIR/func.mlir b/mlir/test/Dialect/LLVMIR/func.mlir --- a/mlir/test/Dialect/LLVMIR/func.mlir +++ b/mlir/test/Dialect/LLVMIR/func.mlir @@ -4,19 +4,19 @@ module { // GENERIC: "llvm.func" // GENERIC: sym_name = "foo" - // GENERIC-SAME: type = !llvm<"void ()"> + // GENERIC-SAME: type = !llvm.func // GENERIC-SAME: () -> () // CHECK: llvm.func @foo() "llvm.func"() ({ - }) {sym_name = "foo", type = !llvm<"void ()">} : () -> () + }) {sym_name = "foo", type = !llvm.func} : () -> () // GENERIC: "llvm.func" // GENERIC: sym_name = "bar" - // GENERIC-SAME: type = !llvm<"i64 (i64, i64)"> + // GENERIC-SAME: type = !llvm.func // GENERIC-SAME: () -> () // CHECK: llvm.func @bar(!llvm.i64, !llvm.i64) -> !llvm.i64 "llvm.func"() ({ - }) {sym_name = "bar", type = !llvm<"i64 (i64, i64)">} : () -> () + }) {sym_name = "bar", type = !llvm.func} : () -> () // GENERIC: "llvm.func" // CHECK: llvm.func @baz(%{{.*}}: !llvm.i64) -> !llvm.i64 @@ -27,14 +27,14 @@ llvm.return %arg0 : !llvm.i64 // GENERIC: sym_name = "baz" - // GENERIC-SAME: type = !llvm<"i64 (i64)"> + // GENERIC-SAME: type = !llvm.func // GENERIC-SAME: () -> () - }) {sym_name = "baz", type = !llvm<"i64 (i64)">} : () -> () + }) {sym_name = "baz", type = !llvm.func} : () -> () - // CHECK: llvm.func @qux(!llvm<"i64*"> {llvm.noalias = true}, !llvm.i64) + // CHECK: llvm.func @qux(!llvm.ptr {llvm.noalias = true}, !llvm.i64) // CHECK: attributes {xxx = {yyy = 42 : i64}} "llvm.func"() ({ - }) {sym_name = "qux", type = !llvm<"void (i64*, i64)">, + }) {sym_name = "qux", type = !llvm.func, i64)>, arg0 = {llvm.noalias = true}, xxx = {yyy = 42}} : () -> () // CHECK: llvm.func @roundtrip1() @@ -69,20 +69,20 @@ // CHECK: llvm.func @roundtrip8() -> !llvm.i32 llvm.func @roundtrip8() -> !llvm.i32 attributes {} - // CHECK: llvm.func @roundtrip9(!llvm<"i32*"> {llvm.noalias = true}) - llvm.func @roundtrip9(!llvm<"i32*"> {llvm.noalias = true}) + // CHECK: llvm.func @roundtrip9(!llvm.ptr {llvm.noalias = true}) + llvm.func @roundtrip9(!llvm.ptr {llvm.noalias = true}) - // CHECK: llvm.func @roundtrip10(!llvm<"i32*"> {llvm.noalias = true}) - llvm.func @roundtrip10(%arg0: !llvm<"i32*"> {llvm.noalias = true}) + // CHECK: llvm.func @roundtrip10(!llvm.ptr {llvm.noalias = true}) + llvm.func @roundtrip10(%arg0: !llvm.ptr {llvm.noalias = true}) - // CHECK: llvm.func @roundtrip11(%{{.*}}: !llvm<"i32*"> {llvm.noalias = true}) { - llvm.func @roundtrip11(%arg0: !llvm<"i32*"> {llvm.noalias = true}) { + // CHECK: llvm.func @roundtrip11(%{{.*}}: !llvm.ptr {llvm.noalias = true}) { + llvm.func @roundtrip11(%arg0: !llvm.ptr {llvm.noalias = true}) { llvm.return } - // CHECK: llvm.func @roundtrip12(%{{.*}}: !llvm<"i32*"> {llvm.noalias = true}) + // CHECK: llvm.func @roundtrip12(%{{.*}}: !llvm.ptr {llvm.noalias = true}) // CHECK: attributes {foo = 42 : i32} - llvm.func @roundtrip12(%arg0: !llvm<"i32*"> {llvm.noalias = true}) + llvm.func @roundtrip12(%arg0: !llvm.ptr {llvm.noalias = true}) attributes {foo = 42 : i32} { llvm.return } @@ -119,7 +119,7 @@ module { // expected-error@+1 {{requires one region}} - "llvm.func"() {sym_name = "no_region", type = !llvm<"void ()">} : () -> () + "llvm.func"() {sym_name = "no_region", type = !llvm.func} : () -> () } // ----- @@ -140,7 +140,7 @@ module { // expected-error@+1 {{requires 'type' attribute of wrapped LLVM function type}} - "llvm.func"() ({}) {sym_name = "non_function_type", type = !llvm<"i64">} : () -> () + "llvm.func"() ({}) {sym_name = "non_function_type", type = !llvm.i64} : () -> () } // ----- @@ -150,7 +150,7 @@ "llvm.func"() ({ ^bb0(%arg0: !llvm.i64): llvm.return - }) {sym_name = "wrong_arg_number", type = !llvm<"void ()">} : () -> () + }) {sym_name = "wrong_arg_number", type = !llvm.func} : () -> () } // ----- @@ -160,7 +160,7 @@ "llvm.func"() ({ ^bb0(%arg0: i64): llvm.return - }) {sym_name = "wrong_arg_number", type = !llvm<"void (i64)">} : () -> () + }) {sym_name = "wrong_arg_number", type = !llvm.func} : () -> () } // ----- @@ -170,7 +170,7 @@ "llvm.func"() ({ ^bb0(%arg0: !llvm.i32): llvm.return - }) {sym_name = "wrong_arg_number", type = !llvm<"void (i64)">} : () -> () + }) {sym_name = "wrong_arg_number", type = !llvm.func} : () -> () } // ----- diff --git a/mlir/test/Dialect/LLVMIR/global.mlir b/mlir/test/Dialect/LLVMIR/global.mlir --- a/mlir/test/Dialect/LLVMIR/global.mlir +++ b/mlir/test/Dialect/LLVMIR/global.mlir @@ -13,7 +13,7 @@ llvm.mlir.global internal constant @constant(37.0) : !llvm.float // CHECK: llvm.mlir.global internal constant @".string"("foobar") -llvm.mlir.global internal constant @".string"("foobar") : !llvm<"[6 x i8]"> +llvm.mlir.global internal constant @".string"("foobar") : !llvm.array<6 x i8> // CHECK: llvm.mlir.global internal @string_notype("1234567") llvm.mlir.global internal @string_notype("1234567") @@ -54,11 +54,11 @@ // CHECK-LABEL: references func @references() { - // CHECK: llvm.mlir.addressof @global : !llvm<"i64*"> - %0 = llvm.mlir.addressof @global : !llvm<"i64*"> + // CHECK: llvm.mlir.addressof @global : !llvm.ptr + %0 = llvm.mlir.addressof @global : !llvm.ptr - // CHECK: llvm.mlir.addressof @".string" : !llvm<"[6 x i8]*"> - %1 = llvm.mlir.addressof @".string" : !llvm<"[6 x i8]*"> + // CHECK: llvm.mlir.addressof @".string" : !llvm.ptr> + %1 = llvm.mlir.addressof @".string" : !llvm.ptr> llvm.return } @@ -76,7 +76,7 @@ // ----- // expected-error @+1 {{expects type to be a valid element type for an LLVM pointer}} -llvm.mlir.global internal constant @constant(37.0) : !llvm<"label"> +llvm.mlir.global internal constant @constant(37.0) : !llvm.label // ----- @@ -98,7 +98,7 @@ // ----- // expected-error @+1 {{requires an i8 array type of the length equal to that of the string}} -llvm.mlir.global internal constant @string("foobar") : !llvm<"[42 x i8]"> +llvm.mlir.global internal constant @string("foobar") : !llvm.array<42 x i8> // ----- @@ -125,14 +125,14 @@ // The attribute parser will consume the first colon-type, so we put two of // them to trigger the attribute type mismatch error. // expected-error @+1 {{invalid kind of attribute specified}} - llvm.mlir.addressof "foo" : i64 : !llvm<"void ()*"> + llvm.mlir.addressof "foo" : i64 : !llvm.ptr> } // ----- func @foo() { // expected-error @+1 {{must reference a global defined by 'llvm.mlir.global'}} - llvm.mlir.addressof @foo : !llvm<"void ()*"> + llvm.mlir.addressof @foo : !llvm.ptr> } // ----- @@ -141,7 +141,7 @@ func @bar() { // expected-error @+1 {{the type must be a pointer to the type of the referenced global}} - llvm.mlir.addressof @foo : !llvm<"i64*"> + llvm.mlir.addressof @foo : !llvm.ptr } // ----- @@ -150,7 +150,7 @@ llvm.func @bar() { // expected-error @+1 {{the type must be a pointer to the type of the referenced function}} - llvm.mlir.addressof @foo : !llvm<"i8*"> + llvm.mlir.addressof @foo : !llvm.ptr } // ----- @@ -182,7 +182,7 @@ llvm.mlir.global internal @g(32 : i64) {addr_space = 3: i32} : !llvm.i64 func @mismatch_addr_space_implicit_global() { // expected-error @+1 {{op the type must be a pointer to the type of the referenced global}} - llvm.mlir.addressof @g : !llvm<"i64*"> + llvm.mlir.addressof @g : !llvm.ptr } // ----- @@ -190,5 +190,5 @@ llvm.mlir.global internal @g(32 : i64) {addr_space = 3: i32} : !llvm.i64 func @mismatch_addr_space() { // expected-error @+1 {{op the type must be a pointer to the type of the referenced global}} - llvm.mlir.addressof @g : !llvm<"i64 addrspace(4)*"> + llvm.mlir.addressof @g : !llvm.ptr } diff --git a/mlir/test/Dialect/LLVMIR/invalid.mlir b/mlir/test/Dialect/LLVMIR/invalid.mlir --- a/mlir/test/Dialect/LLVMIR/invalid.mlir +++ b/mlir/test/Dialect/LLVMIR/invalid.mlir @@ -18,7 +18,7 @@ // ----- -func @icmp_non_string(%arg0 : !llvm.i32, %arg1 : !llvm<"i16">) { +func @icmp_non_string(%arg0 : !llvm.i32, %arg1 : !llvm.i16) { // expected-error@+1 {{invalid kind of attribute specified}} llvm.icmp 42 %arg0, %arg0 : !llvm.i32 return @@ -26,7 +26,7 @@ // ----- -func @icmp_wrong_string(%arg0 : !llvm.i32, %arg1 : !llvm<"i16">) { +func @icmp_wrong_string(%arg0 : !llvm.i32, %arg1 : !llvm.i16) { // expected-error@+1 {{'foo' is an incorrect value of the 'predicate' attribute}} llvm.icmp "foo" %arg0, %arg0 : !llvm.i32 return @@ -43,7 +43,7 @@ func @alloca_missing_input_type() { // expected-error@+1 {{expected trailing function type with one argument and one result}} - llvm.alloca %size x !llvm.i32 : () -> (!llvm<"i32*">) + llvm.alloca %size x !llvm.i32 : () -> (!llvm.ptr) } // ----- @@ -57,42 +57,42 @@ func @alloca_non_function_type() { // expected-error@+1 {{expected trailing function type with one argument and one result}} - llvm.alloca %size x !llvm.i32 : !llvm<"i32*"> + llvm.alloca %size x !llvm.i32 : !llvm.ptr } // ----- func @alloca_nonpositive_alignment(%size : !llvm.i64) { // expected-error@+1 {{expected positive alignment}} - llvm.alloca %size x !llvm.i32 {alignment = -1} : (!llvm.i64) -> (!llvm<"i32*">) + llvm.alloca %size x !llvm.i32 {alignment = -1} : (!llvm.i64) -> (!llvm.ptr) } // ----- -func @gep_missing_input_result_type(%pos : !llvm.i64, %base : !llvm<"float*">) { +func @gep_missing_input_result_type(%pos : !llvm.i64, %base : !llvm.ptr) { // expected-error@+1 {{2 operands present, but expected 0}} llvm.getelementptr %base[%pos] : () -> () } // ----- -func @gep_missing_input_type(%pos : !llvm.i64, %base : !llvm<"float*">) { +func @gep_missing_input_type(%pos : !llvm.i64, %base : !llvm.ptr) { // expected-error@+1 {{2 operands present, but expected 0}} - llvm.getelementptr %base[%pos] : () -> (!llvm<"float*">) + llvm.getelementptr %base[%pos] : () -> (!llvm.ptr) } // ----- -func @gep_missing_result_type(%pos : !llvm.i64, %base : !llvm<"float*">) { +func @gep_missing_result_type(%pos : !llvm.i64, %base : !llvm.ptr) { // expected-error@+1 {{op requires one result}} - llvm.getelementptr %base[%pos] : (!llvm<"float *">, !llvm.i64) -> () + llvm.getelementptr %base[%pos] : (!llvm.ptr, !llvm.i64) -> () } // ----- -func @gep_non_function_type(%pos : !llvm.i64, %base : !llvm<"float*">) { +func @gep_non_function_type(%pos : !llvm.i64, %base : !llvm.ptr) { // expected-error@+1 {{invalid kind of type specified}} - llvm.getelementptr %base[%pos] : !llvm<"float*"> + llvm.getelementptr %base[%pos] : !llvm.ptr } // ----- @@ -125,9 +125,9 @@ // ----- -func @call_non_function_type(%callee : !llvm<"i8(i8)">, %arg : !llvm<"i8">) { +func @call_non_function_type(%callee : !llvm.func, %arg : !llvm.i8) { // expected-error@+1 {{expected function type}} - llvm.call %callee(%arg) : !llvm<"i8(i8)"> + llvm.call %callee(%arg) : !llvm.func } // ----- @@ -155,7 +155,7 @@ func @constant_wrong_type() { // expected-error@+1 {{only supports integer, float, string or elements attributes}} - llvm.mlir.constant(@constant_wrong_type) : !llvm<"void ()*"> + llvm.mlir.constant(@constant_wrong_type) : !llvm.ptr> } // ----- @@ -171,35 +171,35 @@ // Note the double-type, otherwise attribute parsing consumes the trailing // type of the op as the (wrong) attribute type. // expected-error@+1 {{invalid kind of attribute specified}} - llvm.insertvalue %a, %b 0 : i32 : !llvm<"{i32}"> + llvm.insertvalue %a, %b 0 : i32 : !llvm.struct<(i32)> } // ----- func @insertvalue_non_integer_position() { // expected-error@+1 {{expected an array of integer literals}} - llvm.insertvalue %a, %b[0.0] : !llvm<"{i32}"> + llvm.insertvalue %a, %b[0.0] : !llvm.struct<(i32)> } // ----- func @insertvalue_struct_out_of_bounds() { // expected-error@+1 {{position out of bounds}} - llvm.insertvalue %a, %b[1] : !llvm<"{i32}"> + llvm.insertvalue %a, %b[1] : !llvm.struct<(i32)> } // ----- func @insertvalue_array_out_of_bounds() { // expected-error@+1 {{position out of bounds}} - llvm.insertvalue %a, %b[1] : !llvm<"[1 x i32]"> + llvm.insertvalue %a, %b[1] : !llvm.array<1 x i32> } // ----- func @insertvalue_wrong_nesting() { // expected-error@+1 {{expected wrapped LLVM IR structure/array type}} - llvm.insertvalue %a, %b[0,0] : !llvm<"{i32}"> + llvm.insertvalue %a, %b[0,0] : !llvm.struct<(i32)> } // ----- @@ -215,41 +215,41 @@ // Note the double-type, otherwise attribute parsing consumes the trailing // type of the op as the (wrong) attribute type. // expected-error@+1 {{invalid kind of attribute specified}} - llvm.extractvalue %b 0 : i32 : !llvm<"{i32}"> + llvm.extractvalue %b 0 : i32 : !llvm.struct<(i32)> } // ----- func @extractvalue_non_integer_position() { // expected-error@+1 {{expected an array of integer literals}} - llvm.extractvalue %b[0.0] : !llvm<"{i32}"> + llvm.extractvalue %b[0.0] : !llvm.struct<(i32)> } // ----- func @extractvalue_struct_out_of_bounds() { // expected-error@+1 {{position out of bounds}} - llvm.extractvalue %b[1] : !llvm<"{i32}"> + llvm.extractvalue %b[1] : !llvm.struct<(i32)> } // ----- func @extractvalue_array_out_of_bounds() { // expected-error@+1 {{position out of bounds}} - llvm.extractvalue %b[1] : !llvm<"[1 x i32]"> + llvm.extractvalue %b[1] : !llvm.array<1 x i32> } // ----- func @extractvalue_wrong_nesting() { // expected-error@+1 {{expected wrapped LLVM IR structure/array type}} - llvm.extractvalue %b[0,0] : !llvm<"{i32}"> + llvm.extractvalue %b[0,0] : !llvm.struct<(i32)> } // ----- // CHECK-LABEL: @invalid_vector_type_1 -func @invalid_vector_type_1(%arg0: !llvm<"<4 x float>">, %arg1: !llvm.i32, %arg2: !llvm.float) { +func @invalid_vector_type_1(%arg0: !llvm.vec<4 x float>, %arg1: !llvm.i32, %arg2: !llvm.float) { // expected-error@+1 {{expected LLVM IR dialect vector type for operand #1}} %0 = llvm.extractelement %arg2[%arg1 : !llvm.i32] : !llvm.float } @@ -257,7 +257,7 @@ // ----- // CHECK-LABEL: @invalid_vector_type_2 -func @invalid_vector_type_2(%arg0: !llvm<"<4 x float>">, %arg1: !llvm.i32, %arg2: !llvm.float) { +func @invalid_vector_type_2(%arg0: !llvm.vec<4 x float>, %arg1: !llvm.i32, %arg2: !llvm.float) { // expected-error@+1 {{expected LLVM IR dialect vector type for operand #1}} %0 = llvm.insertelement %arg2, %arg2[%arg1 : !llvm.i32] : !llvm.float } @@ -265,7 +265,7 @@ // ----- // CHECK-LABEL: @invalid_vector_type_3 -func @invalid_vector_type_3(%arg0: !llvm<"<4 x float>">, %arg1: !llvm.i32, %arg2: !llvm.float) { +func @invalid_vector_type_3(%arg0: !llvm.vec<4 x float>, %arg1: !llvm.i32, %arg2: !llvm.float) { // expected-error@+1 {{expected LLVM IR dialect vector type for operand #1}} %0 = llvm.shufflevector %arg2, %arg2 [0 : i32, 0 : i32, 0 : i32, 0 : i32, 7 : i32] : !llvm.float, !llvm.float } @@ -281,7 +281,7 @@ // CHECK-LABEL: @nvvm_invalid_shfl_pred_1 func @nvvm_invalid_shfl_pred_1(%arg0 : !llvm.i32, %arg1 : !llvm.i32, %arg2 : !llvm.i32, %arg3 : !llvm.i32) { - // expected-error@+1 {{expected return type !llvm<"{ ?, i1 }">}} + // expected-error@+1 {{expected return type to be a two-element struct with i1 as the second element}} %0 = nvvm.shfl.sync.bfly %arg0, %arg3, %arg1, %arg2 {return_value_and_is_valid} : !llvm.i32 } @@ -289,122 +289,112 @@ // CHECK-LABEL: @nvvm_invalid_shfl_pred_2 func @nvvm_invalid_shfl_pred_2(%arg0 : !llvm.i32, %arg1 : !llvm.i32, %arg2 : !llvm.i32, %arg3 : !llvm.i32) { - // expected-error@+1 {{expected return type !llvm<"{ ?, i1 }">}} - %0 = nvvm.shfl.sync.bfly %arg0, %arg3, %arg1, %arg2 {return_value_and_is_valid} : !llvm<"{ i32 }"> + // expected-error@+1 {{expected return type to be a two-element struct with i1 as the second element}} + %0 = nvvm.shfl.sync.bfly %arg0, %arg3, %arg1, %arg2 {return_value_and_is_valid} : !llvm.struct<(i32)> } // ----- // CHECK-LABEL: @nvvm_invalid_shfl_pred_3 func @nvvm_invalid_shfl_pred_3(%arg0 : !llvm.i32, %arg1 : !llvm.i32, %arg2 : !llvm.i32, %arg3 : !llvm.i32) { - // expected-error@+1 {{expected return type !llvm<"{ ?, i1 }">}} - %0 = nvvm.shfl.sync.bfly %arg0, %arg3, %arg1, %arg2 {return_value_and_is_valid} : !llvm<"{ i32, i32 }"> + // expected-error@+1 {{expected return type to be a two-element struct with i1 as the second element}} + %0 = nvvm.shfl.sync.bfly %arg0, %arg3, %arg1, %arg2 {return_value_and_is_valid} : !llvm.struct<(i32, i32)> } // ----- // CHECK-LABEL: @nvvm_invalid_mma_0 -func @nvvm_invalid_mma_0(%a0 : !llvm.half, %a1 : !llvm<"<2 x half>">, - %b0 : !llvm<"<2 x half>">, %b1 : !llvm<"<2 x half>">, +func @nvvm_invalid_mma_0(%a0 : !llvm.half, %a1 : !llvm.vec<2 x half>, + %b0 : !llvm.vec<2 x half>, %b1 : !llvm.vec<2 x half>, %c0 : !llvm.float, %c1 : !llvm.float, %c2 : !llvm.float, %c3 : !llvm.float, %c4 : !llvm.float, %c5 : !llvm.float, %c6 : !llvm.float, %c7 : !llvm.float) { // expected-error@+1 {{expected operands to be 4 s followed by either 4 s or 8 floats}} - %0 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3, %c4, %c5, %c6, %c7 {alayout="row", blayout="col"} : (!llvm.half, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float) -> !llvm<"{ float, float, float, float, float, float, float, float }"> - llvm.return %0 : !llvm<"{ float, float, float, float, float, float, float, float }"> + %0 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3, %c4, %c5, %c6, %c7 {alayout="row", blayout="col"} : (!llvm.half, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float) -> !llvm.struct<(float, float, float, float, float, float, float, float)> + llvm.return %0 : !llvm.struct<(float, float, float, float, float, float, float, float)> } // ----- // CHECK-LABEL: @nvvm_invalid_mma_1 -func @nvvm_invalid_mma_1(%a0 : !llvm<"<2 x half>">, %a1 : !llvm<"<2 x half>">, - %b0 : !llvm<"<2 x half>">, %b1 : !llvm<"<2 x half>">, +func @nvvm_invalid_mma_1(%a0 : !llvm.vec<2 x half>, %a1 : !llvm.vec<2 x half>, + %b0 : !llvm.vec<2 x half>, %b1 : !llvm.vec<2 x half>, %c0 : !llvm.float, %c1 : !llvm.float, %c2 : !llvm.float, %c3 : !llvm.float, %c4 : !llvm.float, %c5 : !llvm.float, %c6 : !llvm.float, %c7 : !llvm.float) { // expected-error@+1 {{expected result type to be a struct of either 4 s or 8 floats}} - %0 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3, %c4, %c5, %c6, %c7 {alayout="row", blayout="col"} : (!llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float) -> !llvm<"{ float, float, float, float, float, float, float, half }"> - llvm.return %0 : !llvm<"{ float, float, float, float, float, float, float, half }"> + %0 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3, %c4, %c5, %c6, %c7 {alayout="row", blayout="col"} : (!llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float) -> !llvm.struct<(float, float, float, float, float, float, float, half)> + llvm.return %0 : !llvm.struct<(float, float, float, float, float, float, float, half)> } // ----- // CHECK-LABEL: @nvvm_invalid_mma_2 -func @nvvm_invalid_mma_2(%a0 : !llvm<"<2 x half>">, %a1 : !llvm<"<2 x half>">, - %b0 : !llvm<"<2 x half>">, %b1 : !llvm<"<2 x half>">, +func @nvvm_invalid_mma_2(%a0 : !llvm.vec<2 x half>, %a1 : !llvm.vec<2 x half>, + %b0 : !llvm.vec<2 x half>, %b1 : !llvm.vec<2 x half>, %c0 : !llvm.float, %c1 : !llvm.float, %c2 : !llvm.float, %c3 : !llvm.float, %c4 : !llvm.float, %c5 : !llvm.float, %c6 : !llvm.float, %c7 : !llvm.float) { // expected-error@+1 {{alayout and blayout attributes must be set to either "row" or "col"}} - %0 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3, %c4, %c5, %c6, %c7 : (!llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float) -> !llvm<"{ float, float, float, float, float, float, float, float }"> - llvm.return %0 : !llvm<"{ float, float, float, float, float, float, float, float }"> + %0 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3, %c4, %c5, %c6, %c7 : (!llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float) -> !llvm.struct<(float, float, float, float, float, float, float, float)> + llvm.return %0 : !llvm.struct<(float, float, float, float, float, float, float, float)> } // ----- // CHECK-LABEL: @nvvm_invalid_mma_3 -func @nvvm_invalid_mma_3(%a0 : !llvm<"<2 x half>">, %a1 : !llvm<"<2 x half>">, - %b0 : !llvm<"<2 x half>">, %b1 : !llvm<"<2 x half>">, - %c0 : !llvm<"<2 x half>">, %c1 : !llvm<"<2 x half>">, - %c2 : !llvm<"<2 x half>">, %c3 : !llvm<"<2 x half>">) { +func @nvvm_invalid_mma_3(%a0 : !llvm.vec<2 x half>, %a1 : !llvm.vec<2 x half>, + %b0 : !llvm.vec<2 x half>, %b1 : !llvm.vec<2 x half>, + %c0 : !llvm.vec<2 x half>, %c1 : !llvm.vec<2 x half>, + %c2 : !llvm.vec<2 x half>, %c3 : !llvm.vec<2 x half>) { // expected-error@+1 {{unimplemented mma.sync variant}} - %0 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3 {alayout="row", blayout="col"} : (!llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">) -> !llvm<"{ float, float, float, float, float, float, float, float }"> - llvm.return %0 : !llvm<"{ float, float, float, float, float, float, float, float }"> + %0 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3 {alayout="row", blayout="col"} : (!llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>) -> !llvm.struct<(float, float, float, float, float, float, float, float)> + llvm.return %0 : !llvm.struct<(float, float, float, float, float, float, float, float)> } // ----- // CHECK-LABEL: @nvvm_invalid_mma_4 -func @nvvm_invalid_mma_4(%a0 : !llvm<"<2 x half>">, %a1 : !llvm<"<2 x half>">, - %b0 : !llvm<"<2 x half>">, %b1 : !llvm<"<2 x half>">, +func @nvvm_invalid_mma_4(%a0 : !llvm.vec<2 x half>, %a1 : !llvm.vec<2 x half>, + %b0 : !llvm.vec<2 x half>, %b1 : !llvm.vec<2 x half>, %c0 : !llvm.float, %c1 : !llvm.float, %c2 : !llvm.float, %c3 : !llvm.float, %c4 : !llvm.float, %c5 : !llvm.float, %c6 : !llvm.float, %c7 : !llvm.float) { // expected-error@+1 {{unimplemented mma.sync variant}} - %0 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3, %c4, %c5, %c6, %c7 {alayout="row", blayout="col"} : (!llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float) -> !llvm<"{<2 x half>, <2 x half>, <2 x half>, <2 x half>}"> - llvm.return %0 : !llvm<"{<2 x half>, <2 x half>, <2 x half>, <2 x half>}"> + %0 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3, %c4, %c5, %c6, %c7 {alayout="row", blayout="col"} : (!llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float) -> !llvm.struct<(vec<2 x half>, vec<2 x half>, vec<2 x half>, vec<2 x half>)> + llvm.return %0 : !llvm.struct<(vec<2 x half>, vec<2 x half>, vec<2 x half>, vec<2 x half>)> } // ----- // CHECK-LABEL: @nvvm_invalid_mma_5 -func @nvvm_invalid_mma_5(%a0 : !llvm<"<2 x half>">, %a1 : !llvm<"<2 x half>">, - %b0 : !llvm<"<2 x half>">, %b1 : !llvm<"<2 x half>">, +func @nvvm_invalid_mma_5(%a0 : !llvm.vec<2 x half>, %a1 : !llvm.vec<2 x half>, + %b0 : !llvm.vec<2 x half>, %b1 : !llvm.vec<2 x half>, %c0 : !llvm.float, %c1 : !llvm.float, %c2 : !llvm.float, %c3 : !llvm.float, %c4 : !llvm.float, %c5 : !llvm.float, %c6 : !llvm.float, %c7 : !llvm.float) { // expected-error@+1 {{unimplemented mma.sync variant}} - %0 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3, %c4, %c5, %c6, %c7 {alayout="col", blayout="row"} : (!llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float) -> !llvm<"{ float, float, float, float, float, float, float, float }"> - llvm.return %0 : !llvm<"{ float, float, float, float, float, float, float, float }"> + %0 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3, %c4, %c5, %c6, %c7 {alayout="col", blayout="row"} : (!llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float) -> !llvm.struct<(float, float, float, float, float, float, float, float)> + llvm.return %0 : !llvm.struct<(float, float, float, float, float, float, float, float)> } // ----- // CHECK-LABEL: @nvvm_invalid_mma_6 -func @nvvm_invalid_mma_6(%a0 : !llvm<"<2 x half>">, %a1 : !llvm<"<2 x half>">, - %b0 : !llvm<"<2 x half>">, %b1 : !llvm<"<2 x half>">, +func @nvvm_invalid_mma_6(%a0 : !llvm.vec<2 x half>, %a1 : !llvm.vec<2 x half>, + %b0 : !llvm.vec<2 x half>, %b1 : !llvm.vec<2 x half>, %c0 : !llvm.float, %c1 : !llvm.float, %c2 : !llvm.float, %c3 : !llvm.float, %c4 : !llvm.float, %c5 : !llvm.float, %c6 : !llvm.float, %c7 : !llvm.float) { // expected-error@+1 {{invalid kind of type specified}} - %0 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3, %c4, %c5, %c6, %c7 {alayout="col", blayout="row"} : !llvm<"{ float, float, float, float, float, float, float, float }"> - llvm.return %0 : !llvm<"{ float, float, float, float, float, float, float, float }"> + %0 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3, %c4, %c5, %c6, %c7 {alayout="col", blayout="row"} : !llvm.struct<(float, float, float, float, float, float, float, float)> + llvm.return %0 : !llvm.struct<(float, float, float, float, float, float, float, float)> } // ----- // CHECK-LABEL: @nvvm_invalid_mma_7 -func @nvvm_invalid_mma_7(%a0 : !llvm<"<2 x half>">, %a1 : !llvm<"<2 x half>">, - %b0 : !llvm<"<2 x half>">, %b1 : !llvm<"<2 x half>">, +func @nvvm_invalid_mma_7(%a0 : !llvm.vec<2 x half>, %a1 : !llvm.vec<2 x half>, + %b0 : !llvm.vec<2 x half>, %b1 : !llvm.vec<2 x half>, %c0 : !llvm.float, %c1 : !llvm.float, %c2 : !llvm.float, %c3 : !llvm.float, %c4 : !llvm.float, %c5 : !llvm.float, %c6 : !llvm.float, %c7 : !llvm.float) { // expected-error@+1 {{op requires one result}} - %0:2 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3, %c4, %c5, %c6, %c7 {alayout="col", blayout="row"} : (!llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float) -> (!llvm<"{ float, float, float, float, float, float, float, float }">, !llvm.i32) - llvm.return %0#0 : !llvm<"{ float, float, float, float, float, float, float, float }"> -} - -// ----- - -// FIXME: the LLVM-IR dialect should parse mutually recursive types -// CHECK-LABEL: @recursive_type -// expected-error@+1 {{expected end of string}} -llvm.func @recursive_type(%a : !llvm<"%a = type { %a* }">) -> - !llvm<"%a = type { %a* }"> { - llvm.return %a : !llvm<"%a = type { %a* }"> + %0:2 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3, %c4, %c5, %c6, %c7 {alayout="col", blayout="row"} : (!llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float) -> (!llvm.struct<(float, float, float, float, float, float, float, float)>, !llvm.i32) + llvm.return %0#0 : !llvm.struct<(float, float, float, float, float, float, float, float)> } // ----- @@ -419,25 +409,25 @@ // ----- // CHECK-LABEL: @atomicrmw_mismatched_operands -func @atomicrmw_mismatched_operands(%f32_ptr : !llvm<"float*">, %i32 : !llvm.i32) { +func @atomicrmw_mismatched_operands(%f32_ptr : !llvm.ptr, %i32 : !llvm.i32) { // expected-error@+1 {{expected LLVM IR element type for operand #0 to match type for operand #1}} - %0 = "llvm.atomicrmw"(%f32_ptr, %i32) {bin_op=11, ordering=1} : (!llvm<"float*">, !llvm.i32) -> !llvm.float + %0 = "llvm.atomicrmw"(%f32_ptr, %i32) {bin_op=11, ordering=1} : (!llvm.ptr, !llvm.i32) -> !llvm.float llvm.return } // ----- // CHECK-LABEL: @atomicrmw_mismatched_result -func @atomicrmw_mismatched_operands(%f32_ptr : !llvm<"float*">, %f32 : !llvm.float) { +func @atomicrmw_mismatched_operands(%f32_ptr : !llvm.ptr, %f32 : !llvm.float) { // expected-error@+1 {{expected LLVM IR result type to match type for operand #1}} - %0 = "llvm.atomicrmw"(%f32_ptr, %f32) {bin_op=11, ordering=1} : (!llvm<"float*">, !llvm.float) -> !llvm.i32 + %0 = "llvm.atomicrmw"(%f32_ptr, %f32) {bin_op=11, ordering=1} : (!llvm.ptr, !llvm.float) -> !llvm.i32 llvm.return } // ----- // CHECK-LABEL: @atomicrmw_expected_float -func @atomicrmw_expected_float(%i32_ptr : !llvm<"i32*">, %i32 : !llvm.i32) { +func @atomicrmw_expected_float(%i32_ptr : !llvm.ptr, %i32 : !llvm.i32) { // expected-error@+1 {{expected LLVM IR floating point type}} %0 = llvm.atomicrmw fadd %i32_ptr, %i32 unordered : !llvm.i32 llvm.return @@ -446,7 +436,7 @@ // ----- // CHECK-LABEL: @atomicrmw_unexpected_xchg_type -func @atomicrmw_unexpected_xchg_type(%i1_ptr : !llvm<"i1*">, %i1 : !llvm.i1) { +func @atomicrmw_unexpected_xchg_type(%i1_ptr : !llvm.ptr, %i1 : !llvm.i1) { // expected-error@+1 {{unexpected LLVM IR type for 'xchg' bin_op}} %0 = llvm.atomicrmw xchg %i1_ptr, %i1 unordered : !llvm.i1 llvm.return @@ -455,7 +445,7 @@ // ----- // CHECK-LABEL: @atomicrmw_expected_int -func @atomicrmw_expected_int(%f32_ptr : !llvm<"float*">, %f32 : !llvm.float) { +func @atomicrmw_expected_int(%f32_ptr : !llvm.ptr, %f32 : !llvm.float) { // expected-error@+1 {{expected LLVM IR integer type}} %0 = llvm.atomicrmw max %f32_ptr, %f32 unordered : !llvm.float llvm.return @@ -464,25 +454,25 @@ // ----- // CHECK-LABEL: @cmpxchg_expected_ptr -func @cmpxchg_expected_ptr(%f32_ptr : !llvm<"float*">, %f32 : !llvm.float) { +func @cmpxchg_expected_ptr(%f32_ptr : !llvm.ptr, %f32 : !llvm.float) { // expected-error@+1 {{expected LLVM IR pointer type for operand #0}} - %0 = "llvm.cmpxchg"(%f32, %f32, %f32) {success_ordering=2,failure_ordering=2} : (!llvm.float, !llvm.float, !llvm.float) -> !llvm<"{ float, i1 }"> + %0 = "llvm.cmpxchg"(%f32, %f32, %f32) {success_ordering=2,failure_ordering=2} : (!llvm.float, !llvm.float, !llvm.float) -> !llvm.struct<(float, i1)> llvm.return } // ----- // CHECK-LABEL: @cmpxchg_mismatched_operands -func @cmpxchg_mismatched_operands(%f32_ptr : !llvm<"float*">, %i32 : !llvm.i32) { +func @cmpxchg_mismatched_operands(%f32_ptr : !llvm.ptr, %i32 : !llvm.i32) { // expected-error@+1 {{expected LLVM IR element type for operand #0 to match type for all other operands}} - %0 = "llvm.cmpxchg"(%f32_ptr, %i32, %i32) {success_ordering=2,failure_ordering=2} : (!llvm<"float*">, !llvm.i32, !llvm.i32) -> !llvm<"{ i32, i1 }"> + %0 = "llvm.cmpxchg"(%f32_ptr, %i32, %i32) {success_ordering=2,failure_ordering=2} : (!llvm.ptr, !llvm.i32, !llvm.i32) -> !llvm.struct<(i32, i1)> llvm.return } // ----- // CHECK-LABEL: @cmpxchg_unexpected_type -func @cmpxchg_unexpected_type(%i1_ptr : !llvm<"i1*">, %i1 : !llvm.i1) { +func @cmpxchg_unexpected_type(%i1_ptr : !llvm.ptr, %i1 : !llvm.i1) { // expected-error@+1 {{unexpected LLVM IR type}} %0 = llvm.cmpxchg %i1_ptr, %i1, %i1 monotonic monotonic : !llvm.i1 llvm.return @@ -491,7 +481,7 @@ // ----- // CHECK-LABEL: @cmpxchg_at_least_monotonic_success -func @cmpxchg_at_least_monotonic_success(%i32_ptr : !llvm<"i32*">, %i32 : !llvm.i32) { +func @cmpxchg_at_least_monotonic_success(%i32_ptr : !llvm.ptr, %i32 : !llvm.i32) { // expected-error@+1 {{ordering must be at least 'monotonic'}} %0 = llvm.cmpxchg %i32_ptr, %i32, %i32 unordered monotonic : !llvm.i32 llvm.return @@ -500,7 +490,7 @@ // ----- // CHECK-LABEL: @cmpxchg_at_least_monotonic_failure -func @cmpxchg_at_least_monotonic_failure(%i32_ptr : !llvm<"i32*">, %i32 : !llvm.i32) { +func @cmpxchg_at_least_monotonic_failure(%i32_ptr : !llvm.ptr, %i32 : !llvm.i32) { // expected-error@+1 {{ordering must be at least 'monotonic'}} %0 = llvm.cmpxchg %i32_ptr, %i32, %i32 monotonic unordered : !llvm.i32 llvm.return @@ -509,7 +499,7 @@ // ----- // CHECK-LABEL: @cmpxchg_failure_release -func @cmpxchg_failure_release(%i32_ptr : !llvm<"i32*">, %i32 : !llvm.i32) { +func @cmpxchg_failure_release(%i32_ptr : !llvm.ptr, %i32 : !llvm.i32) { // expected-error@+1 {{failure ordering cannot be 'release' or 'acq_rel'}} %0 = llvm.cmpxchg %i32_ptr, %i32, %i32 acq_rel release : !llvm.i32 llvm.return @@ -518,7 +508,7 @@ // ----- // CHECK-LABEL: @cmpxchg_failure_acq_rel -func @cmpxchg_failure_acq_rel(%i32_ptr : !llvm<"i32*">, %i32 : !llvm.i32) { +func @cmpxchg_failure_acq_rel(%i32_ptr : !llvm.ptr, %i32 : !llvm.i32) { // expected-error@+1 {{failure ordering cannot be 'release' or 'acq_rel'}} %0 = llvm.cmpxchg %i32_ptr, %i32, %i32 acq_rel acq_rel : !llvm.i32 llvm.return @@ -529,7 +519,7 @@ llvm.func @foo(!llvm.i32) -> !llvm.i32 llvm.func @__gxx_personality_v0(...) -> !llvm.i32 -llvm.func @bad_landingpad(%arg0: !llvm<"i8**">) attributes { personality = @__gxx_personality_v0} { +llvm.func @bad_landingpad(%arg0: !llvm.ptr>) attributes { personality = @__gxx_personality_v0} { %0 = llvm.mlir.constant(3 : i32) : !llvm.i32 %1 = llvm.mlir.constant(2 : i32) : !llvm.i32 %2 = llvm.invoke @foo(%1) to ^bb1 unwind ^bb2 : (!llvm.i32) -> !llvm.i32 @@ -537,7 +527,7 @@ llvm.return %1 : !llvm.i32 ^bb2: // pred: ^bb0 // expected-error@+1 {{clause #0 is not a known constant - null, addressof, bitcast}} - %3 = llvm.landingpad cleanup (catch %1 : !llvm.i32) (catch %arg0 : !llvm<"i8**">) : !llvm<"{ i8*, i32 }"> + %3 = llvm.landingpad cleanup (catch %1 : !llvm.i32) (catch %arg0 : !llvm.ptr>) : !llvm.struct<(ptr, i32)> llvm.return %0 : !llvm.i32 } @@ -548,15 +538,15 @@ llvm.func @caller(%arg0: !llvm.i32) -> !llvm.i32 attributes { personality = @__gxx_personality_v0} { %0 = llvm.mlir.constant(1 : i32) : !llvm.i32 - %1 = llvm.alloca %0 x !llvm<"i8*"> : (!llvm.i32) -> !llvm<"i8**"> + %1 = llvm.alloca %0 x !llvm.ptr : (!llvm.i32) -> !llvm.ptr> // expected-note@+1 {{global addresses expected as operand to bitcast used in clauses for landingpad}} - %2 = llvm.bitcast %1 : !llvm<"i8**"> to !llvm<"i8*"> + %2 = llvm.bitcast %1 : !llvm.ptr> to !llvm.ptr %3 = llvm.invoke @foo(%0) to ^bb1 unwind ^bb2 : (!llvm.i32) -> !llvm.i32 ^bb1: // pred: ^bb0 llvm.return %0 : !llvm.i32 ^bb2: // pred: ^bb0 // expected-error@+1 {{constant clauses expected}} - %5 = llvm.landingpad (catch %2 : !llvm<"i8*">) : !llvm<"{ i8*, i32 }"> + %5 = llvm.landingpad (catch %2 : !llvm.ptr) : !llvm.struct<(ptr, i32)> llvm.return %0 : !llvm.i32 } @@ -572,7 +562,7 @@ llvm.return %0 : !llvm.i32 ^bb2: // pred: ^bb0 // expected-error@+1 {{landingpad instruction expects at least one clause or cleanup attribute}} - %2 = llvm.landingpad : !llvm<"{ i8*, i32 }"> + %2 = llvm.landingpad : !llvm.struct<(ptr, i32)> llvm.return %0 : !llvm.i32 } @@ -587,7 +577,7 @@ ^bb1: // pred: ^bb0 llvm.return %0 : !llvm.i32 ^bb2: // pred: ^bb0 - %2 = llvm.landingpad cleanup : !llvm<"{ i8*, i32 }"> + %2 = llvm.landingpad cleanup : !llvm.struct<(ptr, i32)> // expected-error@+1 {{'llvm.resume' op expects landingpad value as operand}} llvm.resume %0 : !llvm.i32 } @@ -603,8 +593,8 @@ llvm.return %0 : !llvm.i32 ^bb2: // pred: ^bb0 // expected-error@+1 {{llvm.landingpad needs to be in a function with a personality}} - %2 = llvm.landingpad cleanup : !llvm<"{ i8*, i32 }"> - llvm.resume %2 : !llvm<"{ i8*, i32 }"> + %2 = llvm.landingpad cleanup : !llvm.struct<(ptr, i32)> + llvm.resume %2 : !llvm.struct<(ptr, i32)> } // ----- diff --git a/mlir/test/Dialect/LLVMIR/nvvm.mlir b/mlir/test/Dialect/LLVMIR/nvvm.mlir --- a/mlir/test/Dialect/LLVMIR/nvvm.mlir +++ b/mlir/test/Dialect/LLVMIR/nvvm.mlir @@ -46,12 +46,12 @@ func @nvvm_shfl_pred( %arg0 : !llvm.i32, %arg1 : !llvm.i32, %arg2 : !llvm.i32, - %arg3 : !llvm.i32, %arg4 : !llvm.float) -> !llvm<"{ i32, i1 }"> { - // CHECK: nvvm.shfl.sync.bfly %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}} : !llvm<"{ i32, i1 }"> - %0 = nvvm.shfl.sync.bfly %arg0, %arg3, %arg1, %arg2 {return_value_and_is_valid} : !llvm<"{ i32, i1 }"> - // CHECK: nvvm.shfl.sync.bfly %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}} : !llvm<"{ float, i1 }"> - %1 = nvvm.shfl.sync.bfly %arg0, %arg4, %arg1, %arg2 {return_value_and_is_valid} : !llvm<"{ float, i1 }"> - llvm.return %0 : !llvm<"{ i32, i1 }"> + %arg3 : !llvm.i32, %arg4 : !llvm.float) -> !llvm.struct<(i32, i1)> { + // CHECK: nvvm.shfl.sync.bfly %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}} : !llvm.struct<(i32, i1)> + %0 = nvvm.shfl.sync.bfly %arg0, %arg3, %arg1, %arg2 {return_value_and_is_valid} : !llvm.struct<(i32, i1)> + // CHECK: nvvm.shfl.sync.bfly %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}} : !llvm.struct<(float, i1)> + %1 = nvvm.shfl.sync.bfly %arg0, %arg4, %arg1, %arg2 {return_value_and_is_valid} : !llvm.struct<(float, i1)> + llvm.return %0 : !llvm.struct<(i32, i1)> } func @nvvm_vote(%arg0 : !llvm.i32, %arg1 : !llvm.i1) -> !llvm.i32 { @@ -60,11 +60,11 @@ llvm.return %0 : !llvm.i32 } -func @nvvm_mma(%a0 : !llvm<"<2 x half>">, %a1 : !llvm<"<2 x half>">, - %b0 : !llvm<"<2 x half>">, %b1 : !llvm<"<2 x half>">, +func @nvvm_mma(%a0 : !llvm.vec<2 x half>, %a1 : !llvm.vec<2 x half>, + %b0 : !llvm.vec<2 x half>, %b1 : !llvm.vec<2 x half>, %c0 : !llvm.float, %c1 : !llvm.float, %c2 : !llvm.float, %c3 : !llvm.float, %c4 : !llvm.float, %c5 : !llvm.float, %c6 : !llvm.float, %c7 : !llvm.float) { - // CHECK: nvvm.mma.sync {{.*}} {alayout = "row", blayout = "col"} : (!llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float) -> !llvm<"{ float, float, float, float, float, float, float, float }"> - %0 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3, %c4, %c5, %c6, %c7 {alayout="row", blayout="col"} : (!llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float) -> !llvm<"{ float, float, float, float, float, float, float, float }"> - llvm.return %0 : !llvm<"{ float, float, float, float, float, float, float, float }"> + // CHECK: nvvm.mma.sync {{.*}} {alayout = "row", blayout = "col"} : (!llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float) -> !llvm.struct<(float, float, float, float, float, float, float, float)> + %0 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3, %c4, %c5, %c6, %c7 {alayout="row", blayout="col"} : (!llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float) -> !llvm.struct<(float, float, float, float, float, float, float, float)> + llvm.return %0 : !llvm.struct<(float, float, float, float, float, float, float, float)> } diff --git a/mlir/test/Dialect/LLVMIR/rocdl.mlir b/mlir/test/Dialect/LLVMIR/rocdl.mlir --- a/mlir/test/Dialect/LLVMIR/rocdl.mlir +++ b/mlir/test/Dialect/LLVMIR/rocdl.mlir @@ -36,133 +36,133 @@ } func @rocdl.xdlops(%arg0 : !llvm.float, %arg1 : !llvm.float, - %arg2 : !llvm<"<32 x float>">, %arg3 : !llvm.i32, - %arg4 : !llvm<"<16 x float>">, %arg5 : !llvm<"<4 x float>">, - %arg6 : !llvm<"<4 x half>">, %arg7 : !llvm<"<32 x i32>">, - %arg8 : !llvm<"<16 x i32>">, %arg9 : !llvm<"<4 x i32>">, - %arg10 : !llvm<"<2 x i16>">) -> !llvm<"<32 x float>"> { + %arg2 : !llvm.vec<32 x float>, %arg3 : !llvm.i32, + %arg4 : !llvm.vec<16 x float>, %arg5 : !llvm.vec<4 x float>, + %arg6 : !llvm.vec<4 x half>, %arg7 : !llvm.vec<32 x i32>, + %arg8 : !llvm.vec<16 x i32>, %arg9 : !llvm.vec<4 x i32>, + %arg10 : !llvm.vec<2 x i16>) -> !llvm.vec<32 x float> { // CHECK-LABEL: rocdl.xdlops - // CHECK: rocdl.mfma.f32.32x32x1f32 {{.*}} : (!llvm.float, !llvm.float, !llvm<"<32 x float>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<32 x float>"> + // CHECK: rocdl.mfma.f32.32x32x1f32 {{.*}} : (!llvm.float, !llvm.float, !llvm.vec<32 x float>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<32 x float> %r0 = rocdl.mfma.f32.32x32x1f32 %arg0, %arg1, %arg2, %arg3, %arg3, %arg3 : - (!llvm.float, !llvm.float, !llvm<"<32 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<32 x float>"> + (!llvm.float, !llvm.float, !llvm.vec<32 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<32 x float> - // CHECK: rocdl.mfma.f32.16x16x1f32 {{.*}} : (!llvm.float, !llvm.float, !llvm<"<16 x float>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x float>"> + // CHECK: rocdl.mfma.f32.16x16x1f32 {{.*}} : (!llvm.float, !llvm.float, !llvm.vec<16 x float>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x float> %r1 = rocdl.mfma.f32.16x16x1f32 %arg0, %arg1, %arg4, %arg3, %arg3, %arg3 : - (!llvm.float, !llvm.float, !llvm<"<16 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x float>"> + (!llvm.float, !llvm.float, !llvm.vec<16 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x float> - // CHECK: rocdl.mfma.f32.16x16x4f32 {{.*}} : (!llvm.float, !llvm.float, !llvm<"<4 x float>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x float>"> + // CHECK: rocdl.mfma.f32.16x16x4f32 {{.*}} : (!llvm.float, !llvm.float, !llvm.vec<4 x float>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x float> %r2 = rocdl.mfma.f32.16x16x4f32 %arg0, %arg1, %arg5, %arg3, %arg3, %arg3 : - (!llvm.float, !llvm.float, !llvm<"<4 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x float>"> + (!llvm.float, !llvm.float, !llvm.vec<4 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x float> - // CHECK: rocdl.mfma.f32.4x4x1f32 {{.*}} : (!llvm.float, !llvm.float, !llvm<"<4 x float>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x float>"> + // CHECK: rocdl.mfma.f32.4x4x1f32 {{.*}} : (!llvm.float, !llvm.float, !llvm.vec<4 x float>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x float> %r3 = rocdl.mfma.f32.4x4x1f32 %arg0, %arg1, %arg5, %arg3, %arg3, %arg3 : - (!llvm.float, !llvm.float, !llvm<"<4 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x float>"> + (!llvm.float, !llvm.float, !llvm.vec<4 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x float> - // CHECK: rocdl.mfma.f32.32x32x2f32 {{.*}} : (!llvm.float, !llvm.float, !llvm<"<16 x float>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x float>"> + // CHECK: rocdl.mfma.f32.32x32x2f32 {{.*}} : (!llvm.float, !llvm.float, !llvm.vec<16 x float>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x float> %r4= rocdl.mfma.f32.32x32x2f32 %arg0, %arg1, %arg4, %arg3, %arg3, %arg3 : - (!llvm.float, !llvm.float, !llvm<"<16 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x float>"> + (!llvm.float, !llvm.float, !llvm.vec<16 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x float> - // CHECK: rocdl.mfma.f32.32x32x4f16 {{.*}} : (!llvm<"<4 x half>">, !llvm<"<4 x half>">, !llvm<"<32 x float>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<32 x float>"> + // CHECK: rocdl.mfma.f32.32x32x4f16 {{.*}} : (!llvm.vec<4 x half>, !llvm.vec<4 x half>, !llvm.vec<32 x float>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<32 x float> %r5 = rocdl.mfma.f32.32x32x4f16 %arg6, %arg6, %arg2, %arg3, %arg3, %arg3 : - (!llvm<"<4 x half>">, !llvm<"<4 x half>">, !llvm<"<32 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<32 x float>"> + (!llvm.vec<4 x half>, !llvm.vec<4 x half>, !llvm.vec<32 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<32 x float> - // CHECK: rocdl.mfma.f32.16x16x4f16 {{.*}} : (!llvm<"<4 x half>">, !llvm<"<4 x half>">, !llvm<"<16 x float>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x float>"> + // CHECK: rocdl.mfma.f32.16x16x4f16 {{.*}} : (!llvm.vec<4 x half>, !llvm.vec<4 x half>, !llvm.vec<16 x float>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x float> %r6 = rocdl.mfma.f32.16x16x4f16 %arg6, %arg6, %arg4, %arg3, %arg3, %arg3 : - (!llvm<"<4 x half>">, !llvm<"<4 x half>">, !llvm<"<16 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x float>"> + (!llvm.vec<4 x half>, !llvm.vec<4 x half>, !llvm.vec<16 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x float> - // CHECK: rocdl.mfma.f32.4x4x4f16 {{.*}} : (!llvm<"<4 x half>">, !llvm<"<4 x half>">, !llvm<"<4 x float>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x float>"> + // CHECK: rocdl.mfma.f32.4x4x4f16 {{.*}} : (!llvm.vec<4 x half>, !llvm.vec<4 x half>, !llvm.vec<4 x float>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x float> %r7 = rocdl.mfma.f32.4x4x4f16 %arg6, %arg6, %arg5, %arg3, %arg3, %arg3 : - (!llvm<"<4 x half>">, !llvm<"<4 x half>">, !llvm<"<4 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x float>"> + (!llvm.vec<4 x half>, !llvm.vec<4 x half>, !llvm.vec<4 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x float> - // CHECK: rocdl.mfma.f32.32x32x8f16 {{.*}} : (!llvm<"<4 x half>">, !llvm<"<4 x half>">, !llvm<"<16 x float>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x float>"> + // CHECK: rocdl.mfma.f32.32x32x8f16 {{.*}} : (!llvm.vec<4 x half>, !llvm.vec<4 x half>, !llvm.vec<16 x float>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x float> %r8 = rocdl.mfma.f32.32x32x8f16 %arg6, %arg6, %arg4, %arg3, %arg3, %arg3 : - (!llvm<"<4 x half>">, !llvm<"<4 x half>">, !llvm<"<16 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x float>"> + (!llvm.vec<4 x half>, !llvm.vec<4 x half>, !llvm.vec<16 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x float> - // CHECK: rocdl.mfma.f32.16x16x16f16 {{.*}} : (!llvm<"<4 x half>">, !llvm<"<4 x half>">, !llvm<"<4 x float>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x float>"> + // CHECK: rocdl.mfma.f32.16x16x16f16 {{.*}} : (!llvm.vec<4 x half>, !llvm.vec<4 x half>, !llvm.vec<4 x float>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x float> %r9 = rocdl.mfma.f32.16x16x16f16 %arg6, %arg6, %arg5, %arg3, %arg3, %arg3 : - (!llvm<"<4 x half>">, !llvm<"<4 x half>">, !llvm<"<4 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x float>"> + (!llvm.vec<4 x half>, !llvm.vec<4 x half>, !llvm.vec<4 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x float> - // CHECK: rocdl.mfma.i32.32x32x4i8 {{.*}} : (!llvm.i32, !llvm.i32, !llvm<"<32 x i32>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<32 x i32>"> + // CHECK: rocdl.mfma.i32.32x32x4i8 {{.*}} : (!llvm.i32, !llvm.i32, !llvm.vec<32 x i32>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<32 x i32> %r10 = rocdl.mfma.i32.32x32x4i8 %arg3, %arg3, %arg7, %arg3, %arg3, %arg3 : - (!llvm.i32, !llvm.i32, !llvm<"<32 x i32>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<32 x i32>"> + (!llvm.i32, !llvm.i32, !llvm.vec<32 x i32>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<32 x i32> - // CHECK: rocdl.mfma.i32.16x16x4i8 {{.*}} : (!llvm.i32, !llvm.i32, !llvm<"<16 x i32>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x i32>"> + // CHECK: rocdl.mfma.i32.16x16x4i8 {{.*}} : (!llvm.i32, !llvm.i32, !llvm.vec<16 x i32>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x i32> %r11 = rocdl.mfma.i32.16x16x4i8 %arg3, %arg3, %arg8, %arg3, %arg3, %arg3 : - (!llvm.i32, !llvm.i32, !llvm<"<16 x i32>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x i32>"> + (!llvm.i32, !llvm.i32, !llvm.vec<16 x i32>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x i32> - // CHECK: rocdl.mfma.i32.4x4x4i8 {{.*}} : (!llvm.i32, !llvm.i32, !llvm<"<4 x i32>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x i32>"> + // CHECK: rocdl.mfma.i32.4x4x4i8 {{.*}} : (!llvm.i32, !llvm.i32, !llvm.vec<4 x i32>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x i32> %r12 = rocdl.mfma.i32.4x4x4i8 %arg3, %arg3, %arg9, %arg3, %arg3, %arg3 : - (!llvm.i32, !llvm.i32, !llvm<"<4 x i32>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x i32>"> + (!llvm.i32, !llvm.i32, !llvm.vec<4 x i32>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x i32> - // CHECK: rocdl.mfma.i32.32x32x8i8 {{.*}} : (!llvm.i32, !llvm.i32, !llvm<"<16 x i32>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x i32>"> + // CHECK: rocdl.mfma.i32.32x32x8i8 {{.*}} : (!llvm.i32, !llvm.i32, !llvm.vec<16 x i32>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x i32> %r13 = rocdl.mfma.i32.32x32x8i8 %arg3, %arg3, %arg8, %arg3, %arg3, %arg3 : - (!llvm.i32, !llvm.i32, !llvm<"<16 x i32>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x i32>"> + (!llvm.i32, !llvm.i32, !llvm.vec<16 x i32>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x i32> - // CHECK: rocdl.mfma.i32.16x16x16i8 {{.*}} : (!llvm.i32, !llvm.i32, !llvm<"<4 x i32>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x i32>"> + // CHECK: rocdl.mfma.i32.16x16x16i8 {{.*}} : (!llvm.i32, !llvm.i32, !llvm.vec<4 x i32>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x i32> %r14 = rocdl.mfma.i32.16x16x16i8 %arg3, %arg3, %arg9, %arg3, %arg3, %arg3 : - (!llvm.i32, !llvm.i32, !llvm<"<4 x i32>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x i32>"> + (!llvm.i32, !llvm.i32, !llvm.vec<4 x i32>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x i32> - // CHECK: rocdl.mfma.f32.32x32x2bf16 {{.*}} : (!llvm<"<2 x i16>">, !llvm<"<2 x i16>">, !llvm<"<32 x float>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<32 x float>"> + // CHECK: rocdl.mfma.f32.32x32x2bf16 {{.*}} : (!llvm.vec<2 x i16>, !llvm.vec<2 x i16>, !llvm.vec<32 x float>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<32 x float> %r15 = rocdl.mfma.f32.32x32x2bf16 %arg10, %arg10, %arg2, %arg3, %arg3, %arg3 : - (!llvm<"<2 x i16>">, !llvm<"<2 x i16>">, !llvm<"<32 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<32 x float>"> + (!llvm.vec<2 x i16>, !llvm.vec<2 x i16>, !llvm.vec<32 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<32 x float> - // CHECK: rocdl.mfma.f32.16x16x2bf16 {{.*}} : (!llvm<"<2 x i16>">, !llvm<"<2 x i16>">, !llvm<"<16 x float>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x float>"> + // CHECK: rocdl.mfma.f32.16x16x2bf16 {{.*}} : (!llvm.vec<2 x i16>, !llvm.vec<2 x i16>, !llvm.vec<16 x float>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x float> %r16 = rocdl.mfma.f32.16x16x2bf16 %arg10, %arg10, %arg4, %arg3, %arg3, %arg3 : - (!llvm<"<2 x i16>">, !llvm<"<2 x i16>">, !llvm<"<16 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x float>"> + (!llvm.vec<2 x i16>, !llvm.vec<2 x i16>, !llvm.vec<16 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x float> - // CHECK: rocdl.mfma.f32.4x4x2bf16 {{.*}} : (!llvm<"<2 x i16>">, !llvm<"<2 x i16>">, !llvm<"<4 x float>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x float>"> + // CHECK: rocdl.mfma.f32.4x4x2bf16 {{.*}} : (!llvm.vec<2 x i16>, !llvm.vec<2 x i16>, !llvm.vec<4 x float>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x float> %r17 = rocdl.mfma.f32.4x4x2bf16 %arg10, %arg10, %arg5, %arg3, %arg3, %arg3 : - (!llvm<"<2 x i16>">, !llvm<"<2 x i16>">, !llvm<"<4 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x float>"> + (!llvm.vec<2 x i16>, !llvm.vec<2 x i16>, !llvm.vec<4 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x float> - // CHECK: rocdl.mfma.f32.32x32x4bf16 {{.*}} : (!llvm<"<2 x i16>">, !llvm<"<2 x i16>">, !llvm<"<16 x float>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x float>"> + // CHECK: rocdl.mfma.f32.32x32x4bf16 {{.*}} : (!llvm.vec<2 x i16>, !llvm.vec<2 x i16>, !llvm.vec<16 x float>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x float> %r18 = rocdl.mfma.f32.32x32x4bf16 %arg10, %arg10, %arg4, %arg3, %arg3, %arg3 : - (!llvm<"<2 x i16>">, !llvm<"<2 x i16>">, !llvm<"<16 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x float>"> + (!llvm.vec<2 x i16>, !llvm.vec<2 x i16>, !llvm.vec<16 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x float> - // CHECK: rocdl.mfma.f32.16x16x8bf16 {{.*}} : (!llvm<"<2 x i16>">, !llvm<"<2 x i16>">, !llvm<"<4 x float>">, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x float>"> + // CHECK: rocdl.mfma.f32.16x16x8bf16 {{.*}} : (!llvm.vec<2 x i16>, !llvm.vec<2 x i16>, !llvm.vec<4 x float>, !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x float> %r19 = rocdl.mfma.f32.16x16x8bf16 %arg10, %arg10, %arg5, %arg3, %arg3, %arg3 : - (!llvm<"<2 x i16>">, !llvm<"<2 x i16>">, !llvm<"<4 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x float>"> + (!llvm.vec<2 x i16>, !llvm.vec<2 x i16>, !llvm.vec<4 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x float> - llvm.return %r0 : !llvm<"<32 x float>"> + llvm.return %r0 : !llvm.vec<32 x float> } -llvm.func @rocdl.mubuf(%rsrc : !llvm<"<4 x i32>">, %vindex : !llvm.i32, +llvm.func @rocdl.mubuf(%rsrc : !llvm.vec<4 x i32>, %vindex : !llvm.i32, %offset : !llvm.i32, %glc : !llvm.i1, - %slc : !llvm.i1, %vdata1 : !llvm<"<1 x float>">, - %vdata2 : !llvm<"<2 x float>">, %vdata4 : !llvm<"<4 x float>">) { + %slc : !llvm.i1, %vdata1 : !llvm.vec<1 x float>, + %vdata2 : !llvm.vec<2 x float>, %vdata4 : !llvm.vec<4 x float>) { // CHECK-LABEL: rocdl.mubuf - // CHECK: %{{.*}} = rocdl.buffer.load %{{.*}} %{{.*}} %{{.*}} %{{.*}} %{{.*}} : !llvm<"<1 x float>"> - %r1 = rocdl.buffer.load %rsrc, %vindex, %offset, %glc, %slc : !llvm<"<1 x float>"> - // CHECK: %{{.*}} = rocdl.buffer.load %{{.*}} %{{.*}} %{{.*}} %{{.*}} %{{.*}} : !llvm<"<2 x float>"> - %r2 = rocdl.buffer.load %rsrc, %vindex, %offset, %glc, %slc : !llvm<"<2 x float>"> - // CHECK: %{{.*}} = rocdl.buffer.load %{{.*}} %{{.*}} %{{.*}} %{{.*}} %{{.*}} : !llvm<"<4 x float>"> - %r4 = rocdl.buffer.load %rsrc, %vindex, %offset, %glc, %slc : !llvm<"<4 x float>"> - - // CHECK: rocdl.buffer.store %{{.*}} %{{.*}} %{{.*}} %{{.*}} %{{.*}} %{{.*}} : !llvm<"<1 x float>"> - rocdl.buffer.store %vdata1, %rsrc, %vindex, %offset, %glc, %slc : !llvm<"<1 x float>"> - // CHECK: rocdl.buffer.store %{{.*}} %{{.*}} %{{.*}} %{{.*}} %{{.*}} %{{.*}} : !llvm<"<2 x float>"> - rocdl.buffer.store %vdata2, %rsrc, %vindex, %offset, %glc, %slc : !llvm<"<2 x float>"> - // CHECK: rocdl.buffer.store %{{.*}} %{{.*}} %{{.*}} %{{.*}} %{{.*}} %{{.*}} : !llvm<"<4 x float>"> - rocdl.buffer.store %vdata4, %rsrc, %vindex, %offset, %glc, %slc : !llvm<"<4 x float>"> + // CHECK: %{{.*}} = rocdl.buffer.load %{{.*}} %{{.*}} %{{.*}} %{{.*}} %{{.*}} : !llvm.vec<1 x float> + %r1 = rocdl.buffer.load %rsrc, %vindex, %offset, %glc, %slc : !llvm.vec<1 x float> + // CHECK: %{{.*}} = rocdl.buffer.load %{{.*}} %{{.*}} %{{.*}} %{{.*}} %{{.*}} : !llvm.vec<2 x float> + %r2 = rocdl.buffer.load %rsrc, %vindex, %offset, %glc, %slc : !llvm.vec<2 x float> + // CHECK: %{{.*}} = rocdl.buffer.load %{{.*}} %{{.*}} %{{.*}} %{{.*}} %{{.*}} : !llvm.vec<4 x float> + %r4 = rocdl.buffer.load %rsrc, %vindex, %offset, %glc, %slc : !llvm.vec<4 x float> + + // CHECK: rocdl.buffer.store %{{.*}} %{{.*}} %{{.*}} %{{.*}} %{{.*}} %{{.*}} : !llvm.vec<1 x float> + rocdl.buffer.store %vdata1, %rsrc, %vindex, %offset, %glc, %slc : !llvm.vec<1 x float> + // CHECK: rocdl.buffer.store %{{.*}} %{{.*}} %{{.*}} %{{.*}} %{{.*}} %{{.*}} : !llvm.vec<2 x float> + rocdl.buffer.store %vdata2, %rsrc, %vindex, %offset, %glc, %slc : !llvm.vec<2 x float> + // CHECK: rocdl.buffer.store %{{.*}} %{{.*}} %{{.*}} %{{.*}} %{{.*}} %{{.*}} : !llvm.vec<4 x float> + rocdl.buffer.store %vdata4, %rsrc, %vindex, %offset, %glc, %slc : !llvm.vec<4 x float> llvm.return } diff --git a/mlir/test/Dialect/LLVMIR/roundtrip.mlir b/mlir/test/Dialect/LLVMIR/roundtrip.mlir --- a/mlir/test/Dialect/LLVMIR/roundtrip.mlir +++ b/mlir/test/Dialect/LLVMIR/roundtrip.mlir @@ -1,9 +1,9 @@ // RUN: mlir-opt %s | mlir-opt | FileCheck %s // CHECK-LABEL: func @ops -// CHECK-SAME: (%[[I32:.*]]: !llvm.i32, %[[FLOAT:.*]]: !llvm.float, %[[I8PTR1:.*]]: !llvm<"i8*">, %[[I8PTR2:.*]]: !llvm<"i8*">, %[[BOOL:.*]]: !llvm.i1) +// CHECK-SAME: (%[[I32:.*]]: !llvm.i32, %[[FLOAT:.*]]: !llvm.float, %[[I8PTR1:.*]]: !llvm.ptr, %[[I8PTR2:.*]]: !llvm.ptr, %[[BOOL:.*]]: !llvm.i1) func @ops(%arg0: !llvm.i32, %arg1: !llvm.float, - %arg2: !llvm<"i8*">, %arg3: !llvm<"i8*">, + %arg2: !llvm.ptr, %arg3: !llvm.ptr, %arg4: !llvm.i1) { // Integer arithmetic binary operations. // @@ -39,29 +39,29 @@ // Memory-related operations. // -// CHECK-NEXT: %[[ALLOCA:.*]] = llvm.alloca %[[I32]] x !llvm.double : (!llvm.i32) -> !llvm<"double*"> -// CHECK-NEXT: %[[GEP:.*]] = llvm.getelementptr %[[ALLOCA]][%[[I32]], %[[I32]]] : (!llvm<"double*">, !llvm.i32, !llvm.i32) -> !llvm<"double*"> -// CHECK-NEXT: %[[VALUE:.*]] = llvm.load %[[GEP]] : !llvm<"double*"> -// CHECK-NEXT: llvm.store %[[VALUE]], %[[ALLOCA]] : !llvm<"double*"> -// CHECK-NEXT: %{{.*}} = llvm.bitcast %[[ALLOCA]] : !llvm<"double*"> to !llvm<"i64*"> - %13 = llvm.alloca %arg0 x !llvm.double : (!llvm.i32) -> !llvm<"double*"> - %14 = llvm.getelementptr %13[%arg0, %arg0] : (!llvm<"double*">, !llvm.i32, !llvm.i32) -> !llvm<"double*"> - %15 = llvm.load %14 : !llvm<"double*"> - llvm.store %15, %13 : !llvm<"double*"> - %16 = llvm.bitcast %13 : !llvm<"double*"> to !llvm<"i64*"> +// CHECK-NEXT: %[[ALLOCA:.*]] = llvm.alloca %[[I32]] x !llvm.double : (!llvm.i32) -> !llvm.ptr +// CHECK-NEXT: %[[GEP:.*]] = llvm.getelementptr %[[ALLOCA]][%[[I32]], %[[I32]]] : (!llvm.ptr, !llvm.i32, !llvm.i32) -> !llvm.ptr +// CHECK-NEXT: %[[VALUE:.*]] = llvm.load %[[GEP]] : !llvm.ptr +// CHECK-NEXT: llvm.store %[[VALUE]], %[[ALLOCA]] : !llvm.ptr +// CHECK-NEXT: %{{.*}} = llvm.bitcast %[[ALLOCA]] : !llvm.ptr to !llvm.ptr + %13 = llvm.alloca %arg0 x !llvm.double : (!llvm.i32) -> !llvm.ptr + %14 = llvm.getelementptr %13[%arg0, %arg0] : (!llvm.ptr, !llvm.i32, !llvm.i32) -> !llvm.ptr + %15 = llvm.load %14 : !llvm.ptr + llvm.store %15, %13 : !llvm.ptr + %16 = llvm.bitcast %13 : !llvm.ptr to !llvm.ptr // Function call-related operations. // -// CHECK: %[[STRUCT:.*]] = llvm.call @foo(%[[I32]]) : (!llvm.i32) -> !llvm<"{ i32, double, i32 }"> -// CHECK: %[[VALUE:.*]] = llvm.extractvalue %[[STRUCT]][0] : !llvm<"{ i32, double, i32 }"> -// CHECK: %[[NEW_STRUCT:.*]] = llvm.insertvalue %[[VALUE]], %[[STRUCT]][2] : !llvm<"{ i32, double, i32 }"> -// CHECK: %[[FUNC:.*]] = llvm.mlir.addressof @foo : !llvm<"{ i32, double, i32 } (i32)*"> -// CHECK: %{{.*}} = llvm.call %[[FUNC]](%[[I32]]) : (!llvm.i32) -> !llvm<"{ i32, double, i32 }"> - %17 = llvm.call @foo(%arg0) : (!llvm.i32) -> !llvm<"{ i32, double, i32 }"> - %18 = llvm.extractvalue %17[0] : !llvm<"{ i32, double, i32 }"> - %19 = llvm.insertvalue %18, %17[2] : !llvm<"{ i32, double, i32 }"> - %20 = llvm.mlir.addressof @foo : !llvm<"{ i32, double, i32 } (i32)*"> - %21 = llvm.call %20(%arg0) : (!llvm.i32) -> !llvm<"{ i32, double, i32 }"> +// CHECK: %[[STRUCT:.*]] = llvm.call @foo(%[[I32]]) : (!llvm.i32) -> !llvm.struct<(i32, double, i32)> +// CHECK: %[[VALUE:.*]] = llvm.extractvalue %[[STRUCT]][0] : !llvm.struct<(i32, double, i32)> +// CHECK: %[[NEW_STRUCT:.*]] = llvm.insertvalue %[[VALUE]], %[[STRUCT]][2] : !llvm.struct<(i32, double, i32)> +// CHECK: %[[FUNC:.*]] = llvm.mlir.addressof @foo : !llvm.ptr (i32)>> +// CHECK: %{{.*}} = llvm.call %[[FUNC]](%[[I32]]) : (!llvm.i32) -> !llvm.struct<(i32, double, i32)> + %17 = llvm.call @foo(%arg0) : (!llvm.i32) -> !llvm.struct<(i32, double, i32)> + %18 = llvm.extractvalue %17[0] : !llvm.struct<(i32, double, i32)> + %19 = llvm.insertvalue %18, %17[2] : !llvm.struct<(i32, double, i32)> + %20 = llvm.mlir.addressof @foo : !llvm.ptr (i32)>> + %21 = llvm.call %20(%arg0) : (!llvm.i32) -> !llvm.struct<(i32, double, i32)> // Terminator operations and their successors. @@ -76,9 +76,9 @@ // CHECK: ^[[BB2]] ^bb2: -// CHECK: %{{.*}} = llvm.mlir.undef : !llvm<"{ i32, double, i32 }"> +// CHECK: %{{.*}} = llvm.mlir.undef : !llvm.struct<(i32, double, i32)> // CHECK: %{{.*}} = llvm.mlir.constant(42 : i64) : !llvm.i47 - %22 = llvm.mlir.undef : !llvm<"{ i32, double, i32 }"> + %22 = llvm.mlir.undef : !llvm.struct<(i32, double, i32)> %23 = llvm.mlir.constant(42) : !llvm.i47 // Misc operations. @@ -87,10 +87,10 @@ // Integer to pointer and pointer to integer conversions. // -// CHECK: %[[PTR:.*]] = llvm.inttoptr %[[I32]] : !llvm.i32 to !llvm<"i32*"> -// CHECK: %{{.*}} = llvm.ptrtoint %[[PTR]] : !llvm<"i32*"> to !llvm.i32 - %25 = llvm.inttoptr %arg0 : !llvm.i32 to !llvm<"i32*"> - %26 = llvm.ptrtoint %25 : !llvm<"i32*"> to !llvm.i32 +// CHECK: %[[PTR:.*]] = llvm.inttoptr %[[I32]] : !llvm.i32 to !llvm.ptr +// CHECK: %{{.*}} = llvm.ptrtoint %[[PTR]] : !llvm.ptr to !llvm.i32 + %25 = llvm.inttoptr %arg0 : !llvm.i32 to !llvm.ptr + %26 = llvm.ptrtoint %25 : !llvm.ptr to !llvm.i32 // Extended and Quad floating point // @@ -114,24 +114,24 @@ // CHECK: "llvm.intr.ctpop"(%{{.*}}) : (!llvm.i32) -> !llvm.i32 %33 = "llvm.intr.ctpop"(%arg0) : (!llvm.i32) -> !llvm.i32 -// CHECK: "llvm.intr.memcpy"(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) : (!llvm<"i8*">, !llvm<"i8*">, !llvm.i32, !llvm.i1) -> () - "llvm.intr.memcpy"(%arg2, %arg3, %arg0, %arg4) : (!llvm<"i8*">, !llvm<"i8*">, !llvm.i32, !llvm.i1) -> () +// CHECK: "llvm.intr.memcpy"(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) : (!llvm.ptr, !llvm.ptr, !llvm.i32, !llvm.i1) -> () + "llvm.intr.memcpy"(%arg2, %arg3, %arg0, %arg4) : (!llvm.ptr, !llvm.ptr, !llvm.i32, !llvm.i1) -> () -// CHECK: "llvm.intr.memcpy"(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) : (!llvm<"i8*">, !llvm<"i8*">, !llvm.i32, !llvm.i1) -> () - "llvm.intr.memcpy"(%arg2, %arg3, %arg0, %arg4) : (!llvm<"i8*">, !llvm<"i8*">, !llvm.i32, !llvm.i1) -> () +// CHECK: "llvm.intr.memcpy"(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) : (!llvm.ptr, !llvm.ptr, !llvm.i32, !llvm.i1) -> () + "llvm.intr.memcpy"(%arg2, %arg3, %arg0, %arg4) : (!llvm.ptr, !llvm.ptr, !llvm.i32, !llvm.i1) -> () // CHECK: %[[SZ:.*]] = llvm.mlir.constant %sz = llvm.mlir.constant(10: i64) : !llvm.i64 -// CHECK: "llvm.intr.memcpy.inline"(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) : (!llvm<"i8*">, !llvm<"i8*">, !llvm.i64, !llvm.i1) -> () - "llvm.intr.memcpy.inline"(%arg2, %arg3, %sz, %arg4) : (!llvm<"i8*">, !llvm<"i8*">, !llvm.i64, !llvm.i1) -> () +// CHECK: "llvm.intr.memcpy.inline"(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) : (!llvm.ptr, !llvm.ptr, !llvm.i64, !llvm.i1) -> () + "llvm.intr.memcpy.inline"(%arg2, %arg3, %sz, %arg4) : (!llvm.ptr, !llvm.ptr, !llvm.i64, !llvm.i1) -> () // CHECK: llvm.return llvm.return } // An larger self-contained function. -// CHECK-LABEL: llvm.func @foo(%{{.*}}: !llvm.i32) -> !llvm<"{ i32, double, i32 }"> { -llvm.func @foo(%arg0: !llvm.i32) -> !llvm<"{ i32, double, i32 }"> { +// CHECK-LABEL: llvm.func @foo(%{{.*}}: !llvm.i32) -> !llvm.struct<(i32, double, i32)> { +llvm.func @foo(%arg0: !llvm.i32) -> !llvm.struct<(i32, double, i32)> { // CHECK: %[[V0:.*]] = llvm.mlir.constant(3 : i64) : !llvm.i32 // CHECK: %[[V1:.*]] = llvm.mlir.constant(3 : i64) : !llvm.i32 // CHECK: %[[V2:.*]] = llvm.mlir.constant(4.200000e+01 : f64) : !llvm.double @@ -154,56 +154,56 @@ llvm.cond_br %8, ^bb1(%4 : !llvm.i32), ^bb2(%4 : !llvm.i32) // CHECK:^[[BB1]](%[[V9:.*]]: !llvm.i32): -// CHECK: %[[V10:.*]] = llvm.call @foo(%[[V9]]) : (!llvm.i32) -> !llvm<"{ i32, double, i32 }"> -// CHECK: %[[V11:.*]] = llvm.extractvalue %[[V10]][0] : !llvm<"{ i32, double, i32 }"> -// CHECK: %[[V12:.*]] = llvm.extractvalue %[[V10]][1] : !llvm<"{ i32, double, i32 }"> -// CHECK: %[[V13:.*]] = llvm.extractvalue %[[V10]][2] : !llvm<"{ i32, double, i32 }"> -// CHECK: %[[V14:.*]] = llvm.mlir.undef : !llvm<"{ i32, double, i32 }"> -// CHECK: %[[V15:.*]] = llvm.insertvalue %[[V5]], %[[V14]][0] : !llvm<"{ i32, double, i32 }"> -// CHECK: %[[V16:.*]] = llvm.insertvalue %[[V7]], %[[V15]][1] : !llvm<"{ i32, double, i32 }"> -// CHECK: %[[V17:.*]] = llvm.insertvalue %[[V11]], %[[V16]][2] : !llvm<"{ i32, double, i32 }"> -// CHECK: llvm.return %[[V17]] : !llvm<"{ i32, double, i32 }"> +// CHECK: %[[V10:.*]] = llvm.call @foo(%[[V9]]) : (!llvm.i32) -> !llvm.struct<(i32, double, i32)> +// CHECK: %[[V11:.*]] = llvm.extractvalue %[[V10]][0] : !llvm.struct<(i32, double, i32)> +// CHECK: %[[V12:.*]] = llvm.extractvalue %[[V10]][1] : !llvm.struct<(i32, double, i32)> +// CHECK: %[[V13:.*]] = llvm.extractvalue %[[V10]][2] : !llvm.struct<(i32, double, i32)> +// CHECK: %[[V14:.*]] = llvm.mlir.undef : !llvm.struct<(i32, double, i32)> +// CHECK: %[[V15:.*]] = llvm.insertvalue %[[V5]], %[[V14]][0] : !llvm.struct<(i32, double, i32)> +// CHECK: %[[V16:.*]] = llvm.insertvalue %[[V7]], %[[V15]][1] : !llvm.struct<(i32, double, i32)> +// CHECK: %[[V17:.*]] = llvm.insertvalue %[[V11]], %[[V16]][2] : !llvm.struct<(i32, double, i32)> +// CHECK: llvm.return %[[V17]] : !llvm.struct<(i32, double, i32)> ^bb1(%9: !llvm.i32): - %10 = llvm.call @foo(%9) : (!llvm.i32) -> !llvm<"{ i32, double, i32 }"> - %11 = llvm.extractvalue %10[0] : !llvm<"{ i32, double, i32 }"> - %12 = llvm.extractvalue %10[1] : !llvm<"{ i32, double, i32 }"> - %13 = llvm.extractvalue %10[2] : !llvm<"{ i32, double, i32 }"> - %14 = llvm.mlir.undef : !llvm<"{ i32, double, i32 }"> - %15 = llvm.insertvalue %5, %14[0] : !llvm<"{ i32, double, i32 }"> - %16 = llvm.insertvalue %7, %15[1] : !llvm<"{ i32, double, i32 }"> - %17 = llvm.insertvalue %11, %16[2] : !llvm<"{ i32, double, i32 }"> - llvm.return %17 : !llvm<"{ i32, double, i32 }"> + %10 = llvm.call @foo(%9) : (!llvm.i32) -> !llvm.struct<(i32, double, i32)> + %11 = llvm.extractvalue %10[0] : !llvm.struct<(i32, double, i32)> + %12 = llvm.extractvalue %10[1] : !llvm.struct<(i32, double, i32)> + %13 = llvm.extractvalue %10[2] : !llvm.struct<(i32, double, i32)> + %14 = llvm.mlir.undef : !llvm.struct<(i32, double, i32)> + %15 = llvm.insertvalue %5, %14[0] : !llvm.struct<(i32, double, i32)> + %16 = llvm.insertvalue %7, %15[1] : !llvm.struct<(i32, double, i32)> + %17 = llvm.insertvalue %11, %16[2] : !llvm.struct<(i32, double, i32)> + llvm.return %17 : !llvm.struct<(i32, double, i32)> // CHECK:^[[BB2]](%[[V18:.*]]: !llvm.i32): -// CHECK: %[[V19:.*]] = llvm.mlir.undef : !llvm<"{ i32, double, i32 }"> -// CHECK: %[[V20:.*]] = llvm.insertvalue %[[V18]], %[[V19]][0] : !llvm<"{ i32, double, i32 }"> -// CHECK: %[[V21:.*]] = llvm.insertvalue %[[V7]], %[[V20]][1] : !llvm<"{ i32, double, i32 }"> -// CHECK: %[[V22:.*]] = llvm.insertvalue %[[V5]], %[[V21]][2] : !llvm<"{ i32, double, i32 }"> -// CHECK: llvm.return %[[V22]] : !llvm<"{ i32, double, i32 }"> +// CHECK: %[[V19:.*]] = llvm.mlir.undef : !llvm.struct<(i32, double, i32)> +// CHECK: %[[V20:.*]] = llvm.insertvalue %[[V18]], %[[V19]][0] : !llvm.struct<(i32, double, i32)> +// CHECK: %[[V21:.*]] = llvm.insertvalue %[[V7]], %[[V20]][1] : !llvm.struct<(i32, double, i32)> +// CHECK: %[[V22:.*]] = llvm.insertvalue %[[V5]], %[[V21]][2] : !llvm.struct<(i32, double, i32)> +// CHECK: llvm.return %[[V22]] : !llvm.struct<(i32, double, i32)> ^bb2(%18: !llvm.i32): - %19 = llvm.mlir.undef : !llvm<"{ i32, double, i32 }"> - %20 = llvm.insertvalue %18, %19[0] : !llvm<"{ i32, double, i32 }"> - %21 = llvm.insertvalue %7, %20[1] : !llvm<"{ i32, double, i32 }"> - %22 = llvm.insertvalue %5, %21[2] : !llvm<"{ i32, double, i32 }"> - llvm.return %22 : !llvm<"{ i32, double, i32 }"> + %19 = llvm.mlir.undef : !llvm.struct<(i32, double, i32)> + %20 = llvm.insertvalue %18, %19[0] : !llvm.struct<(i32, double, i32)> + %21 = llvm.insertvalue %7, %20[1] : !llvm.struct<(i32, double, i32)> + %22 = llvm.insertvalue %5, %21[2] : !llvm.struct<(i32, double, i32)> + llvm.return %22 : !llvm.struct<(i32, double, i32)> } // CHECK-LABEL: @casts -// CHECK-SAME: (%[[I32:.*]]: !llvm.i32, %[[I64:.*]]: !llvm.i64, %[[V4I32:.*]]: !llvm<"<4 x i32>">, %[[V4I64:.*]]: !llvm<"<4 x i64>">, %[[I32PTR:.*]]: !llvm<"i32*">) -func @casts(%arg0: !llvm.i32, %arg1: !llvm.i64, %arg2: !llvm<"<4 x i32>">, - %arg3: !llvm<"<4 x i64>">, %arg4: !llvm<"i32*">) { +// CHECK-SAME: (%[[I32:.*]]: !llvm.i32, %[[I64:.*]]: !llvm.i64, %[[V4I32:.*]]: !llvm.vec<4 x i32>, %[[V4I64:.*]]: !llvm.vec<4 x i64>, %[[I32PTR:.*]]: !llvm.ptr) +func @casts(%arg0: !llvm.i32, %arg1: !llvm.i64, %arg2: !llvm.vec<4 x i32>, + %arg3: !llvm.vec<4 x i64>, %arg4: !llvm.ptr) { // CHECK: = llvm.sext %[[I32]] : !llvm.i32 to !llvm.i56 %0 = llvm.sext %arg0 : !llvm.i32 to !llvm.i56 // CHECK: = llvm.zext %[[I32]] : !llvm.i32 to !llvm.i64 %1 = llvm.zext %arg0 : !llvm.i32 to !llvm.i64 // CHECK: = llvm.trunc %[[I64]] : !llvm.i64 to !llvm.i56 %2 = llvm.trunc %arg1 : !llvm.i64 to !llvm.i56 -// CHECK: = llvm.sext %[[V4I32]] : !llvm<"<4 x i32>"> to !llvm<"<4 x i56>"> - %3 = llvm.sext %arg2 : !llvm<"<4 x i32>"> to !llvm<"<4 x i56>"> -// CHECK: = llvm.zext %[[V4I32]] : !llvm<"<4 x i32>"> to !llvm<"<4 x i64>"> - %4 = llvm.zext %arg2 : !llvm<"<4 x i32>"> to !llvm<"<4 x i64>"> -// CHECK: = llvm.trunc %[[V4I64]] : !llvm<"<4 x i64>"> to !llvm<"<4 x i56>"> - %5 = llvm.trunc %arg3 : !llvm<"<4 x i64>"> to !llvm<"<4 x i56>"> +// CHECK: = llvm.sext %[[V4I32]] : !llvm.vec<4 x i32> to !llvm.vec<4 x i56> + %3 = llvm.sext %arg2 : !llvm.vec<4 x i32> to !llvm.vec<4 x i56> +// CHECK: = llvm.zext %[[V4I32]] : !llvm.vec<4 x i32> to !llvm.vec<4 x i64> + %4 = llvm.zext %arg2 : !llvm.vec<4 x i32> to !llvm.vec<4 x i64> +// CHECK: = llvm.trunc %[[V4I64]] : !llvm.vec<4 x i64> to !llvm.vec<4 x i56> + %5 = llvm.trunc %arg3 : !llvm.vec<4 x i64> to !llvm.vec<4 x i56> // CHECK: = llvm.sitofp %[[I32]] : !llvm.i32 to !llvm.float %6 = llvm.sitofp %arg0 : !llvm.i32 to !llvm.float // CHECK: %[[FLOAT:.*]] = llvm.uitofp %[[I32]] : !llvm.i32 to !llvm.float @@ -212,89 +212,89 @@ %8 = llvm.fptosi %7 : !llvm.float to !llvm.i32 // CHECK: = llvm.fptoui %[[FLOAT]] : !llvm.float to !llvm.i32 %9 = llvm.fptoui %7 : !llvm.float to !llvm.i32 -// CHECK: = llvm.addrspacecast %[[I32PTR]] : !llvm<"i32*"> to !llvm<"i32 addrspace(2)*"> - %10 = llvm.addrspacecast %arg4 : !llvm<"i32*"> to !llvm<"i32 addrspace(2)*"> +// CHECK: = llvm.addrspacecast %[[I32PTR]] : !llvm.ptr to !llvm.ptr + %10 = llvm.addrspacecast %arg4 : !llvm.ptr to !llvm.ptr llvm.return } // CHECK-LABEL: @vect -func @vect(%arg0: !llvm<"<4 x float>">, %arg1: !llvm.i32, %arg2: !llvm.float) { -// CHECK: = llvm.extractelement {{.*}} : !llvm<"<4 x float>"> - %0 = llvm.extractelement %arg0[%arg1 : !llvm.i32] : !llvm<"<4 x float>"> -// CHECK: = llvm.insertelement {{.*}} : !llvm<"<4 x float>"> - %1 = llvm.insertelement %arg2, %arg0[%arg1 : !llvm.i32] : !llvm<"<4 x float>"> -// CHECK: = llvm.shufflevector {{.*}} [0 : i32, 0 : i32, 0 : i32, 0 : i32, 7 : i32] : !llvm<"<4 x float>">, !llvm<"<4 x float>"> - %2 = llvm.shufflevector %arg0, %arg0 [0 : i32, 0 : i32, 0 : i32, 0 : i32, 7 : i32] : !llvm<"<4 x float>">, !llvm<"<4 x float>"> -// CHECK: = llvm.mlir.constant(dense<1.000000e+00> : vector<4xf32>) : !llvm<"<4 x float>"> - %3 = llvm.mlir.constant(dense<1.0> : vector<4xf32>) : !llvm<"<4 x float>"> +func @vect(%arg0: !llvm.vec<4 x float>, %arg1: !llvm.i32, %arg2: !llvm.float) { +// CHECK: = llvm.extractelement {{.*}} : !llvm.vec<4 x float> + %0 = llvm.extractelement %arg0[%arg1 : !llvm.i32] : !llvm.vec<4 x float> +// CHECK: = llvm.insertelement {{.*}} : !llvm.vec<4 x float> + %1 = llvm.insertelement %arg2, %arg0[%arg1 : !llvm.i32] : !llvm.vec<4 x float> +// CHECK: = llvm.shufflevector {{.*}} [0 : i32, 0 : i32, 0 : i32, 0 : i32, 7 : i32] : !llvm.vec<4 x float>, !llvm.vec<4 x float> + %2 = llvm.shufflevector %arg0, %arg0 [0 : i32, 0 : i32, 0 : i32, 0 : i32, 7 : i32] : !llvm.vec<4 x float>, !llvm.vec<4 x float> +// CHECK: = llvm.mlir.constant(dense<1.000000e+00> : vector<4xf32>) : !llvm.vec<4 x float> + %3 = llvm.mlir.constant(dense<1.0> : vector<4xf32>) : !llvm.vec<4 x float> return } // CHECK-LABEL: @alloca func @alloca(%size : !llvm.i64) { - // CHECK: llvm.alloca %{{.*}} x !llvm.i32 : (!llvm.i64) -> !llvm<"i32*"> - llvm.alloca %size x !llvm.i32 {alignment = 0} : (!llvm.i64) -> (!llvm<"i32*">) - // CHECK: llvm.alloca %{{.*}} x !llvm.i32 {alignment = 8 : i64} : (!llvm.i64) -> !llvm<"i32*"> - llvm.alloca %size x !llvm.i32 {alignment = 8} : (!llvm.i64) -> (!llvm<"i32*">) + // CHECK: llvm.alloca %{{.*}} x !llvm.i32 : (!llvm.i64) -> !llvm.ptr + llvm.alloca %size x !llvm.i32 {alignment = 0} : (!llvm.i64) -> (!llvm.ptr) + // CHECK: llvm.alloca %{{.*}} x !llvm.i32 {alignment = 8 : i64} : (!llvm.i64) -> !llvm.ptr + llvm.alloca %size x !llvm.i32 {alignment = 8} : (!llvm.i64) -> (!llvm.ptr) llvm.return } // CHECK-LABEL: @null func @null() { - // CHECK: llvm.mlir.null : !llvm<"i8*"> - %0 = llvm.mlir.null : !llvm<"i8*"> - // CHECK: llvm.mlir.null : !llvm<"{ void (i32, void ()*)*, i64 }*"> - %1 = llvm.mlir.null : !llvm<"{void(i32, void()*)*, i64}*"> + // CHECK: llvm.mlir.null : !llvm.ptr + %0 = llvm.mlir.null : !llvm.ptr + // CHECK: llvm.mlir.null : !llvm.ptr>)>>, i64)>> + %1 = llvm.mlir.null : !llvm.ptr>)>>, i64)>> llvm.return } // CHECK-LABEL: @atomicrmw -func @atomicrmw(%ptr : !llvm<"float*">, %val : !llvm.float) { +func @atomicrmw(%ptr : !llvm.ptr, %val : !llvm.float) { // CHECK: llvm.atomicrmw fadd %{{.*}}, %{{.*}} unordered : !llvm.float %0 = llvm.atomicrmw fadd %ptr, %val unordered : !llvm.float llvm.return } // CHECK-LABEL: @cmpxchg -func @cmpxchg(%ptr : !llvm<"float*">, %cmp : !llvm.float, %new : !llvm.float) { +func @cmpxchg(%ptr : !llvm.ptr, %cmp : !llvm.float, %new : !llvm.float) { // CHECK: llvm.cmpxchg %{{.*}}, %{{.*}}, %{{.*}} acq_rel monotonic : !llvm.float %0 = llvm.cmpxchg %ptr, %cmp, %new acq_rel monotonic : !llvm.float llvm.return } -llvm.mlir.global external constant @_ZTIi() : !llvm<"i8*"> -llvm.func @bar(!llvm<"i8*">, !llvm<"i8*">, !llvm<"i8*">) +llvm.mlir.global external constant @_ZTIi() : !llvm.ptr +llvm.func @bar(!llvm.ptr, !llvm.ptr, !llvm.ptr) llvm.func @__gxx_personality_v0(...) -> !llvm.i32 // CHECK-LABEL: @invokeLandingpad llvm.func @invokeLandingpad() -> !llvm.i32 attributes { personality = @__gxx_personality_v0 } { // CHECK: %[[a0:.*]] = llvm.mlir.constant(0 : i32) : !llvm.i32 // CHECK: %{{.*}} = llvm.mlir.constant(3 : i32) : !llvm.i32 -// CHECK: %[[a2:.*]] = llvm.mlir.constant("\01") : !llvm<"[1 x i8]"> -// CHECK: %[[a3:.*]] = llvm.mlir.null : !llvm<"i8**"> -// CHECK: %[[a4:.*]] = llvm.mlir.null : !llvm<"i8*"> -// CHECK: %[[a5:.*]] = llvm.mlir.addressof @_ZTIi : !llvm<"i8**"> -// CHECK: %[[a6:.*]] = llvm.bitcast %[[a5]] : !llvm<"i8**"> to !llvm<"i8*"> +// CHECK: %[[a2:.*]] = llvm.mlir.constant("\01") : !llvm.array<1 x i8> +// CHECK: %[[a3:.*]] = llvm.mlir.null : !llvm.ptr> +// CHECK: %[[a4:.*]] = llvm.mlir.null : !llvm.ptr +// CHECK: %[[a5:.*]] = llvm.mlir.addressof @_ZTIi : !llvm.ptr> +// CHECK: %[[a6:.*]] = llvm.bitcast %[[a5]] : !llvm.ptr> to !llvm.ptr // CHECK: %[[a7:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32 -// CHECK: %[[a8:.*]] = llvm.alloca %[[a7]] x !llvm.i8 : (!llvm.i32) -> !llvm<"i8*"> -// CHECK: %{{.*}} = llvm.invoke @foo(%[[a7]]) to ^[[BB2:.*]] unwind ^[[BB1:.*]] : (!llvm.i32) -> !llvm<"{ i32, double, i32 }"> +// CHECK: %[[a8:.*]] = llvm.alloca %[[a7]] x !llvm.i8 : (!llvm.i32) -> !llvm.ptr +// CHECK: %{{.*}} = llvm.invoke @foo(%[[a7]]) to ^[[BB2:.*]] unwind ^[[BB1:.*]] : (!llvm.i32) -> !llvm.struct<(i32, double, i32)> %0 = llvm.mlir.constant(0 : i32) : !llvm.i32 %1 = llvm.mlir.constant(3 : i32) : !llvm.i32 - %2 = llvm.mlir.constant("\01") : !llvm<"[1 x i8]"> - %3 = llvm.mlir.null : !llvm<"i8**"> - %4 = llvm.mlir.null : !llvm<"i8*"> - %5 = llvm.mlir.addressof @_ZTIi : !llvm<"i8**"> - %6 = llvm.bitcast %5 : !llvm<"i8**"> to !llvm<"i8*"> + %2 = llvm.mlir.constant("\01") : !llvm.array<1 x i8> + %3 = llvm.mlir.null : !llvm.ptr> + %4 = llvm.mlir.null : !llvm.ptr + %5 = llvm.mlir.addressof @_ZTIi : !llvm.ptr> + %6 = llvm.bitcast %5 : !llvm.ptr> to !llvm.ptr %7 = llvm.mlir.constant(1 : i32) : !llvm.i32 - %8 = llvm.alloca %7 x !llvm.i8 : (!llvm.i32) -> !llvm<"i8*"> - %9 = llvm.invoke @foo(%7) to ^bb2 unwind ^bb1 : (!llvm.i32) -> !llvm<"{ i32, double, i32 }"> + %8 = llvm.alloca %7 x !llvm.i8 : (!llvm.i32) -> !llvm.ptr + %9 = llvm.invoke @foo(%7) to ^bb2 unwind ^bb1 : (!llvm.i32) -> !llvm.struct<(i32, double, i32)> // CHECK: ^[[BB1]]: -// CHECK: %[[lp:.*]] = llvm.landingpad cleanup (catch %[[a3]] : !llvm<"i8**">) (catch %[[a6]] : !llvm<"i8*">) (filter %[[a2]] : !llvm<"[1 x i8]">) : !llvm<"{ i8*, i32 }"> -// CHECK: llvm.resume %[[lp]] : !llvm<"{ i8*, i32 }"> +// CHECK: %[[lp:.*]] = llvm.landingpad cleanup (catch %[[a3]] : !llvm.ptr>) (catch %[[a6]] : !llvm.ptr) (filter %[[a2]] : !llvm.array<1 x i8>) : !llvm.struct<(ptr, i32)> +// CHECK: llvm.resume %[[lp]] : !llvm.struct<(ptr, i32)> ^bb1: - %10 = llvm.landingpad cleanup (catch %3 : !llvm<"i8**">) (catch %6 : !llvm<"i8*">) (filter %2 : !llvm<"[1 x i8]">) : !llvm<"{ i8*, i32 }"> - llvm.resume %10 : !llvm<"{ i8*, i32 }"> + %10 = llvm.landingpad cleanup (catch %3 : !llvm.ptr>) (catch %6 : !llvm.ptr) (filter %2 : !llvm.array<1 x i8>) : !llvm.struct<(ptr, i32)> + llvm.resume %10 : !llvm.struct<(ptr, i32)> // CHECK: ^[[BB2]]: // CHECK: llvm.return %[[a7]] : !llvm.i32 @@ -302,9 +302,9 @@ llvm.return %7 : !llvm.i32 // CHECK: ^[[BB3:.*]]: -// CHECK: llvm.invoke @bar(%[[a8]], %[[a6]], %[[a4]]) to ^[[BB2]] unwind ^[[BB1]] : (!llvm<"i8*">, !llvm<"i8*">, !llvm<"i8*">) -> () +// CHECK: llvm.invoke @bar(%[[a8]], %[[a6]], %[[a4]]) to ^[[BB2]] unwind ^[[BB1]] : (!llvm.ptr, !llvm.ptr, !llvm.ptr) -> () ^bb3: - llvm.invoke @bar(%8, %6, %4) to ^bb2 unwind ^bb1 : (!llvm<"i8*">, !llvm<"i8*">, !llvm<"i8*">) -> () + llvm.invoke @bar(%8, %6, %4) to ^bb2 unwind ^bb1 : (!llvm.ptr, !llvm.ptr, !llvm.ptr) -> () // CHECK: ^[[BB4:.*]]: // CHECK: llvm.return %[[a0]] : !llvm.i32 diff --git a/mlir/test/Dialect/LLVMIR/types.mlir b/mlir/test/Dialect/LLVMIR/types.mlir --- a/mlir/test/Dialect/LLVMIR/types.mlir +++ b/mlir/test/Dialect/LLVMIR/types.mlir @@ -2,183 +2,183 @@ // CHECK-LABEL: @primitive func @primitive() { - // CHECK: !llvm2.void - "some.op"() : () -> !llvm2.void - // CHECK: !llvm2.half - "some.op"() : () -> !llvm2.half - // CHECK: !llvm2.bfloat - "some.op"() : () -> !llvm2.bfloat - // CHECK: !llvm2.float - "some.op"() : () -> !llvm2.float - // CHECK: !llvm2.double - "some.op"() : () -> !llvm2.double - // CHECK: !llvm2.fp128 - "some.op"() : () -> !llvm2.fp128 - // CHECK: !llvm2.x86_fp80 - "some.op"() : () -> !llvm2.x86_fp80 - // CHECK: !llvm2.ppc_fp128 - "some.op"() : () -> !llvm2.ppc_fp128 - // CHECK: !llvm2.x86_mmx - "some.op"() : () -> !llvm2.x86_mmx - // CHECK: !llvm2.token - "some.op"() : () -> !llvm2.token - // CHECK: !llvm2.label - "some.op"() : () -> !llvm2.label - // CHECK: !llvm2.metadata - "some.op"() : () -> !llvm2.metadata + // CHECK: !llvm.void + "some.op"() : () -> !llvm.void + // CHECK: !llvm.half + "some.op"() : () -> !llvm.half + // CHECK: !llvm.bfloat + "some.op"() : () -> !llvm.bfloat + // CHECK: !llvm.float + "some.op"() : () -> !llvm.float + // CHECK: !llvm.double + "some.op"() : () -> !llvm.double + // CHECK: !llvm.fp128 + "some.op"() : () -> !llvm.fp128 + // CHECK: !llvm.x86_fp80 + "some.op"() : () -> !llvm.x86_fp80 + // CHECK: !llvm.ppc_fp128 + "some.op"() : () -> !llvm.ppc_fp128 + // CHECK: !llvm.x86_mmx + "some.op"() : () -> !llvm.x86_mmx + // CHECK: !llvm.token + "some.op"() : () -> !llvm.token + // CHECK: !llvm.label + "some.op"() : () -> !llvm.label + // CHECK: !llvm.metadata + "some.op"() : () -> !llvm.metadata return } // CHECK-LABEL: @func func @func() { - // CHECK: !llvm2.func - "some.op"() : () -> !llvm2.func - // CHECK: !llvm2.func - "some.op"() : () -> !llvm2.func - // CHECK: !llvm2.func - "some.op"() : () -> !llvm2.func - // CHECK: !llvm2.func - "some.op"() : () -> !llvm2.func - // CHECK: !llvm2.func - "some.op"() : () -> !llvm2.func - // CHECK: !llvm2.func - "some.op"() : () -> !llvm2.func - // CHECK: !llvm2.func - "some.op"() : () -> !llvm2.func + // CHECK: !llvm.func + "some.op"() : () -> !llvm.func + // CHECK: !llvm.func + "some.op"() : () -> !llvm.func + // CHECK: !llvm.func + "some.op"() : () -> !llvm.func + // CHECK: !llvm.func + "some.op"() : () -> !llvm.func + // CHECK: !llvm.func + "some.op"() : () -> !llvm.func + // CHECK: !llvm.func + "some.op"() : () -> !llvm.func + // CHECK: !llvm.func + "some.op"() : () -> !llvm.func return } // CHECK-LABEL: @integer func @integer() { - // CHECK: !llvm2.i1 - "some.op"() : () -> !llvm2.i1 - // CHECK: !llvm2.i8 - "some.op"() : () -> !llvm2.i8 - // CHECK: !llvm2.i16 - "some.op"() : () -> !llvm2.i16 - // CHECK: !llvm2.i32 - "some.op"() : () -> !llvm2.i32 - // CHECK: !llvm2.i64 - "some.op"() : () -> !llvm2.i64 - // CHECK: !llvm2.i57 - "some.op"() : () -> !llvm2.i57 - // CHECK: !llvm2.i129 - "some.op"() : () -> !llvm2.i129 + // CHECK: !llvm.i1 + "some.op"() : () -> !llvm.i1 + // CHECK: !llvm.i8 + "some.op"() : () -> !llvm.i8 + // CHECK: !llvm.i16 + "some.op"() : () -> !llvm.i16 + // CHECK: !llvm.i32 + "some.op"() : () -> !llvm.i32 + // CHECK: !llvm.i64 + "some.op"() : () -> !llvm.i64 + // CHECK: !llvm.i57 + "some.op"() : () -> !llvm.i57 + // CHECK: !llvm.i129 + "some.op"() : () -> !llvm.i129 return } // CHECK-LABEL: @ptr func @ptr() { - // CHECK: !llvm2.ptr - "some.op"() : () -> !llvm2.ptr - // CHECK: !llvm2.ptr - "some.op"() : () -> !llvm2.ptr - // CHECK: !llvm2.ptr> - "some.op"() : () -> !llvm2.ptr> - // CHECK: !llvm2.ptr>>>> - "some.op"() : () -> !llvm2.ptr>>>> - // CHECK: !llvm2.ptr - "some.op"() : () -> !llvm2.ptr - // CHECK: !llvm2.ptr - "some.op"() : () -> !llvm2.ptr - // CHECK: !llvm2.ptr - "some.op"() : () -> !llvm2.ptr - // CHECK: !llvm2.ptr, 9> - "some.op"() : () -> !llvm2.ptr, 9> + // CHECK: !llvm.ptr + "some.op"() : () -> !llvm.ptr + // CHECK: !llvm.ptr + "some.op"() : () -> !llvm.ptr + // CHECK: !llvm.ptr> + "some.op"() : () -> !llvm.ptr> + // CHECK: !llvm.ptr>>>> + "some.op"() : () -> !llvm.ptr>>>> + // CHECK: !llvm.ptr + "some.op"() : () -> !llvm.ptr + // CHECK: !llvm.ptr + "some.op"() : () -> !llvm.ptr + // CHECK: !llvm.ptr + "some.op"() : () -> !llvm.ptr + // CHECK: !llvm.ptr, 9> + "some.op"() : () -> !llvm.ptr, 9> return } // CHECK-LABEL: @vec func @vec() { - // CHECK: !llvm2.vec<4 x i32> - "some.op"() : () -> !llvm2.vec<4 x i32> - // CHECK: !llvm2.vec<4 x float> - "some.op"() : () -> !llvm2.vec<4 x float> - // CHECK: !llvm2.vec - "some.op"() : () -> !llvm2.vec - // CHECK: !llvm2.vec - "some.op"() : () -> !llvm2.vec - // CHECK: !llvm2.vec<4 x ptr> - "some.op"() : () -> !llvm2.vec<4 x ptr> + // CHECK: !llvm.vec<4 x i32> + "some.op"() : () -> !llvm.vec<4 x i32> + // CHECK: !llvm.vec<4 x float> + "some.op"() : () -> !llvm.vec<4 x float> + // CHECK: !llvm.vec + "some.op"() : () -> !llvm.vec + // CHECK: !llvm.vec + "some.op"() : () -> !llvm.vec + // CHECK: !llvm.vec<4 x ptr> + "some.op"() : () -> !llvm.vec<4 x ptr> return } // CHECK-LABEL: @array func @array() { - // CHECK: !llvm2.array<10 x i32> - "some.op"() : () -> !llvm2.array<10 x i32> - // CHECK: !llvm2.array<8 x float> - "some.op"() : () -> !llvm2.array<8 x float> - // CHECK: !llvm2.array<10 x ptr> - "some.op"() : () -> !llvm2.array<10 x ptr> - // CHECK: !llvm2.array<10 x array<4 x float>> - "some.op"() : () -> !llvm2.array<10 x array<4 x float>> + // CHECK: !llvm.array<10 x i32> + "some.op"() : () -> !llvm.array<10 x i32> + // CHECK: !llvm.array<8 x float> + "some.op"() : () -> !llvm.array<8 x float> + // CHECK: !llvm.array<10 x ptr> + "some.op"() : () -> !llvm.array<10 x ptr> + // CHECK: !llvm.array<10 x array<4 x float>> + "some.op"() : () -> !llvm.array<10 x array<4 x float>> return } // CHECK-LABEL: @literal_struct func @literal_struct() { - // CHECK: !llvm2.struct<()> - "some.op"() : () -> !llvm2.struct<()> - // CHECK: !llvm2.struct<(i32)> - "some.op"() : () -> !llvm2.struct<(i32)> - // CHECK: !llvm2.struct<(float, i32)> - "some.op"() : () -> !llvm2.struct<(float, i32)> - // CHECK: !llvm2.struct<(struct<(i32)>)> - "some.op"() : () -> !llvm2.struct<(struct<(i32)>)> - // CHECK: !llvm2.struct<(i32, struct<(i32)>, float)> - "some.op"() : () -> !llvm2.struct<(i32, struct<(i32)>, float)> + // CHECK: !llvm.struct<()> + "some.op"() : () -> !llvm.struct<()> + // CHECK: !llvm.struct<(i32)> + "some.op"() : () -> !llvm.struct<(i32)> + // CHECK: !llvm.struct<(float, i32)> + "some.op"() : () -> !llvm.struct<(float, i32)> + // CHECK: !llvm.struct<(struct<(i32)>)> + "some.op"() : () -> !llvm.struct<(struct<(i32)>)> + // CHECK: !llvm.struct<(i32, struct<(i32)>, float)> + "some.op"() : () -> !llvm.struct<(i32, struct<(i32)>, float)> - // CHECK: !llvm2.struct - "some.op"() : () -> !llvm2.struct - // CHECK: !llvm2.struct - "some.op"() : () -> !llvm2.struct - // CHECK: !llvm2.struct - "some.op"() : () -> !llvm2.struct - // CHECK: !llvm2.struct - "some.op"() : () -> !llvm2.struct - // CHECK: !llvm2.struct)> - "some.op"() : () -> !llvm2.struct)> - // CHECK: !llvm2.struct, float)> - "some.op"() : () -> !llvm2.struct, float)> + // CHECK: !llvm.struct + "some.op"() : () -> !llvm.struct + // CHECK: !llvm.struct + "some.op"() : () -> !llvm.struct + // CHECK: !llvm.struct + "some.op"() : () -> !llvm.struct + // CHECK: !llvm.struct + "some.op"() : () -> !llvm.struct + // CHECK: !llvm.struct)> + "some.op"() : () -> !llvm.struct)> + // CHECK: !llvm.struct, float)> + "some.op"() : () -> !llvm.struct, float)> - // CHECK: !llvm2.struct<(struct)> - "some.op"() : () -> !llvm2.struct<(struct)> - // CHECK: !llvm2.struct)> - "some.op"() : () -> !llvm2.struct)> + // CHECK: !llvm.struct<(struct)> + "some.op"() : () -> !llvm.struct<(struct)> + // CHECK: !llvm.struct)> + "some.op"() : () -> !llvm.struct)> return } // CHECK-LABEL: @identified_struct func @identified_struct() { - // CHECK: !llvm2.struct<"empty", ()> - "some.op"() : () -> !llvm2.struct<"empty", ()> - // CHECK: !llvm2.struct<"opaque", opaque> - "some.op"() : () -> !llvm2.struct<"opaque", opaque> - // CHECK: !llvm2.struct<"long", (i32, struct<(i32, i1)>, float, ptr>)> - "some.op"() : () -> !llvm2.struct<"long", (i32, struct<(i32, i1)>, float, ptr>)> - // CHECK: !llvm2.struct<"self-recursive", (ptr>)> - "some.op"() : () -> !llvm2.struct<"self-recursive", (ptr>)> - // CHECK: !llvm2.struct<"unpacked", (i32)> - "some.op"() : () -> !llvm2.struct<"unpacked", (i32)> - // CHECK: !llvm2.struct<"packed", packed (i32)> - "some.op"() : () -> !llvm2.struct<"packed", packed (i32)> - // CHECK: !llvm2.struct<"name with spaces and !^$@$#", packed (i32)> - "some.op"() : () -> !llvm2.struct<"name with spaces and !^$@$#", packed (i32)> + // CHECK: !llvm.struct<"empty", ()> + "some.op"() : () -> !llvm.struct<"empty", ()> + // CHECK: !llvm.struct<"opaque", opaque> + "some.op"() : () -> !llvm.struct<"opaque", opaque> + // CHECK: !llvm.struct<"long", (i32, struct<(i32, i1)>, float, ptr>)> + "some.op"() : () -> !llvm.struct<"long", (i32, struct<(i32, i1)>, float, ptr>)> + // CHECK: !llvm.struct<"self-recursive", (ptr>)> + "some.op"() : () -> !llvm.struct<"self-recursive", (ptr>)> + // CHECK: !llvm.struct<"unpacked", (i32)> + "some.op"() : () -> !llvm.struct<"unpacked", (i32)> + // CHECK: !llvm.struct<"packed", packed (i32)> + "some.op"() : () -> !llvm.struct<"packed", packed (i32)> + // CHECK: !llvm.struct<"name with spaces and !^$@$#", packed (i32)> + "some.op"() : () -> !llvm.struct<"name with spaces and !^$@$#", packed (i32)> - // CHECK: !llvm2.struct<"mutually-a", (ptr, 3>)>>)> - "some.op"() : () -> !llvm2.struct<"mutually-a", (ptr, 3>)>>)> - // CHECK: !llvm2.struct<"mutually-b", (ptr>)>, 3>)> - "some.op"() : () -> !llvm2.struct<"mutually-b", (ptr>)>, 3>)> - // CHECK: !llvm2.struct<"referring-another", (ptr>)> - "some.op"() : () -> !llvm2.struct<"referring-another", (ptr>)> + // CHECK: !llvm.struct<"mutually-a", (ptr, 3>)>>)> + "some.op"() : () -> !llvm.struct<"mutually-a", (ptr, 3>)>>)> + // CHECK: !llvm.struct<"mutually-b", (ptr>)>, 3>)> + "some.op"() : () -> !llvm.struct<"mutually-b", (ptr>)>, 3>)> + // CHECK: !llvm.struct<"referring-another", (ptr>)> + "some.op"() : () -> !llvm.struct<"referring-another", (ptr>)> - // CHECK: !llvm2.struct<"struct-of-arrays", (array<10 x i32>)> - "some.op"() : () -> !llvm2.struct<"struct-of-arrays", (array<10 x i32>)> - // CHECK: !llvm2.array<10 x struct<"array-of-structs", (i32)>> - "some.op"() : () -> !llvm2.array<10 x struct<"array-of-structs", (i32)>> - // CHECK: !llvm2.ptr> - "some.op"() : () -> !llvm2.ptr> + // CHECK: !llvm.struct<"struct-of-arrays", (array<10 x i32>)> + "some.op"() : () -> !llvm.struct<"struct-of-arrays", (array<10 x i32>)> + // CHECK: !llvm.array<10 x struct<"array-of-structs", (i32)>> + "some.op"() : () -> !llvm.array<10 x struct<"array-of-structs", (i32)>> + // CHECK: !llvm.ptr> + "some.op"() : () -> !llvm.ptr> return } diff --git a/mlir/test/Dialect/Linalg/llvm.mlir b/mlir/test/Dialect/Linalg/llvm.mlir --- a/mlir/test/Dialect/Linalg/llvm.mlir +++ b/mlir/test/Dialect/Linalg/llvm.mlir @@ -9,10 +9,10 @@ // CHECK-LABEL: func @range(%{{.*}}: !llvm.i64) { // CHECK: llvm.mlir.constant(0 : index) : !llvm.i64 // CHECK-NEXT: llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK-NEXT: llvm.mlir.undef : !llvm<"{ i64, i64, i64 }"> -// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ i64, i64, i64 }"> -// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"{ i64, i64, i64 }"> -// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm<"{ i64, i64, i64 }"> +// CHECK-NEXT: llvm.mlir.undef : !llvm.struct<(i64, i64, i64)> +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm.struct<(i64, i64, i64)> +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm.struct<(i64, i64, i64)> +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm.struct<(i64, i64, i64)> func @slice(%arg0: memref, %arg1: !linalg.range) { %1 = linalg.slice %arg0[%arg1] : memref, !linalg.range, memref @@ -20,20 +20,20 @@ } // CHECK-LABEL: func @slice // insert data ptr for slice op -// CHECK: llvm.extractvalue %{{.*}}[4, 0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> -// CHECK-NEXT: llvm.extractvalue %{{.*}}[2] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> -// CHECK-NEXT: llvm.extractvalue %{{.*}}[0] : !llvm<"{ i64, i64, i64 }"> +// CHECK: llvm.extractvalue %{{.*}}[4, 0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> +// CHECK-NEXT: llvm.extractvalue %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> +// CHECK-NEXT: llvm.extractvalue %{{.*}}[0] : !llvm.struct<(i64, i64, i64)> // CHECK-NEXT: llvm.mul %{{.*}}, %{{.*}} : !llvm.i64 // CHECK-NEXT: llvm.add %{{.*}}, %{{.*}} : !llvm.i64 // insert offset -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> // CHECK-NEXT: llvm.mlir.constant(0 : index) -// CHECK-NEXT: llvm.extractvalue %{{.*}}[0] : !llvm<"{ i64, i64, i64 }"> -// CHECK-NEXT: llvm.extractvalue %{{.*}}[1] : !llvm<"{ i64, i64, i64 }"> -// CHECK-NEXT: llvm.extractvalue %{{.*}}[2] : !llvm<"{ i64, i64, i64 }"> +// CHECK-NEXT: llvm.extractvalue %{{.*}}[0] : !llvm.struct<(i64, i64, i64)> +// CHECK-NEXT: llvm.extractvalue %{{.*}}[1] : !llvm.struct<(i64, i64, i64)> +// CHECK-NEXT: llvm.extractvalue %{{.*}}[2] : !llvm.struct<(i64, i64, i64)> // get size[0] from parent view -// CHECK-NEXT: llvm.extractvalue %{{.*}}[3, 0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> +// CHECK-NEXT: llvm.extractvalue %{{.*}}[3, 0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> // CHECK-NEXT: llvm.icmp "slt" %{{.*}}, %{{.*}} : !llvm.i64 // CHECK-NEXT: llvm.select %{{.*}}, %{{.*}}, %{{.*}} : !llvm.i1, !llvm.i64 // compute size[0] bounded by parent view's size[0] @@ -44,8 +44,8 @@ // compute stride[0] using bounded size // CHECK-NEXT: llvm.mul %{{.*}}, %{{.*}} : !llvm.i64 // insert size and stride -// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[3, 0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> -// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[4, 0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[3, 0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> +// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[4, 0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> func @slice_with_range_and_index(%arg0: memref) { %c0 = constant 0 : index @@ -58,32 +58,32 @@ } // CHECK-LABEL: func @slice_with_range_and_index // loop-body. -// CHECK: llvm.mlir.undef : !llvm<"{ double*, double*, i64, [1 x i64], [1 x i64] }"> -// CHECK: llvm.extractvalue %{{.*}}[4, 0] : !llvm<"{ double*, double*, i64, [2 x i64], [2 x i64] }"> -// CHECK: llvm.extractvalue %{{.*}}[4, 1] : !llvm<"{ double*, double*, i64, [2 x i64], [2 x i64] }"> -// CHECK: llvm.extractvalue %{{.*}}[2] : !llvm<"{ double*, double*, i64, [2 x i64], [2 x i64] }"> -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ double*, double*, i64, [1 x i64], [1 x i64] }"> -// CHECK: llvm.insertvalue %{{.*}}[2] : !llvm<"{ double*, double*, i64, [1 x i64], [1 x i64] }"> -// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm<"{ i64, i64, i64 }"> -// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm<"{ i64, i64, i64 }"> -// CHECK: llvm.insertvalue %{{.*}}[3, 0] : !llvm<"{ double*, double*, i64, [1 x i64], [1 x i64] }"> -// CHECK: llvm.insertvalue %{{.*}}[4, 0] : !llvm<"{ double*, double*, i64, [1 x i64], [1 x i64] }"> +// CHECK: llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> +// CHECK: llvm.extractvalue %{{.*}}[4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK: llvm.extractvalue %{{.*}}[4, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK: llvm.extractvalue %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> +// CHECK: llvm.insertvalue %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> +// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm.struct<(i64, i64, i64)> +// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm.struct<(i64, i64, i64)> +// CHECK: llvm.insertvalue %{{.*}}[3, 0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> +// CHECK: llvm.insertvalue %{{.*}}[4, 0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> func @transpose(%arg0: memref) { %0 = linalg.transpose %arg0 (i, j, k) -> (k, i, j) : memref return } // CHECK-LABEL: func @transpose -// CHECK: llvm.mlir.undef : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK: llvm.insertvalue {{.*}}[0] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK: llvm.insertvalue {{.*}}[1] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK: llvm.insertvalue {{.*}}[2] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK: llvm.extractvalue {{.*}}[3, 0] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK: llvm.insertvalue {{.*}}[3, 2] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK: llvm.extractvalue {{.*}}[3, 1] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK: llvm.insertvalue {{.*}}[3, 0] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK: llvm.extractvalue {{.*}}[3, 2] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK: llvm.insertvalue {{.*}}[3, 1] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> +// CHECK: llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK: llvm.insertvalue {{.*}}[0] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK: llvm.insertvalue {{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK: llvm.insertvalue {{.*}}[2] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK: llvm.extractvalue {{.*}}[3, 0] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK: llvm.insertvalue {{.*}}[3, 2] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK: llvm.extractvalue {{.*}}[3, 1] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK: llvm.insertvalue {{.*}}[3, 0] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK: llvm.extractvalue {{.*}}[3, 2] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK: llvm.insertvalue {{.*}}[3, 1] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> func @reshape_static_expand(%arg0: memref<3x4x5xf32>) -> memref<1x3x4x1x5xf32> { // Reshapes that expand a contiguous tensor with some 1's. @@ -94,33 +94,33 @@ return %0 : memref<1x3x4x1x5xf32> } // CHECK-LABEL: func @reshape_static_expand -// CHECK: llvm.mlir.undef : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> -// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> -// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> -// CHECK: llvm.extractvalue %{{.*}}[2] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> +// CHECK: llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> +// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> +// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> +// CHECK: llvm.extractvalue %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> // CHECK: llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 0] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 0] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> // CHECK: llvm.mlir.constant(3 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 1] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 1] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> // CHECK: llvm.mlir.constant(4 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 2] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 2] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> // CHECK: llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 3] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 3] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> // CHECK: llvm.mlir.constant(5 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 4] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 4] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> // CHECK: llvm.mlir.constant(60 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 0] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 0] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> // CHECK: llvm.mlir.constant(20 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> // CHECK: llvm.mlir.constant(5 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 2] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 2] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> // CHECK: llvm.mlir.constant(5 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 3] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 3] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> // CHECK: llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 4] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 4] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> func @reshape_static_collapse(%arg0: memref<1x3x4x1x5xf32>) -> memref<3x4x5xf32> { %0 = linalg.reshape %arg0 [affine_map<(i, j, k, l, m) -> (i, j)>, @@ -130,56 +130,56 @@ return %0 : memref<3x4x5xf32> } // CHECK-LABEL: func @reshape_static_collapse -// CHECK: llvm.mlir.undef : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> -// CHECK: llvm.extractvalue %{{.*}}[2] : !llvm<"{ float*, float*, i64, [5 x i64], [5 x i64] }"> -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> +// CHECK: llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> +// CHECK: llvm.extractvalue %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64, array<5 x i64>, array<5 x i64>)> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> // CHECK: llvm.mlir.constant(3 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 0] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 0] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> // CHECK: llvm.mlir.constant(4 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 1] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 1] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> // CHECK: llvm.mlir.constant(5 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 2] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 2] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> // CHECK: llvm.mlir.constant(20 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 0] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 0] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> // CHECK: llvm.mlir.constant(5 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> // CHECK: llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 2] : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 2] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)> func @reshape_fold_zero_dim(%arg0 : memref<1x1xf32>) -> memref { %0 = linalg.reshape %arg0 [] : memref<1x1xf32> into memref return %0 : memref } // CHECK-LABEL: func @reshape_fold_zero_dim -// CHECK: llvm.mlir.undef : !llvm<"{ float*, float*, i64 }"> -// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ float*, float*, i64 }"> -// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"{ float*, float*, i64 }"> -// CHECK: llvm.extractvalue %{{.*}}[2] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm<"{ float*, float*, i64 }"> +// CHECK: llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64)> +// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64)> +// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64)> +// CHECK: llvm.extractvalue %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64)> func @reshape_expand_zero_dim(%arg0 : memref) -> memref<1x1xf32> { %0 = linalg.reshape %arg0 [] : memref into memref<1x1xf32> return %0 : memref<1x1xf32> } // CHECK-LABEL: func @reshape_expand_zero_dim -// CHECK: llvm.mlir.undef : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm<"{ float*, float*, i64 }"> -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, float*, i64 }"> -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> -// CHECK: llvm.extractvalue %{{.*}}[2] : !llvm<"{ float*, float*, i64 }"> -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64)> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64)> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> +// CHECK: llvm.extractvalue %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64)> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[3, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 0] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: llvm.mlir.constant(1 : index) : !llvm.i64 -// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }"> +// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[4, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> diff --git a/mlir/test/Target/avx512.mlir b/mlir/test/Target/avx512.mlir --- a/mlir/test/Target/avx512.mlir +++ b/mlir/test/Target/avx512.mlir @@ -1,31 +1,31 @@ // RUN: mlir-opt -verify-diagnostics %s | mlir-opt | mlir-translate --avx512-mlir-to-llvmir | FileCheck %s // CHECK-LABEL: define <16 x float> @LLVM_x86_avx512_mask_ps_512 -llvm.func @LLVM_x86_avx512_mask_ps_512(%a: !llvm<"<16 x float>">, +llvm.func @LLVM_x86_avx512_mask_ps_512(%a: !llvm.vec<16 x float>, %b: !llvm.i32, %c: !llvm.i16) - -> (!llvm<"<16 x float>">) + -> (!llvm.vec<16 x float>) { // CHECK: call <16 x float> @llvm.x86.avx512.mask.rndscale.ps.512(<16 x float> %0 = "llvm_avx512.mask.rndscale.ps.512"(%a, %b, %a, %c, %b) : - (!llvm<"<16 x float>">, !llvm.i32, !llvm<"<16 x float>">, !llvm.i16, !llvm.i32) -> !llvm<"<16 x float>"> + (!llvm.vec<16 x float>, !llvm.i32, !llvm.vec<16 x float>, !llvm.i16, !llvm.i32) -> !llvm.vec<16 x float> // CHECK: call <16 x float> @llvm.x86.avx512.mask.scalef.ps.512(<16 x float> %1 = "llvm_avx512.mask.scalef.ps.512"(%a, %a, %a, %c, %b) : - (!llvm<"<16 x float>">, !llvm<"<16 x float>">, !llvm<"<16 x float>">, !llvm.i16, !llvm.i32) -> !llvm<"<16 x float>"> - llvm.return %1: !llvm<"<16 x float>"> + (!llvm.vec<16 x float>, !llvm.vec<16 x float>, !llvm.vec<16 x float>, !llvm.i16, !llvm.i32) -> !llvm.vec<16 x float> + llvm.return %1: !llvm.vec<16 x float> } // CHECK-LABEL: define <8 x double> @LLVM_x86_avx512_mask_pd_512 -llvm.func @LLVM_x86_avx512_mask_pd_512(%a: !llvm<"<8 x double>">, +llvm.func @LLVM_x86_avx512_mask_pd_512(%a: !llvm.vec<8 x double>, %b: !llvm.i32, %c: !llvm.i8) - -> (!llvm<"<8 x double>">) + -> (!llvm.vec<8 x double>) { // CHECK: call <8 x double> @llvm.x86.avx512.mask.rndscale.pd.512(<8 x double> %0 = "llvm_avx512.mask.rndscale.pd.512"(%a, %b, %a, %c, %b) : - (!llvm<"<8 x double>">, !llvm.i32, !llvm<"<8 x double>">, !llvm.i8, !llvm.i32) -> !llvm<"<8 x double>"> + (!llvm.vec<8 x double>, !llvm.i32, !llvm.vec<8 x double>, !llvm.i8, !llvm.i32) -> !llvm.vec<8 x double> // CHECK: call <8 x double> @llvm.x86.avx512.mask.scalef.pd.512(<8 x double> %1 = "llvm_avx512.mask.scalef.pd.512"(%a, %a, %a, %c, %b) : - (!llvm<"<8 x double>">, !llvm<"<8 x double>">, !llvm<"<8 x double>">, !llvm.i8, !llvm.i32) -> !llvm<"<8 x double>"> - llvm.return %1: !llvm<"<8 x double>"> + (!llvm.vec<8 x double>, !llvm.vec<8 x double>, !llvm.vec<8 x double>, !llvm.i8, !llvm.i32) -> !llvm.vec<8 x double> + llvm.return %1: !llvm.vec<8 x double> } diff --git a/mlir/test/Target/import.ll b/mlir/test/Target/import.ll --- a/mlir/test/Target/import.ll +++ b/mlir/test/Target/import.ll @@ -3,22 +3,22 @@ %struct.t = type {} %struct.s = type { %struct.t, i64 } -; CHECK: llvm.mlir.global external @g1() : !llvm<"{ {}, i64 }"> +; CHECK: llvm.mlir.global external @g1() : !llvm.struct<(struct<()>, i64)> @g1 = external global %struct.s, align 8 ; CHECK: llvm.mlir.global external @g2() : !llvm.double @g2 = external global double, align 8 ; CHECK: llvm.mlir.global internal @g3("string") @g3 = internal global [6 x i8] c"string" -; CHECK: llvm.mlir.global external @g5() : !llvm<"<8 x i32>"> +; CHECK: llvm.mlir.global external @g5() : !llvm.vec<8 x i32> @g5 = external global <8 x i32> @g4 = external global i32, align 8 -; CHECK: llvm.mlir.global internal constant @int_gep() : !llvm<"i32*"> { -; CHECK-DAG: %[[addr:[0-9]+]] = llvm.mlir.addressof @g4 : !llvm<"i32*"> +; CHECK: llvm.mlir.global internal constant @int_gep() : !llvm.ptr { +; CHECK-DAG: %[[addr:[0-9]+]] = llvm.mlir.addressof @g4 : !llvm.ptr ; CHECK-DAG: %[[c2:[0-9]+]] = llvm.mlir.constant(2 : i32) : !llvm.i32 -; CHECK-NEXT: %[[gepinit:[0-9]+]] = llvm.getelementptr %[[addr]][%[[c2]]] : (!llvm<"i32*">, !llvm.i32) -> !llvm<"i32*"> -; CHECK-NEXT: llvm.return %[[gepinit]] : !llvm<"i32*"> +; CHECK-NEXT: %[[gepinit:[0-9]+]] = llvm.getelementptr %[[addr]][%[[c2]]] : (!llvm.ptr, !llvm.i32) -> !llvm.ptr +; CHECK-NEXT: llvm.return %[[gepinit]] : !llvm.ptr ; CHECK-NEXT: } @int_gep = internal constant i32* getelementptr (i32, i32* @g4, i32 2) @@ -53,15 +53,15 @@ ; Sequential constants. ; -; CHECK: llvm.mlir.global internal constant @vector_constant(dense<[1, 2]> : vector<2xi32>) : !llvm<"<2 x i32>"> +; CHECK: llvm.mlir.global internal constant @vector_constant(dense<[1, 2]> : vector<2xi32>) : !llvm.vec<2 x i32> @vector_constant = internal constant <2 x i32> -; CHECK: llvm.mlir.global internal constant @array_constant(dense<[1.000000e+00, 2.000000e+00]> : tensor<2xf32>) : !llvm<"[2 x float]"> +; CHECK: llvm.mlir.global internal constant @array_constant(dense<[1.000000e+00, 2.000000e+00]> : tensor<2xf32>) : !llvm.array<2 x float> @array_constant = internal constant [2 x float] [float 1., float 2.] -; CHECK: llvm.mlir.global internal constant @nested_array_constant(dense<[{{\[}}1, 2], [3, 4]]> : tensor<2x2xi32>) : !llvm<"[2 x [2 x i32]]"> +; CHECK: llvm.mlir.global internal constant @nested_array_constant(dense<[{{\[}}1, 2], [3, 4]]> : tensor<2x2xi32>) : !llvm.array<2 x array<2 x i32>> @nested_array_constant = internal constant [2 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 3, i32 4]] -; CHECK: llvm.mlir.global internal constant @nested_array_constant3(dense<[{{\[}}[1, 2], [3, 4]]]> : tensor<1x2x2xi32>) : !llvm<"[1 x [2 x [2 x i32]]]"> +; CHECK: llvm.mlir.global internal constant @nested_array_constant3(dense<[{{\[}}[1, 2], [3, 4]]]> : tensor<1x2x2xi32>) : !llvm.array<1 x array<2 x array<2 x i32>>> @nested_array_constant3 = internal constant [1 x [2 x [2 x i32]]] [[2 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 3, i32 4]]] -; CHECK: llvm.mlir.global internal constant @nested_array_vector(dense<[{{\[}}[1, 2], [3, 4]]]> : vector<1x2x2xi32>) : !llvm<"[1 x [2 x <2 x i32>]]"> +; CHECK: llvm.mlir.global internal constant @nested_array_vector(dense<[{{\[}}[1, 2], [3, 4]]]> : vector<1x2x2xi32>) : !llvm.array<1 x array<2 x vec<2 x i32>>> @nested_array_vector = internal constant [1 x [2 x <2 x i32>]] [[2 x <2 x i32>] [<2 x i32> , <2 x i32> ]] ; @@ -84,13 +84,13 @@ ; CHECK-DAG: %[[c43:[0-9]+]] = llvm.mlir.constant(43 : i32) : !llvm.i32 define internal dso_local i32 @f1(i64 %a) norecurse { entry: -; CHECK: %{{[0-9]+}} = llvm.inttoptr %arg0 : !llvm.i64 to !llvm<"i64*"> +; CHECK: %{{[0-9]+}} = llvm.inttoptr %arg0 : !llvm.i64 to !llvm.ptr %aa = inttoptr i64 %a to i64* -; %[[addrof:[0-9]+]] = llvm.mlir.addressof @g2 : !llvm<"double*"> -; %[[addrof2:[0-9]+]] = llvm.mlir.addressof @g2 : !llvm<"double*"> -; %{{[0-9]+}} = llvm.inttoptr %arg0 : !llvm.i64 to !llvm<"i64*"> -; %{{[0-9]+}} = llvm.ptrtoint %[[addrof2]] : !llvm<"double*"> to !llvm.i64 -; %{{[0-9]+}} = llvm.getelementptr %[[addrof]][%3] : (!llvm<"double*">, !llvm.i32) -> !llvm<"double*"> +; %[[addrof:[0-9]+]] = llvm.mlir.addressof @g2 : !llvm.ptr +; %[[addrof2:[0-9]+]] = llvm.mlir.addressof @g2 : !llvm.ptr +; %{{[0-9]+}} = llvm.inttoptr %arg0 : !llvm.i64 to !llvm.ptr +; %{{[0-9]+}} = llvm.ptrtoint %[[addrof2]] : !llvm.ptr to !llvm.i64 +; %{{[0-9]+}} = llvm.getelementptr %[[addrof]][%3] : (!llvm.ptr, !llvm.i32) -> !llvm.ptr %bb = ptrtoint double* @g2 to i64 %cc = getelementptr double, double* @g2, i32 2 ; CHECK: %[[b:[0-9]+]] = llvm.trunc %arg0 : !llvm.i64 to !llvm.i32 @@ -161,18 +161,18 @@ br label %end } -; CHECK-LABEL: llvm.func @f3() -> !llvm<"i32*"> +; CHECK-LABEL: llvm.func @f3() -> !llvm.ptr define i32* @f3() { -; CHECK: %[[c:[0-9]+]] = llvm.mlir.addressof @g2 : !llvm<"double*"> -; CHECK: %[[b:[0-9]+]] = llvm.bitcast %[[c]] : !llvm<"double*"> to !llvm<"i32*"> -; CHECK: llvm.return %[[b]] : !llvm<"i32*"> +; CHECK: %[[c:[0-9]+]] = llvm.mlir.addressof @g2 : !llvm.ptr +; CHECK: %[[b:[0-9]+]] = llvm.bitcast %[[c]] : !llvm.ptr to !llvm.ptr +; CHECK: llvm.return %[[b]] : !llvm.ptr ret i32* bitcast (double* @g2 to i32*) } -; CHECK-LABEL: llvm.func @f4() -> !llvm<"i32*"> +; CHECK-LABEL: llvm.func @f4() -> !llvm.ptr define i32* @f4() { -; CHECK: %[[b:[0-9]+]] = llvm.mlir.null : !llvm<"i32*"> -; CHECK: llvm.return %[[b]] : !llvm<"i32*"> +; CHECK: %[[b:[0-9]+]] = llvm.mlir.null : !llvm.ptr +; CHECK: llvm.return %[[b]] : !llvm.ptr ret i32* bitcast (double* null to i32*) } @@ -198,7 +198,7 @@ ret void } -; CHECK-LABEL: llvm.func @f6(%arg0: !llvm<"void (i16)*">) +; CHECK-LABEL: llvm.func @f6(%arg0: !llvm.ptr>) define void @f6(void (i16) *%fn) { ; CHECK: %[[c:[0-9]+]] = llvm.mlir.constant(0 : i16) : !llvm.i16 ; CHECK: llvm.call %arg0(%[[c]]) @@ -243,7 +243,7 @@ ; CHECK-LABEL: @precaller define i32 @precaller() { %1 = alloca i32 ()* - ; CHECK: %[[func:.*]] = llvm.mlir.addressof @callee : !llvm<"i32 ()*"> + ; CHECK: %[[func:.*]] = llvm.mlir.addressof @callee : !llvm.ptr> ; CHECK: llvm.store %[[func]], %[[loc:.*]] store i32 ()* @callee, i32 ()** %1 ; CHECK: %[[indir:.*]] = llvm.load %[[loc]] @@ -261,7 +261,7 @@ ; CHECK-LABEL: @postcaller define i32 @postcaller() { %1 = alloca i32 ()* - ; CHECK: %[[func:.*]] = llvm.mlir.addressof @callee : !llvm<"i32 ()*"> + ; CHECK: %[[func:.*]] = llvm.mlir.addressof @callee : !llvm.ptr> ; CHECK: llvm.store %[[func]], %[[loc:.*]] store i32 ()* @callee, i32 ()** %1 ; CHECK: %[[indir:.*]] = llvm.load %[[loc]] @@ -279,16 +279,16 @@ ; CHECK-LABEL: @invokeLandingpad define i32 @invokeLandingpad() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { - ; CHECK: %[[a1:[0-9]+]] = llvm.bitcast %{{[0-9]+}} : !llvm<"i8***"> to !llvm<"i8*"> - ; CHECK: %[[a3:[0-9]+]] = llvm.alloca %{{[0-9]+}} x !llvm.i8 : (!llvm.i32) -> !llvm<"i8*"> + ; CHECK: %[[a1:[0-9]+]] = llvm.bitcast %{{[0-9]+}} : !llvm.ptr>> to !llvm.ptr + ; CHECK: %[[a3:[0-9]+]] = llvm.alloca %{{[0-9]+}} x !llvm.i8 : (!llvm.i32) -> !llvm.ptr %1 = alloca i8 - ; CHECK: llvm.invoke @foo(%[[a3]]) to ^bb2 unwind ^bb1 : (!llvm<"i8*">) -> () + ; CHECK: llvm.invoke @foo(%[[a3]]) to ^bb2 unwind ^bb1 : (!llvm.ptr) -> () invoke void @foo(i8* %1) to label %4 unwind label %2 ; CHECK: ^bb1: - ; CHECK: %{{[0-9]+}} = llvm.landingpad (catch %{{[0-9]+}} : !llvm<"i8**">) (catch %[[a1]] : !llvm<"i8*">) (filter %{{[0-9]+}} : !llvm<"[1 x i8]">) : !llvm<"{ i8*, i32 }"> + ; CHECK: %{{[0-9]+}} = llvm.landingpad (catch %{{[0-9]+}} : !llvm.ptr>) (catch %[[a1]] : !llvm.ptr) (filter %{{[0-9]+}} : !llvm.array<1 x i8>) : !llvm.struct<(ptr, i32)> %3 = landingpad { i8*, i32 } catch i8** @_ZTIi catch i8* bitcast (i8*** @_ZTIii to i8*) - ; FIXME: Change filter to a constant array once they are handled. + ; FIXME: Change filter to a constant array once they are handled. ; Currently, even though it parses this, LLVM module is broken filter [1 x i8] [i8 1] resume { i8*, i32 } %3 @@ -298,7 +298,7 @@ ret i32 1 ; CHECK: ^bb3: - ; CHECK: %{{[0-9]+}} = llvm.invoke @bar(%[[a3]]) to ^bb2 unwind ^bb1 : (!llvm<"i8*">) -> !llvm<"i8*"> + ; CHECK: %{{[0-9]+}} = llvm.invoke @bar(%[[a3]]) to ^bb2 unwind ^bb1 : (!llvm.ptr) -> !llvm.ptr %6 = invoke i8* @bar(i8* %1) to label %4 unwind label %2 ; CHECK: ^bb4: diff --git a/mlir/test/Target/llvmir-intrinsics.mlir b/mlir/test/Target/llvmir-intrinsics.mlir --- a/mlir/test/Target/llvmir-intrinsics.mlir +++ b/mlir/test/Target/llvmir-intrinsics.mlir @@ -1,92 +1,92 @@ // RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s // CHECK-LABEL: @intrinsics -llvm.func @intrinsics(%arg0: !llvm.float, %arg1: !llvm.float, %arg2: !llvm<"<8 x float>">, %arg3: !llvm<"i8*">) { +llvm.func @intrinsics(%arg0: !llvm.float, %arg1: !llvm.float, %arg2: !llvm.vec<8 x float>, %arg3: !llvm.ptr) { %c3 = llvm.mlir.constant(3 : i32) : !llvm.i32 %c1 = llvm.mlir.constant(1 : i32) : !llvm.i32 %c0 = llvm.mlir.constant(0 : i32) : !llvm.i32 // CHECK: call float @llvm.fmuladd.f32 "llvm.intr.fmuladd"(%arg0, %arg1, %arg0) : (!llvm.float, !llvm.float, !llvm.float) -> !llvm.float // CHECK: call <8 x float> @llvm.fmuladd.v8f32 - "llvm.intr.fmuladd"(%arg2, %arg2, %arg2) : (!llvm<"<8 x float>">, !llvm<"<8 x float>">, !llvm<"<8 x float>">) -> !llvm<"<8 x float>"> + "llvm.intr.fmuladd"(%arg2, %arg2, %arg2) : (!llvm.vec<8 x float>, !llvm.vec<8 x float>, !llvm.vec<8 x float>) -> !llvm.vec<8 x float> // CHECK: call float @llvm.fma.f32 "llvm.intr.fma"(%arg0, %arg1, %arg0) : (!llvm.float, !llvm.float, !llvm.float) -> !llvm.float // CHECK: call <8 x float> @llvm.fma.v8f32 - "llvm.intr.fma"(%arg2, %arg2, %arg2) : (!llvm<"<8 x float>">, !llvm<"<8 x float>">, !llvm<"<8 x float>">) -> !llvm<"<8 x float>"> + "llvm.intr.fma"(%arg2, %arg2, %arg2) : (!llvm.vec<8 x float>, !llvm.vec<8 x float>, !llvm.vec<8 x float>) -> !llvm.vec<8 x float> // CHECK: call void @llvm.prefetch.p0i8(i8* %3, i32 0, i32 3, i32 1) - "llvm.intr.prefetch"(%arg3, %c0, %c3, %c1) : (!llvm<"i8*">, !llvm.i32, !llvm.i32, !llvm.i32) -> () + "llvm.intr.prefetch"(%arg3, %c0, %c3, %c1) : (!llvm.ptr, !llvm.i32, !llvm.i32, !llvm.i32) -> () llvm.return } // CHECK-LABEL: @exp_test -llvm.func @exp_test(%arg0: !llvm.float, %arg1: !llvm<"<8 x float>">) { +llvm.func @exp_test(%arg0: !llvm.float, %arg1: !llvm.vec<8 x float>) { // CHECK: call float @llvm.exp.f32 "llvm.intr.exp"(%arg0) : (!llvm.float) -> !llvm.float // CHECK: call <8 x float> @llvm.exp.v8f32 - "llvm.intr.exp"(%arg1) : (!llvm<"<8 x float>">) -> !llvm<"<8 x float>"> + "llvm.intr.exp"(%arg1) : (!llvm.vec<8 x float>) -> !llvm.vec<8 x float> llvm.return } // CHECK-LABEL: @exp2_test -llvm.func @exp2_test(%arg0: !llvm.float, %arg1: !llvm<"<8 x float>">) { +llvm.func @exp2_test(%arg0: !llvm.float, %arg1: !llvm.vec<8 x float>) { // CHECK: call float @llvm.exp2.f32 "llvm.intr.exp2"(%arg0) : (!llvm.float) -> !llvm.float // CHECK: call <8 x float> @llvm.exp2.v8f32 - "llvm.intr.exp2"(%arg1) : (!llvm<"<8 x float>">) -> !llvm<"<8 x float>"> + "llvm.intr.exp2"(%arg1) : (!llvm.vec<8 x float>) -> !llvm.vec<8 x float> llvm.return } // CHECK-LABEL: @log_test -llvm.func @log_test(%arg0: !llvm.float, %arg1: !llvm<"<8 x float>">) { +llvm.func @log_test(%arg0: !llvm.float, %arg1: !llvm.vec<8 x float>) { // CHECK: call float @llvm.log.f32 "llvm.intr.log"(%arg0) : (!llvm.float) -> !llvm.float // CHECK: call <8 x float> @llvm.log.v8f32 - "llvm.intr.log"(%arg1) : (!llvm<"<8 x float>">) -> !llvm<"<8 x float>"> + "llvm.intr.log"(%arg1) : (!llvm.vec<8 x float>) -> !llvm.vec<8 x float> llvm.return } // CHECK-LABEL: @log10_test -llvm.func @log10_test(%arg0: !llvm.float, %arg1: !llvm<"<8 x float>">) { +llvm.func @log10_test(%arg0: !llvm.float, %arg1: !llvm.vec<8 x float>) { // CHECK: call float @llvm.log10.f32 "llvm.intr.log10"(%arg0) : (!llvm.float) -> !llvm.float // CHECK: call <8 x float> @llvm.log10.v8f32 - "llvm.intr.log10"(%arg1) : (!llvm<"<8 x float>">) -> !llvm<"<8 x float>"> + "llvm.intr.log10"(%arg1) : (!llvm.vec<8 x float>) -> !llvm.vec<8 x float> llvm.return } // CHECK-LABEL: @log2_test -llvm.func @log2_test(%arg0: !llvm.float, %arg1: !llvm<"<8 x float>">) { +llvm.func @log2_test(%arg0: !llvm.float, %arg1: !llvm.vec<8 x float>) { // CHECK: call float @llvm.log2.f32 "llvm.intr.log2"(%arg0) : (!llvm.float) -> !llvm.float // CHECK: call <8 x float> @llvm.log2.v8f32 - "llvm.intr.log2"(%arg1) : (!llvm<"<8 x float>">) -> !llvm<"<8 x float>"> + "llvm.intr.log2"(%arg1) : (!llvm.vec<8 x float>) -> !llvm.vec<8 x float> llvm.return } // CHECK-LABEL: @fabs_test -llvm.func @fabs_test(%arg0: !llvm.float, %arg1: !llvm<"<8 x float>">) { +llvm.func @fabs_test(%arg0: !llvm.float, %arg1: !llvm.vec<8 x float>) { // CHECK: call float @llvm.fabs.f32 "llvm.intr.fabs"(%arg0) : (!llvm.float) -> !llvm.float // CHECK: call <8 x float> @llvm.fabs.v8f32 - "llvm.intr.fabs"(%arg1) : (!llvm<"<8 x float>">) -> !llvm<"<8 x float>"> + "llvm.intr.fabs"(%arg1) : (!llvm.vec<8 x float>) -> !llvm.vec<8 x float> llvm.return } // CHECK-LABEL: @sqrt_test -llvm.func @sqrt_test(%arg0: !llvm.float, %arg1: !llvm<"<8 x float>">) { +llvm.func @sqrt_test(%arg0: !llvm.float, %arg1: !llvm.vec<8 x float>) { // CHECK: call float @llvm.sqrt.f32 "llvm.intr.sqrt"(%arg0) : (!llvm.float) -> !llvm.float // CHECK: call <8 x float> @llvm.sqrt.v8f32 - "llvm.intr.sqrt"(%arg1) : (!llvm<"<8 x float>">) -> !llvm<"<8 x float>"> + "llvm.intr.sqrt"(%arg1) : (!llvm.vec<8 x float>) -> !llvm.vec<8 x float> llvm.return } // CHECK-LABEL: @ceil_test -llvm.func @ceil_test(%arg0: !llvm.float, %arg1: !llvm<"<8 x float>">) { +llvm.func @ceil_test(%arg0: !llvm.float, %arg1: !llvm.vec<8 x float>) { // CHECK: call float @llvm.ceil.f32 "llvm.intr.ceil"(%arg0) : (!llvm.float) -> !llvm.float // CHECK: call <8 x float> @llvm.ceil.v8f32 - "llvm.intr.ceil"(%arg1) : (!llvm<"<8 x float>">) -> !llvm<"<8 x float>"> + "llvm.intr.ceil"(%arg1) : (!llvm.vec<8 x float>) -> !llvm.vec<8 x float> llvm.return } @@ -100,47 +100,47 @@ } // CHECK-LABEL: @cos_test -llvm.func @cos_test(%arg0: !llvm.float, %arg1: !llvm<"<8 x float>">) { +llvm.func @cos_test(%arg0: !llvm.float, %arg1: !llvm.vec<8 x float>) { // CHECK: call float @llvm.cos.f32 "llvm.intr.cos"(%arg0) : (!llvm.float) -> !llvm.float // CHECK: call <8 x float> @llvm.cos.v8f32 - "llvm.intr.cos"(%arg1) : (!llvm<"<8 x float>">) -> !llvm<"<8 x float>"> + "llvm.intr.cos"(%arg1) : (!llvm.vec<8 x float>) -> !llvm.vec<8 x float> llvm.return } // CHECK-LABEL: @copysign_test -llvm.func @copysign_test(%arg0: !llvm.float, %arg1: !llvm.float, %arg2: !llvm<"<8 x float>">, %arg3: !llvm<"<8 x float>">) { +llvm.func @copysign_test(%arg0: !llvm.float, %arg1: !llvm.float, %arg2: !llvm.vec<8 x float>, %arg3: !llvm.vec<8 x float>) { // CHECK: call float @llvm.copysign.f32 "llvm.intr.copysign"(%arg0, %arg1) : (!llvm.float, !llvm.float) -> !llvm.float // CHECK: call <8 x float> @llvm.copysign.v8f32 - "llvm.intr.copysign"(%arg2, %arg3) : (!llvm<"<8 x float>">, !llvm<"<8 x float>">) -> !llvm<"<8 x float>"> + "llvm.intr.copysign"(%arg2, %arg3) : (!llvm.vec<8 x float>, !llvm.vec<8 x float>) -> !llvm.vec<8 x float> llvm.return } // CHECK-LABEL: @pow_test -llvm.func @pow_test(%arg0: !llvm.float, %arg1: !llvm.float, %arg2: !llvm<"<8 x float>">, %arg3: !llvm<"<8 x float>">) { +llvm.func @pow_test(%arg0: !llvm.float, %arg1: !llvm.float, %arg2: !llvm.vec<8 x float>, %arg3: !llvm.vec<8 x float>) { // CHECK: call float @llvm.pow.f32 "llvm.intr.pow"(%arg0, %arg1) : (!llvm.float, !llvm.float) -> !llvm.float // CHECK: call <8 x float> @llvm.pow.v8f32 - "llvm.intr.pow"(%arg2, %arg3) : (!llvm<"<8 x float>">, !llvm<"<8 x float>">) -> !llvm<"<8 x float>"> + "llvm.intr.pow"(%arg2, %arg3) : (!llvm.vec<8 x float>, !llvm.vec<8 x float>) -> !llvm.vec<8 x float> llvm.return } // CHECK-LABEL: @bitreverse_test -llvm.func @bitreverse_test(%arg0: !llvm.i32, %arg1: !llvm<"<8 x i32>">) { +llvm.func @bitreverse_test(%arg0: !llvm.i32, %arg1: !llvm.vec<8 x i32>) { // CHECK: call i32 @llvm.bitreverse.i32 "llvm.intr.bitreverse"(%arg0) : (!llvm.i32) -> !llvm.i32 // CHECK: call <8 x i32> @llvm.bitreverse.v8i32 - "llvm.intr.bitreverse"(%arg1) : (!llvm<"<8 x i32>">) -> !llvm<"<8 x i32>"> + "llvm.intr.bitreverse"(%arg1) : (!llvm.vec<8 x i32>) -> !llvm.vec<8 x i32> llvm.return } // CHECK-LABEL: @ctpop_test -llvm.func @ctpop_test(%arg0: !llvm.i32, %arg1: !llvm<"<8 x i32>">) { +llvm.func @ctpop_test(%arg0: !llvm.i32, %arg1: !llvm.vec<8 x i32>) { // CHECK: call i32 @llvm.ctpop.i32 "llvm.intr.ctpop"(%arg0) : (!llvm.i32) -> !llvm.i32 // CHECK: call <8 x i32> @llvm.ctpop.v8i32 - "llvm.intr.ctpop"(%arg1) : (!llvm<"<8 x i32>">) -> !llvm<"<8 x i32>"> + "llvm.intr.ctpop"(%arg1) : (!llvm.vec<8 x i32>) -> !llvm.vec<8 x i32> llvm.return } @@ -181,97 +181,97 @@ } // CHECK-LABEL: @vector_reductions -llvm.func @vector_reductions(%arg0: !llvm.float, %arg1: !llvm<"<8 x float>">, %arg2: !llvm<"<8 x i32>">) { +llvm.func @vector_reductions(%arg0: !llvm.float, %arg1: !llvm.vec<8 x float>, %arg2: !llvm.vec<8 x i32>) { // CHECK: call i32 @llvm.experimental.vector.reduce.add.v8i32 - "llvm.intr.experimental.vector.reduce.add"(%arg2) : (!llvm<"<8 x i32>">) -> !llvm.i32 + "llvm.intr.experimental.vector.reduce.add"(%arg2) : (!llvm.vec<8 x i32>) -> !llvm.i32 // CHECK: call i32 @llvm.experimental.vector.reduce.and.v8i32 - "llvm.intr.experimental.vector.reduce.and"(%arg2) : (!llvm<"<8 x i32>">) -> !llvm.i32 + "llvm.intr.experimental.vector.reduce.and"(%arg2) : (!llvm.vec<8 x i32>) -> !llvm.i32 // CHECK: call float @llvm.experimental.vector.reduce.fmax.v8f32 - "llvm.intr.experimental.vector.reduce.fmax"(%arg1) : (!llvm<"<8 x float>">) -> !llvm.float + "llvm.intr.experimental.vector.reduce.fmax"(%arg1) : (!llvm.vec<8 x float>) -> !llvm.float // CHECK: call float @llvm.experimental.vector.reduce.fmin.v8f32 - "llvm.intr.experimental.vector.reduce.fmin"(%arg1) : (!llvm<"<8 x float>">) -> !llvm.float + "llvm.intr.experimental.vector.reduce.fmin"(%arg1) : (!llvm.vec<8 x float>) -> !llvm.float // CHECK: call i32 @llvm.experimental.vector.reduce.mul.v8i32 - "llvm.intr.experimental.vector.reduce.mul"(%arg2) : (!llvm<"<8 x i32>">) -> !llvm.i32 + "llvm.intr.experimental.vector.reduce.mul"(%arg2) : (!llvm.vec<8 x i32>) -> !llvm.i32 // CHECK: call i32 @llvm.experimental.vector.reduce.or.v8i32 - "llvm.intr.experimental.vector.reduce.or"(%arg2) : (!llvm<"<8 x i32>">) -> !llvm.i32 + "llvm.intr.experimental.vector.reduce.or"(%arg2) : (!llvm.vec<8 x i32>) -> !llvm.i32 // CHECK: call i32 @llvm.experimental.vector.reduce.smax.v8i32 - "llvm.intr.experimental.vector.reduce.smax"(%arg2) : (!llvm<"<8 x i32>">) -> !llvm.i32 + "llvm.intr.experimental.vector.reduce.smax"(%arg2) : (!llvm.vec<8 x i32>) -> !llvm.i32 // CHECK: call i32 @llvm.experimental.vector.reduce.smin.v8i32 - "llvm.intr.experimental.vector.reduce.smin"(%arg2) : (!llvm<"<8 x i32>">) -> !llvm.i32 + "llvm.intr.experimental.vector.reduce.smin"(%arg2) : (!llvm.vec<8 x i32>) -> !llvm.i32 // CHECK: call i32 @llvm.experimental.vector.reduce.umax.v8i32 - "llvm.intr.experimental.vector.reduce.umax"(%arg2) : (!llvm<"<8 x i32>">) -> !llvm.i32 + "llvm.intr.experimental.vector.reduce.umax"(%arg2) : (!llvm.vec<8 x i32>) -> !llvm.i32 // CHECK: call i32 @llvm.experimental.vector.reduce.umin.v8i32 - "llvm.intr.experimental.vector.reduce.umin"(%arg2) : (!llvm<"<8 x i32>">) -> !llvm.i32 + "llvm.intr.experimental.vector.reduce.umin"(%arg2) : (!llvm.vec<8 x i32>) -> !llvm.i32 // CHECK: call float @llvm.experimental.vector.reduce.v2.fadd.f32.v8f32 - "llvm.intr.experimental.vector.reduce.v2.fadd"(%arg0, %arg1) : (!llvm.float, !llvm<"<8 x float>">) -> !llvm.float + "llvm.intr.experimental.vector.reduce.v2.fadd"(%arg0, %arg1) : (!llvm.float, !llvm.vec<8 x float>) -> !llvm.float // CHECK: call float @llvm.experimental.vector.reduce.v2.fmul.f32.v8f32 - "llvm.intr.experimental.vector.reduce.v2.fmul"(%arg0, %arg1) : (!llvm.float, !llvm<"<8 x float>">) -> !llvm.float + "llvm.intr.experimental.vector.reduce.v2.fmul"(%arg0, %arg1) : (!llvm.float, !llvm.vec<8 x float>) -> !llvm.float // CHECK: call reassoc float @llvm.experimental.vector.reduce.v2.fadd.f32.v8f32 - "llvm.intr.experimental.vector.reduce.v2.fadd"(%arg0, %arg1) {reassoc = true} : (!llvm.float, !llvm<"<8 x float>">) -> !llvm.float + "llvm.intr.experimental.vector.reduce.v2.fadd"(%arg0, %arg1) {reassoc = true} : (!llvm.float, !llvm.vec<8 x float>) -> !llvm.float // CHECK: call reassoc float @llvm.experimental.vector.reduce.v2.fmul.f32.v8f32 - "llvm.intr.experimental.vector.reduce.v2.fmul"(%arg0, %arg1) {reassoc = true} : (!llvm.float, !llvm<"<8 x float>">) -> !llvm.float + "llvm.intr.experimental.vector.reduce.v2.fmul"(%arg0, %arg1) {reassoc = true} : (!llvm.float, !llvm.vec<8 x float>) -> !llvm.float // CHECK: call i32 @llvm.experimental.vector.reduce.xor.v8i32 - "llvm.intr.experimental.vector.reduce.xor"(%arg2) : (!llvm<"<8 x i32>">) -> !llvm.i32 + "llvm.intr.experimental.vector.reduce.xor"(%arg2) : (!llvm.vec<8 x i32>) -> !llvm.i32 llvm.return } // CHECK-LABEL: @matrix_intrinsics // 4x16 16x3 -llvm.func @matrix_intrinsics(%A: !llvm<"<64 x float>">, %B: !llvm<"<48 x float>">, - %ptr: !llvm<"float*">, %stride: !llvm.i64) { +llvm.func @matrix_intrinsics(%A: !llvm.vec<64 x float>, %B: !llvm.vec<48 x float>, + %ptr: !llvm.ptr, %stride: !llvm.i64) { // CHECK: call <12 x float> @llvm.matrix.multiply.v12f32.v64f32.v48f32(<64 x float> %0, <48 x float> %1, i32 4, i32 16, i32 3) %C = llvm.intr.matrix.multiply %A, %B { lhs_rows = 4: i32, lhs_columns = 16: i32 , rhs_columns = 3: i32} : - (!llvm<"<64 x float>">, !llvm<"<48 x float>">) -> !llvm<"<12 x float>"> + (!llvm.vec<64 x float>, !llvm.vec<48 x float>) -> !llvm.vec<12 x float> // CHECK: call <48 x float> @llvm.matrix.transpose.v48f32(<48 x float> %1, i32 3, i32 16) %D = llvm.intr.matrix.transpose %B { rows = 3: i32, columns = 16: i32} : - !llvm<"<48 x float>"> into !llvm<"<48 x float>"> + !llvm.vec<48 x float> into !llvm.vec<48 x float> // CHECK: call <48 x float> @llvm.matrix.column.major.load.v48f32(float* align 4 %2, i64 %3, i1 false, i32 3, i32 16) %E = llvm.intr.matrix.column.major.load %ptr, { isVolatile = 0: i1, rows = 3: i32, columns = 16: i32} : - !llvm<"<48 x float>"> from !llvm<"float*"> stride !llvm.i64 + !llvm.vec<48 x float> from !llvm.ptr stride !llvm.i64 // CHECK: call void @llvm.matrix.column.major.store.v48f32(<48 x float> %7, float* align 4 %2, i64 %3, i1 false, i32 3, i32 16) llvm.intr.matrix.column.major.store %E, %ptr, { isVolatile = 0: i1, rows = 3: i32, columns = 16: i32} : - !llvm<"<48 x float>"> to !llvm<"float*"> stride !llvm.i64 + !llvm.vec<48 x float> to !llvm.ptr stride !llvm.i64 llvm.return } // CHECK-LABEL: @masked_intrinsics -llvm.func @masked_intrinsics(%A: !llvm<"<7 x float>*">, %mask: !llvm<"<7 x i1>">) { +llvm.func @masked_intrinsics(%A: !llvm.ptr>, %mask: !llvm.vec<7 x i1>) { // CHECK: call <7 x float> @llvm.masked.load.v7f32.p0v7f32(<7 x float>* %{{.*}}, i32 1, <7 x i1> %{{.*}}, <7 x float> undef) %a = llvm.intr.masked.load %A, %mask { alignment = 1: i32} : - (!llvm<"<7 x float>*">, !llvm<"<7 x i1>">) -> !llvm<"<7 x float>"> + (!llvm.ptr>, !llvm.vec<7 x i1>) -> !llvm.vec<7 x float> // CHECK: call <7 x float> @llvm.masked.load.v7f32.p0v7f32(<7 x float>* %{{.*}}, i32 1, <7 x i1> %{{.*}}, <7 x float> %{{.*}}) %b = llvm.intr.masked.load %A, %mask, %a { alignment = 1: i32} : - (!llvm<"<7 x float>*">, !llvm<"<7 x i1>">, !llvm<"<7 x float>">) -> !llvm<"<7 x float>"> + (!llvm.ptr>, !llvm.vec<7 x i1>, !llvm.vec<7 x float>) -> !llvm.vec<7 x float> // CHECK: call void @llvm.masked.store.v7f32.p0v7f32(<7 x float> %{{.*}}, <7 x float>* %0, i32 {{.*}}, <7 x i1> %{{.*}}) llvm.intr.masked.store %b, %A, %mask { alignment = 1: i32} : - !llvm<"<7 x float>">, !llvm<"<7 x i1>"> into !llvm<"<7 x float>*"> + !llvm.vec<7 x float>, !llvm.vec<7 x i1> into !llvm.ptr> llvm.return } // CHECK-LABEL: @masked_gather_scatter_intrinsics -llvm.func @masked_gather_scatter_intrinsics(%M: !llvm<"<7 x float*>">, %mask: !llvm<"<7 x i1>">) { +llvm.func @masked_gather_scatter_intrinsics(%M: !llvm.vec<7 x ptr>, %mask: !llvm.vec<7 x i1>) { // CHECK: call <7 x float> @llvm.masked.gather.v7f32.v7p0f32(<7 x float*> %{{.*}}, i32 1, <7 x i1> %{{.*}}, <7 x float> undef) %a = llvm.intr.masked.gather %M, %mask { alignment = 1: i32} : - (!llvm<"<7 x float*>">, !llvm<"<7 x i1>">) -> !llvm<"<7 x float>"> + (!llvm.vec<7 x ptr>, !llvm.vec<7 x i1>) -> !llvm.vec<7 x float> // CHECK: call <7 x float> @llvm.masked.gather.v7f32.v7p0f32(<7 x float*> %{{.*}}, i32 1, <7 x i1> %{{.*}}, <7 x float> %{{.*}}) %b = llvm.intr.masked.gather %M, %mask, %a { alignment = 1: i32} : - (!llvm<"<7 x float*>">, !llvm<"<7 x i1>">, !llvm<"<7 x float>">) -> !llvm<"<7 x float>"> + (!llvm.vec<7 x ptr>, !llvm.vec<7 x i1>, !llvm.vec<7 x float>) -> !llvm.vec<7 x float> // CHECK: call void @llvm.masked.scatter.v7f32.v7p0f32(<7 x float> %{{.*}}, <7 x float*> %{{.*}}, i32 1, <7 x i1> %{{.*}}) llvm.intr.masked.scatter %b, %M, %mask { alignment = 1: i32} : - !llvm<"<7 x float>">, !llvm<"<7 x i1>"> into !llvm<"<7 x float*>"> + !llvm.vec<7 x float>, !llvm.vec<7 x i1> into !llvm.vec<7 x ptr> llvm.return } // CHECK-LABEL: @memcpy_test -llvm.func @memcpy_test(%arg0: !llvm.i32, %arg1: !llvm.i1, %arg2: !llvm<"i8*">, %arg3: !llvm<"i8*">) { +llvm.func @memcpy_test(%arg0: !llvm.i32, %arg1: !llvm.i1, %arg2: !llvm.ptr, %arg3: !llvm.ptr) { // CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %{{.*}}, i8* %{{.*}}, i32 %{{.*}}, i1 %{{.*}}) - "llvm.intr.memcpy"(%arg2, %arg3, %arg0, %arg1) : (!llvm<"i8*">, !llvm<"i8*">, !llvm.i32, !llvm.i1) -> () + "llvm.intr.memcpy"(%arg2, %arg3, %arg0, %arg1) : (!llvm.ptr, !llvm.ptr, !llvm.i32, !llvm.i1) -> () %sz = llvm.mlir.constant(10: i64) : !llvm.i64 // CHECK: call void @llvm.memcpy.inline.p0i8.p0i8.i64(i8* %{{.*}}, i8* %{{.*}}, i64 10, i1 %{{.*}}) - "llvm.intr.memcpy.inline"(%arg2, %arg3, %sz, %arg1) : (!llvm<"i8*">, !llvm<"i8*">, !llvm.i64, !llvm.i1) -> () + "llvm.intr.memcpy.inline"(%arg2, %arg3, %sz, %arg1) : (!llvm.ptr, !llvm.ptr, !llvm.i64, !llvm.i1) -> () llvm.return } diff --git a/mlir/test/Target/llvmir-invalid.mlir b/mlir/test/Target/llvmir-invalid.mlir --- a/mlir/test/Target/llvmir-invalid.mlir +++ b/mlir/test/Target/llvmir-invalid.mlir @@ -21,16 +21,16 @@ // ----- -llvm.func @no_nested_struct() -> !llvm<"[2 x [2 x [2 x {i32}]]]"> { +llvm.func @no_nested_struct() -> !llvm.array<2 x array<2 x array<2 x struct<(i32)>>>> { // expected-error @+1 {{struct types are not supported in constants}} - %0 = llvm.mlir.constant(dense<[[[1, 2], [3, 4]], [[42, 43], [44, 45]]]> : tensor<2x2x2xi32>) : !llvm<"[2 x [2 x [2 x {i32}]]]"> - llvm.return %0 : !llvm<"[2 x [2 x [2 x {i32}]]]"> + %0 = llvm.mlir.constant(dense<[[[1, 2], [3, 4]], [[42, 43], [44, 45]]]> : tensor<2x2x2xi32>) : !llvm.array<2 x array<2 x array<2 x struct<(i32)>>>> + llvm.return %0 : !llvm.array<2 x array<2 x array<2 x struct<(i32)>>>> } // ----- // expected-error @+1 {{unsupported constant value}} -llvm.mlir.global internal constant @test([2.5, 7.4]) : !llvm<"[2 x double]"> +llvm.mlir.global internal constant @test([2.5, 7.4]) : !llvm.array<2 x double> // ----- diff --git a/mlir/test/Target/llvmir.mlir b/mlir/test/Target/llvmir.mlir --- a/mlir/test/Target/llvmir.mlir +++ b/mlir/test/Target/llvmir.mlir @@ -7,7 +7,7 @@ llvm.mlir.global internal constant @i32_const(52: i53) : !llvm.i53 // CHECK: @int_global_array = internal global [3 x i32] [i32 62, i32 62, i32 62] -llvm.mlir.global internal @int_global_array(dense<62> : vector<3xi32>) : !llvm<"[3 x i32]"> +llvm.mlir.global internal @int_global_array(dense<62> : vector<3xi32>) : !llvm.array<3 x i32> // CHECK: @i32_global_addr_space = internal addrspace(7) global i32 62 llvm.mlir.global internal @i32_global_addr_space(62: i32) {addr_space = 7 : i32} : !llvm.i32 @@ -16,20 +16,20 @@ llvm.mlir.global internal @float_global(0.0: f32) : !llvm.float // CHECK: @float_global_array = internal global [1 x float] [float -5.000000e+00] -llvm.mlir.global internal @float_global_array(dense<[-5.0]> : vector<1xf32>) : !llvm<"[1 x float]"> +llvm.mlir.global internal @float_global_array(dense<[-5.0]> : vector<1xf32>) : !llvm.array<1 x float> // CHECK: @string_const = internal constant [6 x i8] c"foobar" -llvm.mlir.global internal constant @string_const("foobar") : !llvm<"[6 x i8]"> +llvm.mlir.global internal constant @string_const("foobar") : !llvm.array<6 x i8> // CHECK: @int_global_undef = internal global i64 undef llvm.mlir.global internal @int_global_undef() : !llvm.i64 // CHECK: @int_gep = internal constant i32* getelementptr (i32, i32* @i32_global, i32 2) -llvm.mlir.global internal constant @int_gep() : !llvm<"i32*"> { - %addr = llvm.mlir.addressof @i32_global : !llvm<"i32*"> +llvm.mlir.global internal constant @int_gep() : !llvm.ptr { + %addr = llvm.mlir.addressof @i32_global : !llvm.ptr %_c0 = llvm.mlir.constant(2: i32) :!llvm.i32 - %gepinit = llvm.getelementptr %addr[%_c0] : (!llvm<"i32*">, !llvm.i32) -> !llvm<"i32*"> - llvm.return %gepinit : !llvm<"i32*"> + %gepinit = llvm.getelementptr %addr[%_c0] : (!llvm.ptr, !llvm.i32) -> !llvm.ptr + llvm.return %gepinit : !llvm.ptr } // @@ -66,7 +66,7 @@ // // CHECK: declare i8* @malloc(i64) -llvm.func @malloc(!llvm.i64) -> !llvm<"i8*"> +llvm.func @malloc(!llvm.i64) -> !llvm.ptr // CHECK: declare void @free(i8*) @@ -86,15 +86,15 @@ llvm.func @global_refs() { // Check load from globals. // CHECK: load i32, i32* @i32_global - %0 = llvm.mlir.addressof @i32_global : !llvm<"i32*"> - %1 = llvm.load %0 : !llvm<"i32*"> + %0 = llvm.mlir.addressof @i32_global : !llvm.ptr + %1 = llvm.load %0 : !llvm.ptr // Check the contracted form of load from array constants. // CHECK: load i8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @string_const, i64 0, i64 0) - %2 = llvm.mlir.addressof @string_const : !llvm<"[6 x i8]*"> + %2 = llvm.mlir.addressof @string_const : !llvm.ptr> %c0 = llvm.mlir.constant(0 : index) : !llvm.i64 - %3 = llvm.getelementptr %2[%c0, %c0] : (!llvm<"[6 x i8]*">, !llvm.i64, !llvm.i64) -> !llvm<"i8*"> - %4 = llvm.load %3 : !llvm<"i8*"> + %3 = llvm.getelementptr %2[%c0, %c0] : (!llvm.ptr>, !llvm.i64, !llvm.i64) -> !llvm.ptr + %4 = llvm.load %3 : !llvm.ptr llvm.return } @@ -414,12 +414,12 @@ %0 = llvm.mlir.constant(10 : index) : !llvm.i64 %1 = llvm.mlir.constant(10 : index) : !llvm.i64 %2 = llvm.mul %0, %1 : !llvm.i64 - %3 = llvm.mlir.undef : !llvm<"{ float* }"> + %3 = llvm.mlir.undef : !llvm.struct<(ptr)> %4 = llvm.mlir.constant(4 : index) : !llvm.i64 %5 = llvm.mul %2, %4 : !llvm.i64 - %6 = llvm.call @malloc(%5) : (!llvm.i64) -> !llvm<"i8*"> - %7 = llvm.bitcast %6 : !llvm<"i8*"> to !llvm<"float*"> - %8 = llvm.insertvalue %7, %3[0] : !llvm<"{ float* }"> + %6 = llvm.call @malloc(%5) : (!llvm.i64) -> !llvm.ptr + %7 = llvm.bitcast %6 : !llvm.ptr to !llvm.ptr + %8 = llvm.insertvalue %7, %3[0] : !llvm.struct<(ptr)> // CHECK-NEXT: ret void llvm.return } @@ -434,12 +434,12 @@ // CHECK-NEXT: %{{[0-9]+}} = bitcast i8* %{{[0-9]+}} to float* // CHECK-NEXT: %{{[0-9]+}} = insertvalue { float* } undef, float* %{{[0-9]+}}, 0 %0 = llvm.mlir.constant(10 : index) : !llvm.i64 - %1 = llvm.mlir.undef : !llvm<"{ float* }"> + %1 = llvm.mlir.undef : !llvm.struct<(ptr)> %2 = llvm.mlir.constant(4 : index) : !llvm.i64 %3 = llvm.mul %0, %2 : !llvm.i64 - %4 = llvm.call @malloc(%3) : (!llvm.i64) -> !llvm<"i8*"> - %5 = llvm.bitcast %4 : !llvm<"i8*"> to !llvm<"float*"> - %6 = llvm.insertvalue %5, %1[0] : !llvm<"{ float* }"> + %4 = llvm.call @malloc(%3) : (!llvm.i64) -> !llvm.ptr + %5 = llvm.bitcast %4 : !llvm.ptr to !llvm.ptr + %6 = llvm.insertvalue %5, %1[0] : !llvm.struct<(ptr)> %7 = llvm.mlir.constant(1.000000e+00 : f32) : !llvm.float llvm.br ^bb1 ^bb1: // pred: ^bb0 @@ -457,9 +457,9 @@ // CHECK-NEXT: %{{[0-9]+}} = getelementptr float, float* %{{[0-9]+}}, i64 %{{[0-9]+}} // CHECK-NEXT: store float 1.000000e+00, float* %{{[0-9]+}} %12 = llvm.mlir.constant(10 : index) : !llvm.i64 - %13 = llvm.extractvalue %6[0] : !llvm<"{ float* }"> - %14 = llvm.getelementptr %13[%10] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - llvm.store %7, %14 : !llvm<"float*"> + %13 = llvm.extractvalue %6[0] : !llvm.struct<(ptr)> + %14 = llvm.getelementptr %13[%10] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + llvm.store %7, %14 : !llvm.ptr %15 = llvm.mlir.constant(1 : index) : !llvm.i64 // CHECK-NEXT: %{{[0-9]+}} = add i64 %{{[0-9]+}}, 1 %16 = llvm.add %10, %15 : !llvm.i64 @@ -482,9 +482,9 @@ // CHECK-NEXT: %{{[0-9]+}} = getelementptr float, float* %{{[0-9]+}}, i64 %{{[0-9]+}} // CHECK-NEXT: %{{[0-9]+}} = load float, float* %{{[0-9]+}} %21 = llvm.mlir.constant(10 : index) : !llvm.i64 - %22 = llvm.extractvalue %6[0] : !llvm<"{ float* }"> - %23 = llvm.getelementptr %22[%19] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - %24 = llvm.load %23 : !llvm<"float*"> + %22 = llvm.extractvalue %6[0] : !llvm.struct<(ptr)> + %23 = llvm.getelementptr %22[%19] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + %24 = llvm.load %23 : !llvm.ptr %25 = llvm.mlir.constant(1 : index) : !llvm.i64 // CHECK-NEXT: %{{[0-9]+}} = add i64 %{{[0-9]+}}, 1 %26 = llvm.add %19, %25 : !llvm.i64 @@ -502,13 +502,13 @@ // CHECK-NEXT: %{{[0-9]+}} = bitcast i8* %{{[0-9]+}} to float* // CHECK-NEXT: %{{[0-9]+}} = insertvalue { float*, i64 } undef, float* %{{[0-9]+}}, 0 // CHECK-NEXT: %{{[0-9]+}} = insertvalue { float*, i64 } %{{[0-9]+}}, i64 %{{[0-9]+}}, 1 - %0 = llvm.mlir.undef : !llvm<"{ float*, i64 }"> + %0 = llvm.mlir.undef : !llvm.struct<(ptr, i64)> %1 = llvm.mlir.constant(4 : index) : !llvm.i64 %2 = llvm.mul %arg0, %1 : !llvm.i64 - %3 = llvm.call @malloc(%2) : (!llvm.i64) -> !llvm<"i8*"> - %4 = llvm.bitcast %3 : !llvm<"i8*"> to !llvm<"float*"> - %5 = llvm.insertvalue %4, %0[0] : !llvm<"{ float*, i64 }"> - %6 = llvm.insertvalue %arg0, %5[1] : !llvm<"{ float*, i64 }"> + %3 = llvm.call @malloc(%2) : (!llvm.i64) -> !llvm.ptr + %4 = llvm.bitcast %3 : !llvm.ptr to !llvm.ptr + %5 = llvm.insertvalue %4, %0[0] : !llvm.struct<(ptr, i64)> + %6 = llvm.insertvalue %arg0, %5[1] : !llvm.struct<(ptr, i64)> %7 = llvm.mlir.constant(1.000000e+00 : f32) : !llvm.float // CHECK-NEXT: br label %{{[0-9]+}} llvm.br ^bb1 @@ -526,10 +526,10 @@ // CHECK-NEXT: %{{[0-9]+}} = extractvalue { float*, i64 } %{{[0-9]+}}, 0 // CHECK-NEXT: %{{[0-9]+}} = getelementptr float, float* %{{[0-9]+}}, i64 %{{[0-9]+}} // CHECK-NEXT: store float 1.000000e+00, float* %{{[0-9]+}} - %11 = llvm.extractvalue %6[1] : !llvm<"{ float*, i64 }"> - %12 = llvm.extractvalue %6[0] : !llvm<"{ float*, i64 }"> - %13 = llvm.getelementptr %12[%9] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - llvm.store %7, %13 : !llvm<"float*"> + %11 = llvm.extractvalue %6[1] : !llvm.struct<(ptr, i64)> + %12 = llvm.extractvalue %6[0] : !llvm.struct<(ptr, i64)> + %13 = llvm.getelementptr %12[%9] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + llvm.store %7, %13 : !llvm.ptr %14 = llvm.mlir.constant(1 : index) : !llvm.i64 // CHECK-NEXT: %{{[0-9]+}} = add i64 %{{[0-9]+}}, 1 %15 = llvm.add %9, %14 : !llvm.i64 @@ -551,10 +551,10 @@ // CHECK-NEXT: %{{[0-9]+}} = extractvalue { float*, i64 } %{{[0-9]+}}, 0 // CHECK-NEXT: %{{[0-9]+}} = getelementptr float, float* %{{[0-9]+}}, i64 %{{[0-9]+}} // CHECK-NEXT: %{{[0-9]+}} = load float, float* %{{[0-9]+}} - %19 = llvm.extractvalue %6[1] : !llvm<"{ float*, i64 }"> - %20 = llvm.extractvalue %6[0] : !llvm<"{ float*, i64 }"> - %21 = llvm.getelementptr %20[%17] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - %22 = llvm.load %21 : !llvm<"float*"> + %19 = llvm.extractvalue %6[1] : !llvm.struct<(ptr, i64)> + %20 = llvm.extractvalue %6[0] : !llvm.struct<(ptr, i64)> + %21 = llvm.getelementptr %20[%17] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + %22 = llvm.load %21 : !llvm.ptr %23 = llvm.mlir.constant(1 : index) : !llvm.i64 // CHECK-NEXT: %{{[0-9]+}} = add i64 %{{[0-9]+}}, 1 %24 = llvm.add %17, %23 : !llvm.i64 @@ -582,14 +582,14 @@ %3 = llvm.mul %1, %arg0 : !llvm.i64 %4 = llvm.mul %3, %2 : !llvm.i64 %5 = llvm.mul %4, %0 : !llvm.i64 - %6 = llvm.mlir.undef : !llvm<"{ float*, i64, i64 }"> + %6 = llvm.mlir.undef : !llvm.struct<(ptr, i64, i64)> %7 = llvm.mlir.constant(4 : index) : !llvm.i64 %8 = llvm.mul %5, %7 : !llvm.i64 - %9 = llvm.call @malloc(%8) : (!llvm.i64) -> !llvm<"i8*"> - %10 = llvm.bitcast %9 : !llvm<"i8*"> to !llvm<"float*"> - %11 = llvm.insertvalue %10, %6[0] : !llvm<"{ float*, i64, i64 }"> - %12 = llvm.insertvalue %arg0, %11[1] : !llvm<"{ float*, i64, i64 }"> - %13 = llvm.insertvalue %0, %12[2] : !llvm<"{ float*, i64, i64 }"> + %9 = llvm.call @malloc(%8) : (!llvm.i64) -> !llvm.ptr + %10 = llvm.bitcast %9 : !llvm.ptr to !llvm.ptr + %11 = llvm.insertvalue %10, %6[0] : !llvm.struct<(ptr, i64, i64)> + %12 = llvm.insertvalue %arg0, %11[1] : !llvm.struct<(ptr, i64, i64)> + %13 = llvm.insertvalue %0, %12[2] : !llvm.struct<(ptr, i64, i64)> // CHECK-NEXT: %{{[0-9]+}} = call i64 @get_index() // CHECK-NEXT: %{{[0-9]+}} = call i64 @get_index() @@ -610,18 +610,18 @@ // CHECK-NEXT: %{{[0-9]+}} = extractvalue { float*, i64, i64 } %{{[0-9]+}}, 0 // CHECK-NEXT: %{{[0-9]+}} = getelementptr float, float* %{{[0-9]+}}, i64 %{{[0-9]+}} // CHECK-NEXT: store float 4.200000e+01, float* %{{[0-9]+}} - %20 = llvm.extractvalue %13[1] : !llvm<"{ float*, i64, i64 }"> + %20 = llvm.extractvalue %13[1] : !llvm.struct<(ptr, i64, i64)> %21 = llvm.mlir.constant(4 : index) : !llvm.i64 - %22 = llvm.extractvalue %13[2] : !llvm<"{ float*, i64, i64 }"> + %22 = llvm.extractvalue %13[2] : !llvm.struct<(ptr, i64, i64)> %23 = llvm.mul %14, %20 : !llvm.i64 %24 = llvm.add %23, %15 : !llvm.i64 %25 = llvm.mul %24, %21 : !llvm.i64 %26 = llvm.add %25, %16 : !llvm.i64 %27 = llvm.mul %26, %22 : !llvm.i64 %28 = llvm.add %27, %17 : !llvm.i64 - %29 = llvm.extractvalue %13[0] : !llvm<"{ float*, i64, i64 }"> - %30 = llvm.getelementptr %29[%28] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - llvm.store %18, %30 : !llvm<"float*"> + %29 = llvm.extractvalue %13[0] : !llvm.struct<(ptr, i64, i64)> + %30 = llvm.getelementptr %29[%28] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + llvm.store %18, %30 : !llvm.ptr // CHECK-NEXT: %{{[0-9]+}} = extractvalue { float*, i64, i64 } %{{[0-9]+}}, 1 // CHECK-NEXT: %{{[0-9]+}} = extractvalue { float*, i64, i64 } %{{[0-9]+}}, 2 // CHECK-NEXT: %{{[0-9]+}} = mul i64 %{{[0-9]+}}, %{{[0-9]+}} @@ -634,24 +634,24 @@ // CHECK-NEXT: %{{[0-9]+}} = getelementptr float, float* %{{[0-9]+}}, i64 %{{[0-9]+}} // CHECK-NEXT: %{{[0-9]+}} = load float, float* %{{[0-9]+}} %31 = llvm.mlir.constant(2 : index) : !llvm.i64 - %32 = llvm.extractvalue %13[1] : !llvm<"{ float*, i64, i64 }"> + %32 = llvm.extractvalue %13[1] : !llvm.struct<(ptr, i64, i64)> %33 = llvm.mlir.constant(4 : index) : !llvm.i64 - %34 = llvm.extractvalue %13[2] : !llvm<"{ float*, i64, i64 }"> + %34 = llvm.extractvalue %13[2] : !llvm.struct<(ptr, i64, i64)> %35 = llvm.mul %17, %32 : !llvm.i64 %36 = llvm.add %35, %16 : !llvm.i64 %37 = llvm.mul %36, %33 : !llvm.i64 %38 = llvm.add %37, %15 : !llvm.i64 %39 = llvm.mul %38, %34 : !llvm.i64 %40 = llvm.add %39, %14 : !llvm.i64 - %41 = llvm.extractvalue %13[0] : !llvm<"{ float*, i64, i64 }"> - %42 = llvm.getelementptr %41[%40] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - %43 = llvm.load %42 : !llvm<"float*"> + %41 = llvm.extractvalue %13[0] : !llvm.struct<(ptr, i64, i64)> + %42 = llvm.getelementptr %41[%40] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + %43 = llvm.load %42 : !llvm.ptr // CHECK-NEXT: ret void llvm.return } // CHECK-LABEL: define { float*, i64 } @memref_args_rets({ float* } {{%.*}}, { float*, i64 } {{%.*}}, { float*, i64 } {{%.*}}) -llvm.func @memref_args_rets(%arg0: !llvm<"{ float* }">, %arg1: !llvm<"{ float*, i64 }">, %arg2: !llvm<"{ float*, i64 }">) -> !llvm<"{ float*, i64 }"> { +llvm.func @memref_args_rets(%arg0: !llvm.struct<(ptr)>, %arg1: !llvm.struct<(ptr, i64)>, %arg2: !llvm.struct<(ptr, i64)>) -> !llvm.struct<(ptr, i64)> { %0 = llvm.mlir.constant(7 : index) : !llvm.i64 // CHECK-NEXT: %{{[0-9]+}} = call i64 @get_index() %1 = llvm.call @get_index() : () -> !llvm.i64 @@ -660,17 +660,17 @@ // CHECK-NEXT: %{{[0-9]+}} = getelementptr float, float* %{{[0-9]+}}, i64 7 // CHECK-NEXT: store float 4.200000e+01, float* %{{[0-9]+}} %3 = llvm.mlir.constant(10 : index) : !llvm.i64 - %4 = llvm.extractvalue %arg0[0] : !llvm<"{ float* }"> - %5 = llvm.getelementptr %4[%0] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - llvm.store %2, %5 : !llvm<"float*"> + %4 = llvm.extractvalue %arg0[0] : !llvm.struct<(ptr)> + %5 = llvm.getelementptr %4[%0] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + llvm.store %2, %5 : !llvm.ptr // CHECK-NEXT: %{{[0-9]+}} = extractvalue { float*, i64 } %{{[0-9]+}}, 1 // CHECK-NEXT: %{{[0-9]+}} = extractvalue { float*, i64 } %{{[0-9]+}}, 0 // CHECK-NEXT: %{{[0-9]+}} = getelementptr float, float* %{{[0-9]+}}, i64 7 // CHECK-NEXT: store float 4.200000e+01, float* %{{[0-9]+}} - %6 = llvm.extractvalue %arg1[1] : !llvm<"{ float*, i64 }"> - %7 = llvm.extractvalue %arg1[0] : !llvm<"{ float*, i64 }"> - %8 = llvm.getelementptr %7[%0] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - llvm.store %2, %8 : !llvm<"float*"> + %6 = llvm.extractvalue %arg1[1] : !llvm.struct<(ptr, i64)> + %7 = llvm.extractvalue %arg1[0] : !llvm.struct<(ptr, i64)> + %8 = llvm.getelementptr %7[%0] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + llvm.store %2, %8 : !llvm.ptr // CHECK-NEXT: %{{[0-9]+}} = extractvalue { float*, i64 } %{{[0-9]+}}, 1 // CHECK-NEXT: %{{[0-9]+}} = mul i64 7, %{{[0-9]+}} // CHECK-NEXT: %{{[0-9]+}} = add i64 %{{[0-9]+}}, %{{[0-9]+}} @@ -678,12 +678,12 @@ // CHECK-NEXT: %{{[0-9]+}} = getelementptr float, float* %{{[0-9]+}}, i64 %{{[0-9]+}} // CHECK-NEXT: store float 4.200000e+01, float* %{{[0-9]+}} %9 = llvm.mlir.constant(10 : index) : !llvm.i64 - %10 = llvm.extractvalue %arg2[1] : !llvm<"{ float*, i64 }"> + %10 = llvm.extractvalue %arg2[1] : !llvm.struct<(ptr, i64)> %11 = llvm.mul %0, %10 : !llvm.i64 %12 = llvm.add %11, %1 : !llvm.i64 - %13 = llvm.extractvalue %arg2[0] : !llvm<"{ float*, i64 }"> - %14 = llvm.getelementptr %13[%12] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - llvm.store %2, %14 : !llvm<"float*"> + %13 = llvm.extractvalue %arg2[0] : !llvm.struct<(ptr, i64)> + %14 = llvm.getelementptr %13[%12] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + llvm.store %2, %14 : !llvm.ptr // CHECK-NEXT: %{{[0-9]+}} = mul i64 10, %{{[0-9]+}} // CHECK-NEXT: %{{[0-9]+}} = mul i64 %{{[0-9]+}}, 4 // CHECK-NEXT: %{{[0-9]+}} = call i8* @malloc(i64 %{{[0-9]+}}) @@ -692,28 +692,28 @@ // CHECK-NEXT: %{{[0-9]+}} = insertvalue { float*, i64 } %{{[0-9]+}}, i64 %{{[0-9]+}}, 1 %15 = llvm.mlir.constant(10 : index) : !llvm.i64 %16 = llvm.mul %15, %1 : !llvm.i64 - %17 = llvm.mlir.undef : !llvm<"{ float*, i64 }"> + %17 = llvm.mlir.undef : !llvm.struct<(ptr, i64)> %18 = llvm.mlir.constant(4 : index) : !llvm.i64 %19 = llvm.mul %16, %18 : !llvm.i64 - %20 = llvm.call @malloc(%19) : (!llvm.i64) -> !llvm<"i8*"> - %21 = llvm.bitcast %20 : !llvm<"i8*"> to !llvm<"float*"> - %22 = llvm.insertvalue %21, %17[0] : !llvm<"{ float*, i64 }"> - %23 = llvm.insertvalue %1, %22[1] : !llvm<"{ float*, i64 }"> + %20 = llvm.call @malloc(%19) : (!llvm.i64) -> !llvm.ptr + %21 = llvm.bitcast %20 : !llvm.ptr to !llvm.ptr + %22 = llvm.insertvalue %21, %17[0] : !llvm.struct<(ptr, i64)> + %23 = llvm.insertvalue %1, %22[1] : !llvm.struct<(ptr, i64)> // CHECK-NEXT: ret { float*, i64 } %{{[0-9]+}} - llvm.return %23 : !llvm<"{ float*, i64 }"> + llvm.return %23 : !llvm.struct<(ptr, i64)> } // CHECK-LABEL: define i64 @memref_dim({ float*, i64, i64 } {{%.*}}) -llvm.func @memref_dim(%arg0: !llvm<"{ float*, i64, i64 }">) -> !llvm.i64 { +llvm.func @memref_dim(%arg0: !llvm.struct<(ptr, i64, i64)>) -> !llvm.i64 { // Expecting this to create an LLVM constant. %0 = llvm.mlir.constant(42 : index) : !llvm.i64 // CHECK-NEXT: %2 = extractvalue { float*, i64, i64 } %0, 1 - %1 = llvm.extractvalue %arg0[1] : !llvm<"{ float*, i64, i64 }"> + %1 = llvm.extractvalue %arg0[1] : !llvm.struct<(ptr, i64, i64)> // Expecting this to create an LLVM constant. %2 = llvm.mlir.constant(10 : index) : !llvm.i64 // CHECK-NEXT: %3 = extractvalue { float*, i64, i64 } %0, 2 - %3 = llvm.extractvalue %arg0[2] : !llvm<"{ float*, i64, i64 }"> + %3 = llvm.extractvalue %arg0[2] : !llvm.struct<(ptr, i64, i64)> // Checking that the constant for d0 has been created. // CHECK-NEXT: %4 = add i64 42, %2 %4 = llvm.add %0, %1 : !llvm.i64 @@ -728,22 +728,22 @@ llvm.func @get_i64() -> !llvm.i64 llvm.func @get_f32() -> !llvm.float -llvm.func @get_memref() -> !llvm<"{ float*, i64, i64 }"> +llvm.func @get_memref() -> !llvm.struct<(ptr, i64, i64)> // CHECK-LABEL: define { i64, float, { float*, i64, i64 } } @multireturn() -llvm.func @multireturn() -> !llvm<"{ i64, float, { float*, i64, i64 } }"> { +llvm.func @multireturn() -> !llvm.struct<(i64, float, struct<(ptr, i64, i64)>)> { %0 = llvm.call @get_i64() : () -> !llvm.i64 %1 = llvm.call @get_f32() : () -> !llvm.float - %2 = llvm.call @get_memref() : () -> !llvm<"{ float*, i64, i64 }"> + %2 = llvm.call @get_memref() : () -> !llvm.struct<(ptr, i64, i64)> // CHECK: %{{[0-9]+}} = insertvalue { i64, float, { float*, i64, i64 } } undef, i64 %{{[0-9]+}}, 0 // CHECK-NEXT: %{{[0-9]+}} = insertvalue { i64, float, { float*, i64, i64 } } %{{[0-9]+}}, float %{{[0-9]+}}, 1 // CHECK-NEXT: %{{[0-9]+}} = insertvalue { i64, float, { float*, i64, i64 } } %{{[0-9]+}}, { float*, i64, i64 } %{{[0-9]+}}, 2 // CHECK-NEXT: ret { i64, float, { float*, i64, i64 } } %{{[0-9]+}} - %3 = llvm.mlir.undef : !llvm<"{ i64, float, { float*, i64, i64 } }"> - %4 = llvm.insertvalue %0, %3[0] : !llvm<"{ i64, float, { float*, i64, i64 } }"> - %5 = llvm.insertvalue %1, %4[1] : !llvm<"{ i64, float, { float*, i64, i64 } }"> - %6 = llvm.insertvalue %2, %5[2] : !llvm<"{ i64, float, { float*, i64, i64 } }"> - llvm.return %6 : !llvm<"{ i64, float, { float*, i64, i64 } }"> + %3 = llvm.mlir.undef : !llvm.struct<(i64, float, struct<(ptr, i64, i64)>)> + %4 = llvm.insertvalue %0, %3[0] : !llvm.struct<(i64, float, struct<(ptr, i64, i64)>)> + %5 = llvm.insertvalue %1, %4[1] : !llvm.struct<(i64, float, struct<(ptr, i64, i64)>)> + %6 = llvm.insertvalue %2, %5[2] : !llvm.struct<(i64, float, struct<(ptr, i64, i64)>)> + llvm.return %6 : !llvm.struct<(i64, float, struct<(ptr, i64, i64)>)> } @@ -753,10 +753,10 @@ // CHECK-NEXT: [[ret0:%[0-9]+]] = extractvalue { i64, float, { float*, i64, i64 } } %1, 0 // CHECK-NEXT: [[ret1:%[0-9]+]] = extractvalue { i64, float, { float*, i64, i64 } } %1, 1 // CHECK-NEXT: [[ret2:%[0-9]+]] = extractvalue { i64, float, { float*, i64, i64 } } %1, 2 - %0 = llvm.call @multireturn() : () -> !llvm<"{ i64, float, { float*, i64, i64 } }"> - %1 = llvm.extractvalue %0[0] : !llvm<"{ i64, float, { float*, i64, i64 } }"> - %2 = llvm.extractvalue %0[1] : !llvm<"{ i64, float, { float*, i64, i64 } }"> - %3 = llvm.extractvalue %0[2] : !llvm<"{ i64, float, { float*, i64, i64 } }"> + %0 = llvm.call @multireturn() : () -> !llvm.struct<(i64, float, struct<(ptr, i64, i64)>)> + %1 = llvm.extractvalue %0[0] : !llvm.struct<(i64, float, struct<(ptr, i64, i64)>)> + %2 = llvm.extractvalue %0[1] : !llvm.struct<(i64, float, struct<(ptr, i64, i64)>)> + %3 = llvm.extractvalue %0[2] : !llvm.struct<(i64, float, struct<(ptr, i64, i64)>)> %4 = llvm.mlir.constant(42) : !llvm.i64 // CHECK: add i64 [[ret0]], 42 %5 = llvm.add %1, %4 : !llvm.i64 @@ -766,86 +766,86 @@ %8 = llvm.mlir.constant(0 : index) : !llvm.i64 %9 = llvm.mlir.constant(42 : index) : !llvm.i64 // CHECK: extractvalue { float*, i64, i64 } [[ret2]], 0 - %10 = llvm.extractvalue %3[1] : !llvm<"{ float*, i64, i64 }"> + %10 = llvm.extractvalue %3[1] : !llvm.struct<(ptr, i64, i64)> %11 = llvm.mlir.constant(10 : index) : !llvm.i64 - %12 = llvm.extractvalue %3[2] : !llvm<"{ float*, i64, i64 }"> + %12 = llvm.extractvalue %3[2] : !llvm.struct<(ptr, i64, i64)> %13 = llvm.mul %8, %10 : !llvm.i64 %14 = llvm.add %13, %8 : !llvm.i64 %15 = llvm.mul %14, %11 : !llvm.i64 %16 = llvm.add %15, %8 : !llvm.i64 %17 = llvm.mul %16, %12 : !llvm.i64 %18 = llvm.add %17, %8 : !llvm.i64 - %19 = llvm.extractvalue %3[0] : !llvm<"{ float*, i64, i64 }"> - %20 = llvm.getelementptr %19[%18] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - %21 = llvm.load %20 : !llvm<"float*"> + %19 = llvm.extractvalue %3[0] : !llvm.struct<(ptr, i64, i64)> + %20 = llvm.getelementptr %19[%18] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + %21 = llvm.load %20 : !llvm.ptr llvm.return } // CHECK-LABEL: define <4 x float> @vector_ops(<4 x float> {{%.*}}, <4 x i1> {{%.*}}, <4 x i64> {{%.*}}) -llvm.func @vector_ops(%arg0: !llvm<"<4 x float>">, %arg1: !llvm<"<4 x i1>">, %arg2: !llvm<"<4 x i64>">) -> !llvm<"<4 x float>"> { - %0 = llvm.mlir.constant(dense<4.200000e+01> : vector<4xf32>) : !llvm<"<4 x float>"> +llvm.func @vector_ops(%arg0: !llvm.vec<4 x float>, %arg1: !llvm.vec<4 x i1>, %arg2: !llvm.vec<4 x i64>) -> !llvm.vec<4 x float> { + %0 = llvm.mlir.constant(dense<4.200000e+01> : vector<4xf32>) : !llvm.vec<4 x float> // CHECK-NEXT: %4 = fadd <4 x float> %0, - %1 = llvm.fadd %arg0, %0 : !llvm<"<4 x float>"> + %1 = llvm.fadd %arg0, %0 : !llvm.vec<4 x float> // CHECK-NEXT: %5 = select <4 x i1> %1, <4 x float> %4, <4 x float> %0 - %2 = llvm.select %arg1, %1, %arg0 : !llvm<"<4 x i1>">, !llvm<"<4 x float>"> + %2 = llvm.select %arg1, %1, %arg0 : !llvm.vec<4 x i1>, !llvm.vec<4 x float> // CHECK-NEXT: %6 = sdiv <4 x i64> %2, %2 - %3 = llvm.sdiv %arg2, %arg2 : !llvm<"<4 x i64>"> + %3 = llvm.sdiv %arg2, %arg2 : !llvm.vec<4 x i64> // CHECK-NEXT: %7 = udiv <4 x i64> %2, %2 - %4 = llvm.udiv %arg2, %arg2 : !llvm<"<4 x i64>"> + %4 = llvm.udiv %arg2, %arg2 : !llvm.vec<4 x i64> // CHECK-NEXT: %8 = srem <4 x i64> %2, %2 - %5 = llvm.srem %arg2, %arg2 : !llvm<"<4 x i64>"> + %5 = llvm.srem %arg2, %arg2 : !llvm.vec<4 x i64> // CHECK-NEXT: %9 = urem <4 x i64> %2, %2 - %6 = llvm.urem %arg2, %arg2 : !llvm<"<4 x i64>"> + %6 = llvm.urem %arg2, %arg2 : !llvm.vec<4 x i64> // CHECK-NEXT: %10 = fdiv <4 x float> %0, - %7 = llvm.fdiv %arg0, %0 : !llvm<"<4 x float>"> + %7 = llvm.fdiv %arg0, %0 : !llvm.vec<4 x float> // CHECK-NEXT: %11 = frem <4 x float> %0, - %8 = llvm.frem %arg0, %0 : !llvm<"<4 x float>"> + %8 = llvm.frem %arg0, %0 : !llvm.vec<4 x float> // CHECK-NEXT: %12 = and <4 x i64> %2, %2 - %9 = llvm.and %arg2, %arg2 : !llvm<"<4 x i64>"> + %9 = llvm.and %arg2, %arg2 : !llvm.vec<4 x i64> // CHECK-NEXT: %13 = or <4 x i64> %2, %2 - %10 = llvm.or %arg2, %arg2 : !llvm<"<4 x i64>"> + %10 = llvm.or %arg2, %arg2 : !llvm.vec<4 x i64> // CHECK-NEXT: %14 = xor <4 x i64> %2, %2 - %11 = llvm.xor %arg2, %arg2 : !llvm<"<4 x i64>"> + %11 = llvm.xor %arg2, %arg2 : !llvm.vec<4 x i64> // CHECK-NEXT: %15 = shl <4 x i64> %2, %2 - %12 = llvm.shl %arg2, %arg2 : !llvm<"<4 x i64>"> + %12 = llvm.shl %arg2, %arg2 : !llvm.vec<4 x i64> // CHECK-NEXT: %16 = lshr <4 x i64> %2, %2 - %13 = llvm.lshr %arg2, %arg2 : !llvm<"<4 x i64>"> + %13 = llvm.lshr %arg2, %arg2 : !llvm.vec<4 x i64> // CHECK-NEXT: %17 = ashr <4 x i64> %2, %2 - %14 = llvm.ashr %arg2, %arg2 : !llvm<"<4 x i64>"> + %14 = llvm.ashr %arg2, %arg2 : !llvm.vec<4 x i64> // CHECK-NEXT: ret <4 x float> %4 - llvm.return %1 : !llvm<"<4 x float>"> + llvm.return %1 : !llvm.vec<4 x float> } // CHECK-LABEL: @vector_splat_1d -llvm.func @vector_splat_1d() -> !llvm<"<4 x float>"> { +llvm.func @vector_splat_1d() -> !llvm.vec<4 x float> { // CHECK: ret <4 x float> zeroinitializer - %0 = llvm.mlir.constant(dense<0.000000e+00> : vector<4xf32>) : !llvm<"<4 x float>"> - llvm.return %0 : !llvm<"<4 x float>"> + %0 = llvm.mlir.constant(dense<0.000000e+00> : vector<4xf32>) : !llvm.vec<4 x float> + llvm.return %0 : !llvm.vec<4 x float> } // CHECK-LABEL: @vector_splat_2d -llvm.func @vector_splat_2d() -> !llvm<"[4 x <16 x float>]"> { +llvm.func @vector_splat_2d() -> !llvm.array<4 x vec<16 x float>> { // CHECK: ret [4 x <16 x float>] zeroinitializer - %0 = llvm.mlir.constant(dense<0.000000e+00> : vector<4x16xf32>) : !llvm<"[4 x <16 x float>]"> - llvm.return %0 : !llvm<"[4 x <16 x float>]"> + %0 = llvm.mlir.constant(dense<0.000000e+00> : vector<4x16xf32>) : !llvm.array<4 x vec<16 x float>> + llvm.return %0 : !llvm.array<4 x vec<16 x float>> } // CHECK-LABEL: @vector_splat_3d -llvm.func @vector_splat_3d() -> !llvm<"[4 x [16 x <4 x float>]]"> { +llvm.func @vector_splat_3d() -> !llvm.array<4 x array<16 x vec<4 x float>>> { // CHECK: ret [4 x [16 x <4 x float>]] zeroinitializer - %0 = llvm.mlir.constant(dense<0.000000e+00> : vector<4x16x4xf32>) : !llvm<"[4 x [16 x <4 x float>]]"> - llvm.return %0 : !llvm<"[4 x [16 x <4 x float>]]"> + %0 = llvm.mlir.constant(dense<0.000000e+00> : vector<4x16x4xf32>) : !llvm.array<4 x array<16 x vec<4 x float>>> + llvm.return %0 : !llvm.array<4 x array<16 x vec<4 x float>>> } // CHECK-LABEL: @vector_splat_nonzero -llvm.func @vector_splat_nonzero() -> !llvm<"<4 x float>"> { +llvm.func @vector_splat_nonzero() -> !llvm.vec<4 x float> { // CHECK: ret <4 x float> - %0 = llvm.mlir.constant(dense<1.000000e+00> : vector<4xf32>) : !llvm<"<4 x float>"> - llvm.return %0 : !llvm<"<4 x float>"> + %0 = llvm.mlir.constant(dense<1.000000e+00> : vector<4xf32>) : !llvm.vec<4 x float> + llvm.return %0 : !llvm.vec<4 x float> } // CHECK-LABEL: @ops -llvm.func @ops(%arg0: !llvm.float, %arg1: !llvm.float, %arg2: !llvm.i32, %arg3: !llvm.i32) -> !llvm<"{ float, i32 }"> { +llvm.func @ops(%arg0: !llvm.float, %arg1: !llvm.float, %arg2: !llvm.i32, %arg3: !llvm.i32) -> !llvm.struct<(float, i32)> { // CHECK-NEXT: fsub float %0, %1 %0 = llvm.fsub %arg0, %arg1 : !llvm.float // CHECK-NEXT: %6 = sub i32 %2, %3 @@ -863,9 +863,9 @@ // CHECK-NEXT: %12 = urem i32 %2, %3 %7 = llvm.urem %arg2, %arg3 : !llvm.i32 - %8 = llvm.mlir.undef : !llvm<"{ float, i32 }"> - %9 = llvm.insertvalue %0, %8[0] : !llvm<"{ float, i32 }"> - %10 = llvm.insertvalue %3, %9[1] : !llvm<"{ float, i32 }"> + %8 = llvm.mlir.undef : !llvm.struct<(float, i32)> + %9 = llvm.insertvalue %0, %8[0] : !llvm.struct<(float, i32)> + %10 = llvm.insertvalue %3, %9[1] : !llvm.struct<(float, i32)> // CHECK: %15 = fdiv float %0, %1 %11 = llvm.fdiv %arg0, %arg1 : !llvm.float @@ -888,7 +888,7 @@ // CHECK-NEXT: fneg float %0 %19 = llvm.fneg %arg0 : !llvm.float - llvm.return %10 : !llvm<"{ float, i32 }"> + llvm.return %10 : !llvm.struct<(float, i32)> } // @@ -898,14 +898,14 @@ // CHECK-LABEL: define void @indirect_const_call(i64 {{%.*}}) llvm.func @indirect_const_call(%arg0: !llvm.i64) { // CHECK-NEXT: call void @body(i64 %0) - %0 = llvm.mlir.addressof @body : !llvm<"void (i64)*"> + %0 = llvm.mlir.addressof @body : !llvm.ptr> llvm.call %0(%arg0) : (!llvm.i64) -> () // CHECK-NEXT: ret void llvm.return } // CHECK-LABEL: define i32 @indirect_call(i32 (float)* {{%.*}}, float {{%.*}}) -llvm.func @indirect_call(%arg0: !llvm<"i32 (float)*">, %arg1: !llvm.float) -> !llvm.i32 { +llvm.func @indirect_call(%arg0: !llvm.ptr>, %arg1: !llvm.float) -> !llvm.i32 { // CHECK-NEXT: %3 = call i32 %0(float %1) %0 = llvm.call %arg0(%arg1) : (!llvm.float) -> !llvm.i32 // CHECK-NEXT: ret i32 %3 @@ -935,12 +935,12 @@ } // CHECK-LABEL: define void @llvm_noalias(float* noalias {{%*.}}) -llvm.func @llvm_noalias(%arg0: !llvm<"float*"> {llvm.noalias = true}) { +llvm.func @llvm_noalias(%arg0: !llvm.ptr {llvm.noalias = true}) { llvm.return } // CHECK-LABEL: define void @llvm_align(float* align 4 {{%*.}}) -llvm.func @llvm_align(%arg0: !llvm<"float*"> {llvm.align = 4}) { +llvm.func @llvm_align(%arg0: !llvm.ptr {llvm.align = 4}) { llvm.return } @@ -950,8 +950,8 @@ llvm.func @intpointerconversion(%arg0 : !llvm.i32) -> !llvm.i32 { // CHECK: %2 = inttoptr i32 %0 to i32* // CHECK-NEXT: %3 = ptrtoint i32* %2 to i32 - %1 = llvm.inttoptr %arg0 : !llvm.i32 to !llvm<"i32*"> - %2 = llvm.ptrtoint %1 : !llvm<"i32*"> to !llvm.i32 + %1 = llvm.inttoptr %arg0 : !llvm.i32 to !llvm.ptr + %2 = llvm.ptrtoint %1 : !llvm.ptr to !llvm.i32 llvm.return %2 : !llvm.i32 } @@ -968,16 +968,16 @@ } // CHECK-LABEL: @addrspace -llvm.func @addrspace(%arg0 : !llvm<"i32*">) -> !llvm<"i32 addrspace(2)*"> { +llvm.func @addrspace(%arg0 : !llvm.ptr) -> !llvm.ptr { // CHECK: %2 = addrspacecast i32* %0 to i32 addrspace(2)* - %1 = llvm.addrspacecast %arg0 : !llvm<"i32*"> to !llvm<"i32 addrspace(2)*"> - llvm.return %1 : !llvm<"i32 addrspace(2)*"> + %1 = llvm.addrspacecast %arg0 : !llvm.ptr to !llvm.ptr + llvm.return %1 : !llvm.ptr } -llvm.func @stringconstant() -> !llvm<"i8*"> { - %1 = llvm.mlir.constant("Hello world!") : !llvm<"i8*"> +llvm.func @stringconstant() -> !llvm.ptr { + %1 = llvm.mlir.constant("Hello world!") : !llvm.ptr // CHECK: ret [12 x i8] c"Hello world!" - llvm.return %1 : !llvm<"i8*"> + llvm.return %1 : !llvm.ptr } llvm.func @noreach() { @@ -1019,22 +1019,22 @@ } // CHECK-LABEL: @vect -llvm.func @vect(%arg0: !llvm<"<4 x float>">, %arg1: !llvm.i32, %arg2: !llvm.float) { +llvm.func @vect(%arg0: !llvm.vec<4 x float>, %arg1: !llvm.i32, %arg2: !llvm.float) { // CHECK-NEXT: extractelement <4 x float> {{.*}}, i32 // CHECK-NEXT: insertelement <4 x float> {{.*}}, float %2, i32 // CHECK-NEXT: shufflevector <4 x float> {{.*}}, <4 x float> {{.*}}, <5 x i32> - %0 = llvm.extractelement %arg0[%arg1 : !llvm.i32] : !llvm<"<4 x float>"> - %1 = llvm.insertelement %arg2, %arg0[%arg1 : !llvm.i32] : !llvm<"<4 x float>"> - %2 = llvm.shufflevector %arg0, %arg0 [0 : i32, 0 : i32, 0 : i32, 0 : i32, 7 : i32] : !llvm<"<4 x float>">, !llvm<"<4 x float>"> + %0 = llvm.extractelement %arg0[%arg1 : !llvm.i32] : !llvm.vec<4 x float> + %1 = llvm.insertelement %arg2, %arg0[%arg1 : !llvm.i32] : !llvm.vec<4 x float> + %2 = llvm.shufflevector %arg0, %arg0 [0 : i32, 0 : i32, 0 : i32, 0 : i32, 7 : i32] : !llvm.vec<4 x float>, !llvm.vec<4 x float> llvm.return } // CHECK-LABEL: @vect_i64idx -llvm.func @vect_i64idx(%arg0: !llvm<"<4 x float>">, %arg1: !llvm.i64, %arg2: !llvm.float) { +llvm.func @vect_i64idx(%arg0: !llvm.vec<4 x float>, %arg1: !llvm.i64, %arg2: !llvm.float) { // CHECK-NEXT: extractelement <4 x float> {{.*}}, i64 // CHECK-NEXT: insertelement <4 x float> {{.*}}, float %2, i64 - %0 = llvm.extractelement %arg0[%arg1 : !llvm.i64] : !llvm<"<4 x float>"> - %1 = llvm.insertelement %arg2, %arg0[%arg1 : !llvm.i64] : !llvm<"<4 x float>"> + %0 = llvm.extractelement %arg0[%arg1 : !llvm.i64] : !llvm.vec<4 x float> + %1 = llvm.insertelement %arg2, %arg0[%arg1 : !llvm.i64] : !llvm.vec<4 x float> llvm.return } @@ -1043,27 +1043,27 @@ // Alignment automatically set by the LLVM IR builder when alignment attribute // is 0. // CHECK: alloca {{.*}} align 4 - llvm.alloca %size x !llvm.i32 {alignment = 0} : (!llvm.i64) -> (!llvm<"i32*">) + llvm.alloca %size x !llvm.i32 {alignment = 0} : (!llvm.i64) -> (!llvm.ptr) // CHECK-NEXT: alloca {{.*}} align 8 - llvm.alloca %size x !llvm.i32 {alignment = 8} : (!llvm.i64) -> (!llvm<"i32*">) + llvm.alloca %size x !llvm.i32 {alignment = 8} : (!llvm.i64) -> (!llvm.ptr) llvm.return } // CHECK-LABEL: @constants -llvm.func @constants() -> !llvm<"<4 x float>"> { +llvm.func @constants() -> !llvm.vec<4 x float> { // CHECK: ret <4 x float> - %0 = llvm.mlir.constant(sparse<[[0]], [4.2e+01]> : vector<4xf32>) : !llvm<"<4 x float>"> - llvm.return %0 : !llvm<"<4 x float>"> + %0 = llvm.mlir.constant(sparse<[[0]], [4.2e+01]> : vector<4xf32>) : !llvm.vec<4 x float> + llvm.return %0 : !llvm.vec<4 x float> } // CHECK-LABEL: @fp_casts -llvm.func @fp_casts(%fp1 : !llvm<"float">, %fp2 : !llvm<"double">) -> !llvm.i16 { +llvm.func @fp_casts(%fp1 : !llvm.float, %fp2 : !llvm.double) -> !llvm.i16 { // CHECK: fptrunc double {{.*}} to float - %a = llvm.fptrunc %fp2 : !llvm<"double"> to !llvm<"float"> + %a = llvm.fptrunc %fp2 : !llvm.double to !llvm.float // CHECK: fpext float {{.*}} to double - %b = llvm.fpext %fp1 : !llvm<"float"> to !llvm<"double"> + %b = llvm.fpext %fp1 : !llvm.float to !llvm.double // CHECK: fptosi double {{.*}} to i16 - %c = llvm.fptosi %b : !llvm<"double"> to !llvm.i16 + %c = llvm.fptosi %b : !llvm.double to !llvm.i16 llvm.return %c : !llvm.i16 } @@ -1080,35 +1080,35 @@ // Check that the auxiliary `null` operation is converted into a `null` value. // CHECK-LABEL: @null -llvm.func @null() -> !llvm<"i32*"> { - %0 = llvm.mlir.null : !llvm<"i32*"> +llvm.func @null() -> !llvm.ptr { + %0 = llvm.mlir.null : !llvm.ptr // CHECK: ret i32* null - llvm.return %0 : !llvm<"i32*"> + llvm.return %0 : !llvm.ptr } // Check that dense elements attributes are exported properly in constants. // CHECK-LABEL: @elements_constant_3d_vector -llvm.func @elements_constant_3d_vector() -> !llvm<"[2 x [2 x <2 x i32>]]"> { +llvm.func @elements_constant_3d_vector() -> !llvm.array<2 x array<2 x vec<2 x i32>>> { // CHECK: ret [2 x [2 x <2 x i32>]] // CHECK-SAME: {{\[}}[2 x <2 x i32>] [<2 x i32> , <2 x i32> ], // CHECK-SAME: [2 x <2 x i32>] [<2 x i32> , <2 x i32> ]] - %0 = llvm.mlir.constant(dense<[[[1, 2], [3, 4]], [[42, 43], [44, 45]]]> : vector<2x2x2xi32>) : !llvm<"[2 x [2 x <2 x i32>]]"> - llvm.return %0 : !llvm<"[2 x [2 x <2 x i32>]]"> + %0 = llvm.mlir.constant(dense<[[[1, 2], [3, 4]], [[42, 43], [44, 45]]]> : vector<2x2x2xi32>) : !llvm.array<2 x array<2 x vec<2 x i32>>> + llvm.return %0 : !llvm.array<2 x array<2 x vec<2 x i32>>> } // CHECK-LABEL: @elements_constant_3d_array -llvm.func @elements_constant_3d_array() -> !llvm<"[2 x [2 x [2 x i32]]]"> { +llvm.func @elements_constant_3d_array() -> !llvm.array<2 x array<2 x array<2 x i32>>> { // CHECK: ret [2 x [2 x [2 x i32]]] // CHECK-SAME: {{\[}}[2 x [2 x i32]] {{\[}}[2 x i32] [i32 1, i32 2], [2 x i32] [i32 3, i32 4]], // CHECK-SAME: [2 x [2 x i32]] {{\[}}[2 x i32] [i32 42, i32 43], [2 x i32] [i32 44, i32 45]]] - %0 = llvm.mlir.constant(dense<[[[1, 2], [3, 4]], [[42, 43], [44, 45]]]> : tensor<2x2x2xi32>) : !llvm<"[2 x [2 x [2 x i32]]]"> - llvm.return %0 : !llvm<"[2 x [2 x [2 x i32]]]"> + %0 = llvm.mlir.constant(dense<[[[1, 2], [3, 4]], [[42, 43], [44, 45]]]> : tensor<2x2x2xi32>) : !llvm.array<2 x array<2 x array<2 x i32>>> + llvm.return %0 : !llvm.array<2 x array<2 x array<2 x i32>>> } // CHECK-LABEL: @atomicrmw llvm.func @atomicrmw( - %f32_ptr : !llvm<"float*">, %f32 : !llvm.float, - %i32_ptr : !llvm<"i32*">, %i32 : !llvm.i32) { + %f32_ptr : !llvm.ptr, %f32 : !llvm.float, + %i32_ptr : !llvm.ptr, %i32 : !llvm.i32) { // CHECK: atomicrmw fadd float* %{{.*}}, float %{{.*}} unordered %0 = llvm.atomicrmw fadd %f32_ptr, %f32 unordered : !llvm.float // CHECK: atomicrmw fsub float* %{{.*}}, float %{{.*}} unordered @@ -1139,34 +1139,34 @@ } // CHECK-LABEL: @cmpxchg -llvm.func @cmpxchg(%ptr : !llvm<"float*">, %cmp : !llvm.float, %val: !llvm.float) { +llvm.func @cmpxchg(%ptr : !llvm.ptr, %cmp : !llvm.float, %val: !llvm.float) { // CHECK: cmpxchg float* %{{.*}}, float %{{.*}}, float %{{.*}} acq_rel monotonic %0 = llvm.cmpxchg %ptr, %cmp, %val acq_rel monotonic : !llvm.float // CHECK: %{{[0-9]+}} = extractvalue { float, i1 } %{{[0-9]+}}, 0 - %1 = llvm.extractvalue %0[0] : !llvm<"{ float, i1 }"> + %1 = llvm.extractvalue %0[0] : !llvm.struct<(float, i1)> // CHECK: %{{[0-9]+}} = extractvalue { float, i1 } %{{[0-9]+}}, 1 - %2 = llvm.extractvalue %0[1] : !llvm<"{ float, i1 }"> + %2 = llvm.extractvalue %0[1] : !llvm.struct<(float, i1)> llvm.return } -llvm.mlir.global external constant @_ZTIi() : !llvm<"i8*"> -llvm.func @foo(!llvm<"i8*">) -llvm.func @bar(!llvm<"i8*">) -> !llvm<"i8*"> +llvm.mlir.global external constant @_ZTIi() : !llvm.ptr +llvm.func @foo(!llvm.ptr) +llvm.func @bar(!llvm.ptr) -> !llvm.ptr llvm.func @__gxx_personality_v0(...) -> !llvm.i32 // CHECK-LABEL: @invokeLandingpad llvm.func @invokeLandingpad() -> !llvm.i32 attributes { personality = @__gxx_personality_v0 } { // CHECK: %[[a1:[0-9]+]] = alloca i8 %0 = llvm.mlir.constant(0 : i32) : !llvm.i32 - %1 = llvm.mlir.constant("\01") : !llvm<"[1 x i8]"> - %2 = llvm.mlir.addressof @_ZTIi : !llvm<"i8**"> - %3 = llvm.bitcast %2 : !llvm<"i8**"> to !llvm<"i8*"> - %4 = llvm.mlir.null : !llvm<"i8**"> + %1 = llvm.mlir.constant("\01") : !llvm.array<1 x i8> + %2 = llvm.mlir.addressof @_ZTIi : !llvm.ptr> + %3 = llvm.bitcast %2 : !llvm.ptr> to !llvm.ptr + %4 = llvm.mlir.null : !llvm.ptr> %5 = llvm.mlir.constant(1 : i32) : !llvm.i32 - %6 = llvm.alloca %5 x !llvm.i8 : (!llvm.i32) -> !llvm<"i8*"> + %6 = llvm.alloca %5 x !llvm.i8 : (!llvm.i32) -> !llvm.ptr // CHECK: invoke void @foo(i8* %[[a1]]) // CHECK-NEXT: to label %[[normal:[0-9]+]] unwind label %[[unwind:[0-9]+]] - llvm.invoke @foo(%6) to ^bb2 unwind ^bb1 : (!llvm<"i8*">) -> () + llvm.invoke @foo(%6) to ^bb2 unwind ^bb1 : (!llvm.ptr) -> () // CHECK: [[unwind]]: ^bb1: @@ -1174,7 +1174,7 @@ // CHECK-NEXT: catch i8** null // CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*) // CHECK-NEXT: filter [1 x i8] c"\01" - %7 = llvm.landingpad (catch %4 : !llvm<"i8**">) (catch %3 : !llvm<"i8*">) (filter %1 : !llvm<"[1 x i8]">) : !llvm<"{ i8*, i32 }"> + %7 = llvm.landingpad (catch %4 : !llvm.ptr>) (catch %3 : !llvm.ptr) (filter %1 : !llvm.array<1 x i8>) : !llvm.struct<(ptr, i32)> // CHECK: br label %[[final:[0-9]+]] llvm.br ^bb3 @@ -1187,7 +1187,7 @@ // CHECK-NEXT: %{{[0-9]+}} = invoke i8* @bar(i8* %[[a1]]) // CHECK-NEXT: to label %[[normal]] unwind label %[[unwind]] ^bb3: // pred: ^bb1 - %8 = llvm.invoke @bar(%6) to ^bb2 unwind ^bb1 : (!llvm<"i8*">) -> !llvm<"i8*"> + %8 = llvm.invoke @bar(%6) to ^bb2 unwind ^bb1 : (!llvm.ptr) -> !llvm.ptr } // CHECK-LABEL: @callFreezeOp @@ -1235,9 +1235,9 @@ // ----- // CHECK-LABEL: @constant_bf16 -llvm.func @constant_bf16() -> !llvm<"bfloat"> { - %0 = llvm.mlir.constant(1.000000e+01 : bf16) : !llvm<"bfloat"> - llvm.return %0 : !llvm<"bfloat"> +llvm.func @constant_bf16() -> !llvm.bfloat { + %0 = llvm.mlir.constant(1.000000e+01 : bf16) : !llvm.bfloat + llvm.return %0 : !llvm.bfloat } // CHECK: ret bfloat 0xR4120 @@ -1248,9 +1248,9 @@ llvm.return } -llvm.mlir.global internal constant @taker_of_address() : !llvm<"void()*"> { - %0 = llvm.mlir.addressof @address_taken : !llvm<"void()*"> - llvm.return %0 : !llvm<"void()*"> +llvm.mlir.global internal constant @taker_of_address() : !llvm.ptr> { + %0 = llvm.mlir.addressof @address_taken : !llvm.ptr> + llvm.return %0 : !llvm.ptr> } // ----- @@ -1272,11 +1272,11 @@ llvm.func @volatile_store_and_load() { %val = llvm.mlir.constant(5 : i32) : !llvm.i32 %size = llvm.mlir.constant(1 : i64) : !llvm.i64 - %0 = llvm.alloca %size x !llvm.i32 : (!llvm.i64) -> (!llvm<"i32*">) + %0 = llvm.alloca %size x !llvm.i32 : (!llvm.i64) -> (!llvm.ptr) // CHECK: store volatile i32 5, i32* %{{.*}} - llvm.store volatile %val, %0 : !llvm<"i32*"> + llvm.store volatile %val, %0 : !llvm.ptr // CHECK: %{{.*}} = load volatile i32, i32* %{{.*}} - %1 = llvm.load volatile %0: !llvm<"i32*"> + %1 = llvm.load volatile %0: !llvm.ptr llvm.return } @@ -1286,11 +1286,11 @@ llvm.func @nontemoral_store_and_load() { %val = llvm.mlir.constant(5 : i32) : !llvm.i32 %size = llvm.mlir.constant(1 : i64) : !llvm.i64 - %0 = llvm.alloca %size x !llvm.i32 : (!llvm.i64) -> (!llvm<"i32*">) + %0 = llvm.alloca %size x !llvm.i32 : (!llvm.i64) -> (!llvm.ptr) // CHECK: !nontemporal ![[NODE:[0-9]+]] - llvm.store %val, %0 {nontemporal} : !llvm<"i32*"> + llvm.store %val, %0 {nontemporal} : !llvm.ptr // CHECK: !nontemporal ![[NODE]] - %1 = llvm.load %0 {nontemporal} : !llvm<"i32*"> + %1 = llvm.load %0 {nontemporal} : !llvm.ptr llvm.return } diff --git a/mlir/test/Target/nvvmir.mlir b/mlir/test/Target/nvvmir.mlir --- a/mlir/test/Target/nvvmir.mlir +++ b/mlir/test/Target/nvvmir.mlir @@ -50,12 +50,12 @@ llvm.func @nvvm_shfl_pred( %0 : !llvm.i32, %1 : !llvm.i32, %2 : !llvm.i32, - %3 : !llvm.i32, %4 : !llvm.float) -> !llvm<"{ i32, i1 }"> { + %3 : !llvm.i32, %4 : !llvm.float) -> !llvm.struct<(i32, i1)> { // CHECK: call { i32, i1 } @llvm.nvvm.shfl.sync.bfly.i32p(i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) - %6 = nvvm.shfl.sync.bfly %0, %3, %1, %2 {return_value_and_is_valid} : !llvm<"{ i32, i1 }"> + %6 = nvvm.shfl.sync.bfly %0, %3, %1, %2 {return_value_and_is_valid} : !llvm.struct<(i32, i1)> // CHECK: call { float, i1 } @llvm.nvvm.shfl.sync.bfly.f32p(i32 %{{.*}}, float %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) - %7 = nvvm.shfl.sync.bfly %0, %4, %1, %2 {return_value_and_is_valid} : !llvm<"{ float, i1 }"> - llvm.return %6 : !llvm<"{ i32, i1 }"> + %7 = nvvm.shfl.sync.bfly %0, %4, %1, %2 {return_value_and_is_valid} : !llvm.struct<(float, i1)> + llvm.return %6 : !llvm.struct<(i32, i1)> } llvm.func @nvvm_vote(%0 : !llvm.i32, %1 : !llvm.i1) -> !llvm.i32 { @@ -64,13 +64,13 @@ llvm.return %3 : !llvm.i32 } -llvm.func @nvvm_mma(%a0 : !llvm<"<2 x half>">, %a1 : !llvm<"<2 x half>">, - %b0 : !llvm<"<2 x half>">, %b1 : !llvm<"<2 x half>">, +llvm.func @nvvm_mma(%a0 : !llvm.vec<2 x half>, %a1 : !llvm.vec<2 x half>, + %b0 : !llvm.vec<2 x half>, %b1 : !llvm.vec<2 x half>, %c0 : !llvm.float, %c1 : !llvm.float, %c2 : !llvm.float, %c3 : !llvm.float, %c4 : !llvm.float, %c5 : !llvm.float, %c6 : !llvm.float, %c7 : !llvm.float) { // CHECK: call { float, float, float, float, float, float, float, float } @llvm.nvvm.mma.m8n8k4.row.col.f32.f32 - %0 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3, %c4, %c5, %c6, %c7 {alayout="row", blayout="col"} : (!llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm<"<2 x half>">, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float) -> !llvm<"{ float, float, float, float, float, float, float, float }"> - llvm.return %0 : !llvm<"{ float, float, float, float, float, float, float, float }"> + %0 = nvvm.mma.sync %a0, %a1, %b0, %b1, %c0, %c1, %c2, %c3, %c4, %c5, %c6, %c7 {alayout="row", blayout="col"} : (!llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.vec<2 x half>, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float, !llvm.float) -> !llvm.struct<(float, float, float, float, float, float, float, float)> + llvm.return %0 : !llvm.struct<(float, float, float, float, float, float, float, float)> } // This function has the "kernel" attribute attached and should appear in the diff --git a/mlir/test/Target/rocdl.mlir b/mlir/test/Target/rocdl.mlir --- a/mlir/test/Target/rocdl.mlir +++ b/mlir/test/Target/rocdl.mlir @@ -43,133 +43,133 @@ } llvm.func @rocdl.xdlops(%arg0 : !llvm.float, %arg1 : !llvm.float, - %arg2 : !llvm<"<32 x float>">, %arg3 : !llvm.i32, - %arg4 : !llvm<"<16 x float>">, %arg5 : !llvm<"<4 x float>">, - %arg6 : !llvm<"<4 x half>">, %arg7 : !llvm<"<32 x i32>">, - %arg8 : !llvm<"<16 x i32>">, %arg9 : !llvm<"<4 x i32>">, - %arg10 : !llvm<"<2 x i16>">) -> !llvm<"<32 x float>"> { + %arg2 : !llvm.vec<32 x float>, %arg3 : !llvm.i32, + %arg4 : !llvm.vec<16 x float>, %arg5 : !llvm.vec<4 x float>, + %arg6 : !llvm.vec<4 x half>, %arg7 : !llvm.vec<32 x i32>, + %arg8 : !llvm.vec<16 x i32>, %arg9 : !llvm.vec<4 x i32>, + %arg10 : !llvm.vec<2 x i16>) -> !llvm.vec<32 x float> { // CHECK-LABEL: rocdl.xdlops // CHECK: call <32 x float> @llvm.amdgcn.mfma.f32.32x32x1f32(float %{{.*}}, float %{{.*}}, <32 x float> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r0 = rocdl.mfma.f32.32x32x1f32 %arg0, %arg1, %arg2, %arg3, %arg3, %arg3 : - (!llvm.float, !llvm.float, !llvm<"<32 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<32 x float>"> + (!llvm.float, !llvm.float, !llvm.vec<32 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<32 x float> // CHECK: call <16 x float> @llvm.amdgcn.mfma.f32.16x16x1f32(float %{{.*}}, float %{{.*}}, <16 x float> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r1 = rocdl.mfma.f32.16x16x1f32 %arg0, %arg1, %arg4, %arg3, %arg3, %arg3 : - (!llvm.float, !llvm.float, !llvm<"<16 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x float>"> + (!llvm.float, !llvm.float, !llvm.vec<16 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x float> // CHECK: call <4 x float> @llvm.amdgcn.mfma.f32.16x16x4f32(float %{{.*}}, float %{{.*}}, <4 x float> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r2 = rocdl.mfma.f32.16x16x4f32 %arg0, %arg1, %arg5, %arg3, %arg3, %arg3 : - (!llvm.float, !llvm.float, !llvm<"<4 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x float>"> + (!llvm.float, !llvm.float, !llvm.vec<4 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x float> // CHECK: call <4 x float> @llvm.amdgcn.mfma.f32.4x4x1f32(float %{{.*}}, float %{{.*}}, <4 x float> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r3 = rocdl.mfma.f32.4x4x1f32 %arg0, %arg1, %arg5, %arg3, %arg3, %arg3 : - (!llvm.float, !llvm.float, !llvm<"<4 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x float>"> + (!llvm.float, !llvm.float, !llvm.vec<4 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x float> // CHECK: call <16 x float> @llvm.amdgcn.mfma.f32.32x32x2f32(float %{{.*}}, float %{{.*}}, <16 x float> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r4= rocdl.mfma.f32.32x32x2f32 %arg0, %arg1, %arg4, %arg3, %arg3, %arg3 : - (!llvm.float, !llvm.float, !llvm<"<16 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x float>"> + (!llvm.float, !llvm.float, !llvm.vec<16 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x float> // CHECK: call <32 x float> @llvm.amdgcn.mfma.f32.32x32x4f16(<4 x half> %{{.*}}, <4 x half> %{{.*}}, <32 x float> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r5 = rocdl.mfma.f32.32x32x4f16 %arg6, %arg6, %arg2, %arg3, %arg3, %arg3 : - (!llvm<"<4 x half>">, !llvm<"<4 x half>">, !llvm<"<32 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<32 x float>"> + (!llvm.vec<4 x half>, !llvm.vec<4 x half>, !llvm.vec<32 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<32 x float> // CHECK: call <16 x float> @llvm.amdgcn.mfma.f32.16x16x4f16(<4 x half> %{{.*}}, <4 x half> %{{.*}}, <16 x float> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r6 = rocdl.mfma.f32.16x16x4f16 %arg6, %arg6, %arg4, %arg3, %arg3, %arg3 : - (!llvm<"<4 x half>">, !llvm<"<4 x half>">, !llvm<"<16 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x float>"> + (!llvm.vec<4 x half>, !llvm.vec<4 x half>, !llvm.vec<16 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x float> // CHECK: call <4 x float> @llvm.amdgcn.mfma.f32.4x4x4f16(<4 x half> %{{.*}}, <4 x half> %{{.*}}, <4 x float> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r7 = rocdl.mfma.f32.4x4x4f16 %arg6, %arg6, %arg5, %arg3, %arg3, %arg3 : - (!llvm<"<4 x half>">, !llvm<"<4 x half>">, !llvm<"<4 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x float>"> + (!llvm.vec<4 x half>, !llvm.vec<4 x half>, !llvm.vec<4 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x float> // CHECK: call <16 x float> @llvm.amdgcn.mfma.f32.32x32x8f16(<4 x half> %{{.*}}, <4 x half> %{{.*}}, <16 x float> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r8 = rocdl.mfma.f32.32x32x8f16 %arg6, %arg6, %arg4, %arg3, %arg3, %arg3 : - (!llvm<"<4 x half>">, !llvm<"<4 x half>">, !llvm<"<16 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x float>"> + (!llvm.vec<4 x half>, !llvm.vec<4 x half>, !llvm.vec<16 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x float> // CHECK: call <4 x float> @llvm.amdgcn.mfma.f32.16x16x16f16(<4 x half> %{{.*}}, <4 x half> %{{.*}}, <4 x float> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r9 = rocdl.mfma.f32.16x16x16f16 %arg6, %arg6, %arg5, %arg3, %arg3, %arg3 : - (!llvm<"<4 x half>">, !llvm<"<4 x half>">, !llvm<"<4 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x float>"> + (!llvm.vec<4 x half>, !llvm.vec<4 x half>, !llvm.vec<4 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x float> // CHECK: call <32 x i32> @llvm.amdgcn.mfma.i32.32x32x4i8(i32 %{{.*}}, i32 %{{.*}}, <32 x i32> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r10 = rocdl.mfma.i32.32x32x4i8 %arg3, %arg3, %arg7, %arg3, %arg3, %arg3 : - (!llvm.i32, !llvm.i32, !llvm<"<32 x i32>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<32 x i32>"> + (!llvm.i32, !llvm.i32, !llvm.vec<32 x i32>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<32 x i32> // CHECK: call <16 x i32> @llvm.amdgcn.mfma.i32.16x16x4i8(i32 %{{.*}}, i32 %{{.*}}, <16 x i32> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r11 = rocdl.mfma.i32.16x16x4i8 %arg3, %arg3, %arg8, %arg3, %arg3, %arg3 : - (!llvm.i32, !llvm.i32, !llvm<"<16 x i32>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x i32>"> + (!llvm.i32, !llvm.i32, !llvm.vec<16 x i32>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x i32> // CHECK: call <4 x i32> @llvm.amdgcn.mfma.i32.4x4x4i8(i32 %{{.*}}, i32 %{{.*}}, <4 x i32> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r12 = rocdl.mfma.i32.4x4x4i8 %arg3, %arg3, %arg9, %arg3, %arg3, %arg3 : - (!llvm.i32, !llvm.i32, !llvm<"<4 x i32>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x i32>"> + (!llvm.i32, !llvm.i32, !llvm.vec<4 x i32>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x i32> // CHECK: call <16 x i32> @llvm.amdgcn.mfma.i32.32x32x8i8(i32 %{{.*}}, i32 %{{.*}}, <16 x i32> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r13 = rocdl.mfma.i32.32x32x8i8 %arg3, %arg3, %arg8, %arg3, %arg3, %arg3 : - (!llvm.i32, !llvm.i32, !llvm<"<16 x i32>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x i32>"> + (!llvm.i32, !llvm.i32, !llvm.vec<16 x i32>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x i32> // CHECK: call <4 x i32> @llvm.amdgcn.mfma.i32.16x16x16i8(i32 %{{.*}}, i32 %{{.*}}, <4 x i32> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r14 = rocdl.mfma.i32.16x16x16i8 %arg3, %arg3, %arg9, %arg3, %arg3, %arg3 : - (!llvm.i32, !llvm.i32, !llvm<"<4 x i32>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x i32>"> + (!llvm.i32, !llvm.i32, !llvm.vec<4 x i32>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x i32> // CHECK: call <32 x float> @llvm.amdgcn.mfma.f32.32x32x2bf16(<2 x i16> %{{.*}}, <2 x i16> %{{.*}}, <32 x float> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r15 = rocdl.mfma.f32.32x32x2bf16 %arg10, %arg10, %arg2, %arg3, %arg3, %arg3 : - (!llvm<"<2 x i16>">, !llvm<"<2 x i16>">, !llvm<"<32 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<32 x float>"> + (!llvm.vec<2 x i16>, !llvm.vec<2 x i16>, !llvm.vec<32 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<32 x float> // CHECK: call <16 x float> @llvm.amdgcn.mfma.f32.16x16x2bf16(<2 x i16> %{{.*}}, <2 x i16> %{{.*}}, <16 x float> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r16 = rocdl.mfma.f32.16x16x2bf16 %arg10, %arg10, %arg4, %arg3, %arg3, %arg3 : - (!llvm<"<2 x i16>">, !llvm<"<2 x i16>">, !llvm<"<16 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x float>"> + (!llvm.vec<2 x i16>, !llvm.vec<2 x i16>, !llvm.vec<16 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x float> // CHECK: call <4 x float> @llvm.amdgcn.mfma.f32.4x4x2bf16(<2 x i16> %{{.*}}, <2 x i16> %{{.*}}, <4 x float> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r17 = rocdl.mfma.f32.4x4x2bf16 %arg10, %arg10, %arg5, %arg3, %arg3, %arg3 : - (!llvm<"<2 x i16>">, !llvm<"<2 x i16>">, !llvm<"<4 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x float>"> + (!llvm.vec<2 x i16>, !llvm.vec<2 x i16>, !llvm.vec<4 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x float> // CHECK: call <16 x float> @llvm.amdgcn.mfma.f32.32x32x4bf16(<2 x i16> %{{.*}}, <2 x i16> %{{.*}}, <16 x float> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r18 = rocdl.mfma.f32.32x32x4bf16 %arg10, %arg10, %arg4, %arg3, %arg3, %arg3 : - (!llvm<"<2 x i16>">, !llvm<"<2 x i16>">, !llvm<"<16 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<16 x float>"> + (!llvm.vec<2 x i16>, !llvm.vec<2 x i16>, !llvm.vec<16 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<16 x float> // CHECK: call <4 x float> @llvm.amdgcn.mfma.f32.16x16x8bf16(<2 x i16> %{{.*}}, <2 x i16> %{{.*}}, <4 x float> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) %r19 = rocdl.mfma.f32.16x16x8bf16 %arg10, %arg10, %arg5, %arg3, %arg3, %arg3 : - (!llvm<"<2 x i16>">, !llvm<"<2 x i16>">, !llvm<"<4 x float>">, - !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm<"<4 x float>"> + (!llvm.vec<2 x i16>, !llvm.vec<2 x i16>, !llvm.vec<4 x float>, + !llvm.i32, !llvm.i32, !llvm.i32) -> !llvm.vec<4 x float> - llvm.return %r0 : !llvm<"<32 x float>"> + llvm.return %r0 : !llvm.vec<32 x float> } -llvm.func @rocdl.mubuf(%rsrc : !llvm<"<4 x i32>">, %vindex : !llvm.i32, +llvm.func @rocdl.mubuf(%rsrc : !llvm.vec<4 x i32>, %vindex : !llvm.i32, %offset : !llvm.i32, %glc : !llvm.i1, - %slc : !llvm.i1, %vdata1 : !llvm<"<1 x float>">, - %vdata2 : !llvm<"<2 x float>">, %vdata4 : !llvm<"<4 x float>">) { + %slc : !llvm.i1, %vdata1 : !llvm.vec<1 x float>, + %vdata2 : !llvm.vec<2 x float>, %vdata4 : !llvm.vec<4 x float>) { // CHECK-LABEL: rocdl.mubuf // CHECK: call <1 x float> @llvm.amdgcn.buffer.load.v1f32(<4 x i32> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i1 %{{.*}}, i1 %{{.*}}) - %r1 = rocdl.buffer.load %rsrc, %vindex, %offset, %glc, %slc : !llvm<"<1 x float>"> + %r1 = rocdl.buffer.load %rsrc, %vindex, %offset, %glc, %slc : !llvm.vec<1 x float> // CHECK: call <2 x float> @llvm.amdgcn.buffer.load.v2f32(<4 x i32> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i1 %{{.*}}, i1 %{{.*}}) - %r2 = rocdl.buffer.load %rsrc, %vindex, %offset, %glc, %slc : !llvm<"<2 x float>"> + %r2 = rocdl.buffer.load %rsrc, %vindex, %offset, %glc, %slc : !llvm.vec<2 x float> // CHECK: call <4 x float> @llvm.amdgcn.buffer.load.v4f32(<4 x i32> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i1 %{{.*}}, i1 %{{.*}}) - %r4 = rocdl.buffer.load %rsrc, %vindex, %offset, %glc, %slc : !llvm<"<4 x float>"> + %r4 = rocdl.buffer.load %rsrc, %vindex, %offset, %glc, %slc : !llvm.vec<4 x float> // CHECK: call void @llvm.amdgcn.buffer.store.v1f32(<1 x float> %{{.*}}, <4 x i32> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i1 %{{.*}}, i1 %{{.*}}) - rocdl.buffer.store %vdata1, %rsrc, %vindex, %offset, %glc, %slc : !llvm<"<1 x float>"> + rocdl.buffer.store %vdata1, %rsrc, %vindex, %offset, %glc, %slc : !llvm.vec<1 x float> // CHECK: call void @llvm.amdgcn.buffer.store.v2f32(<2 x float> %{{.*}}, <4 x i32> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i1 %{{.*}}, i1 %{{.*}}) - rocdl.buffer.store %vdata2, %rsrc, %vindex, %offset, %glc, %slc : !llvm<"<2 x float>"> + rocdl.buffer.store %vdata2, %rsrc, %vindex, %offset, %glc, %slc : !llvm.vec<2 x float> // CHECK: call void @llvm.amdgcn.buffer.store.v4f32(<4 x float> %{{.*}}, <4 x i32> %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i1 %{{.*}}, i1 %{{.*}}) - rocdl.buffer.store %vdata4, %rsrc, %vindex, %offset, %glc, %slc : !llvm<"<4 x float>"> + rocdl.buffer.store %vdata4, %rsrc, %vindex, %offset, %glc, %slc : !llvm.vec<4 x float> llvm.return } diff --git a/mlir/test/lib/Dialect/LLVMIR/LLVMTypeTestDialect.cpp b/mlir/test/lib/Dialect/LLVMIR/LLVMTypeTestDialect.cpp --- a/mlir/test/lib/Dialect/LLVMIR/LLVMTypeTestDialect.cpp +++ b/mlir/test/lib/Dialect/LLVMIR/LLVMTypeTestDialect.cpp @@ -11,25 +11,25 @@ public: LLVMDialectNewTypes(MLIRContext *ctx) : Dialect(getDialectNamespace(), ctx) { // clang-format off - addTypes(); + // addTypes(); // clang-format on } static StringRef getDialectNamespace() { return "llvm2"; } @@ -38,7 +38,7 @@ return detail::parseType(parser); } void printType(Type type, DialectAsmPrinter &printer) const override { - detail::printType(type.cast(), printer); + detail::printType(type.cast(), printer); } }; } // namespace diff --git a/mlir/test/lib/Target/TestLLVMTypeTranslation.cpp b/mlir/test/lib/Target/TestLLVMTypeTranslation.cpp --- a/mlir/test/lib/Target/TestLLVMTypeTranslation.cpp +++ b/mlir/test/lib/Target/TestLLVMTypeTranslation.cpp @@ -31,7 +31,7 @@ if (op.getName().getStringRef() == "llvm.test_introduce_func") { auto attr = op.getAttrOfType("type"); assert(attr && "expected 'type' attribute"); - auto type = attr.getValue().cast(); + auto type = attr.getValue().cast(); auto nameAttr = op.getAttrOfType("name"); assert(nameAttr && "expected 'name' attributes"); @@ -46,7 +46,7 @@ module->getOrInsertFunction(nameAttr.getValue(), translated); std::string roundtripName = (Twine(nameAttr.getValue()) + "_round").str(); - LLVM::LLVMTypeNew translatedBack = + LLVM::LLVMType translatedBack = LLVM::translateTypeFromLLVMIR(translated, *op.getContext()); llvm::Type *translatedBackAndForth = LLVM::translateTypeToLLVMIR(translatedBack, builder.getContext()); diff --git a/mlir/test/mlir-cpu-runner/bare_ptr_call_conv.mlir b/mlir/test/mlir-cpu-runner/bare_ptr_call_conv.mlir --- a/mlir/test/mlir-cpu-runner/bare_ptr_call_conv.mlir +++ b/mlir/test/mlir-cpu-runner/bare_ptr_call_conv.mlir @@ -26,8 +26,8 @@ } // External declarations. -llvm.func @malloc(!llvm.i64) -> !llvm<"i8*"> -llvm.func @free(!llvm<"i8*">) +llvm.func @malloc(!llvm.i64) -> !llvm.ptr +llvm.func @free(!llvm.ptr) func @print_f32(%arg0: f32) func @print_comma() func @print_newline() @@ -79,105 +79,105 @@ %3 = llvm.mlir.constant(1.000000e+00 : f32) : !llvm.float %4 = llvm.mlir.constant(2.000000e+00 : f32) : !llvm.float %5 = llvm.mlir.constant(2 : index) : !llvm.i64 - %6 = llvm.mlir.null : !llvm<"float*"> + %6 = llvm.mlir.null : !llvm.ptr %7 = llvm.mlir.constant(1 : index) : !llvm.i64 - %8 = llvm.getelementptr %6[%7] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - %9 = llvm.ptrtoint %8 : !llvm<"float*"> to !llvm.i64 + %8 = llvm.getelementptr %6[%7] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + %9 = llvm.ptrtoint %8 : !llvm.ptr to !llvm.i64 %10 = llvm.mul %5, %9 : !llvm.i64 - %11 = llvm.call @malloc(%10) : (!llvm.i64) -> !llvm<"i8*"> - %12 = llvm.bitcast %11 : !llvm<"i8*"> to !llvm<"float*"> - %13 = llvm.mlir.undef : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %14 = llvm.insertvalue %12, %13[0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %15 = llvm.insertvalue %12, %14[1] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> + %11 = llvm.call @malloc(%10) : (!llvm.i64) -> !llvm.ptr + %12 = llvm.bitcast %11 : !llvm.ptr to !llvm.ptr + %13 = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %14 = llvm.insertvalue %12, %13[0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %15 = llvm.insertvalue %12, %14[1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> %16 = llvm.mlir.constant(0 : index) : !llvm.i64 - %17 = llvm.insertvalue %16, %15[2] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> + %17 = llvm.insertvalue %16, %15[2] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> %18 = llvm.mlir.constant(1 : index) : !llvm.i64 - %19 = llvm.insertvalue %5, %17[3, 0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %20 = llvm.insertvalue %18, %19[4, 0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> + %19 = llvm.insertvalue %5, %17[3, 0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %20 = llvm.insertvalue %18, %19[4, 0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> %21 = llvm.mlir.constant(2 : index) : !llvm.i64 - %22 = llvm.mlir.null : !llvm<"float*"> + %22 = llvm.mlir.null : !llvm.ptr %23 = llvm.mlir.constant(1 : index) : !llvm.i64 - %24 = llvm.getelementptr %22[%23] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - %25 = llvm.ptrtoint %24 : !llvm<"float*"> to !llvm.i64 + %24 = llvm.getelementptr %22[%23] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + %25 = llvm.ptrtoint %24 : !llvm.ptr to !llvm.i64 %26 = llvm.mul %21, %25 : !llvm.i64 - %27 = llvm.call @malloc(%26) : (!llvm.i64) -> !llvm<"i8*"> - %28 = llvm.bitcast %27 : !llvm<"i8*"> to !llvm<"float*"> - %29 = llvm.mlir.undef : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %30 = llvm.insertvalue %28, %29[0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %31 = llvm.insertvalue %28, %30[1] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> + %27 = llvm.call @malloc(%26) : (!llvm.i64) -> !llvm.ptr + %28 = llvm.bitcast %27 : !llvm.ptr to !llvm.ptr + %29 = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %30 = llvm.insertvalue %28, %29[0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %31 = llvm.insertvalue %28, %30[1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> %32 = llvm.mlir.constant(0 : index) : !llvm.i64 - %33 = llvm.insertvalue %32, %31[2] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> + %33 = llvm.insertvalue %32, %31[2] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> %34 = llvm.mlir.constant(1 : index) : !llvm.i64 - %35 = llvm.insertvalue %21, %33[3, 0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %36 = llvm.insertvalue %34, %35[4, 0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> + %35 = llvm.insertvalue %21, %33[3, 0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %36 = llvm.insertvalue %34, %35[4, 0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> llvm.br ^bb1(%1 : !llvm.i64) ^bb1(%37: !llvm.i64): // 2 preds: ^bb0, ^bb2 %38 = llvm.icmp "slt" %37, %0 : !llvm.i64 llvm.cond_br %38, ^bb2, ^bb3 ^bb2: // pred: ^bb1 - %39 = llvm.extractvalue %20[1] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> + %39 = llvm.extractvalue %20[1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> %40 = llvm.mlir.constant(0 : index) : !llvm.i64 %41 = llvm.mlir.constant(1 : index) : !llvm.i64 %42 = llvm.mul %37, %41 : !llvm.i64 %43 = llvm.add %40, %42 : !llvm.i64 - %44 = llvm.getelementptr %39[%43] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - llvm.store %3, %44 : !llvm<"float*"> - %45 = llvm.extractvalue %36[1] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> + %44 = llvm.getelementptr %39[%43] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + llvm.store %3, %44 : !llvm.ptr + %45 = llvm.extractvalue %36[1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> %46 = llvm.mlir.constant(0 : index) : !llvm.i64 %47 = llvm.mlir.constant(1 : index) : !llvm.i64 %48 = llvm.mul %37, %47 : !llvm.i64 %49 = llvm.add %46, %48 : !llvm.i64 - %50 = llvm.getelementptr %45[%49] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - llvm.store %3, %50 : !llvm<"float*"> + %50 = llvm.getelementptr %45[%49] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + llvm.store %3, %50 : !llvm.ptr %51 = llvm.add %37, %2 : !llvm.i64 llvm.br ^bb1(%51 : !llvm.i64) ^bb3: // pred: ^bb1 %52 = llvm.mlir.constant(1 : index) : !llvm.i64 %53 = llvm.mlir.constant(1 : index) : !llvm.i64 - %54 = llvm.extractvalue %20[1] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %55 = llvm.extractvalue %36[1] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - llvm.call @simple_add1_add2_test(%54, %55) : (!llvm<"float*">, !llvm<"float*">) -> () - %56 = llvm.extractvalue %20[1] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> + %54 = llvm.extractvalue %20[1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %55 = llvm.extractvalue %36[1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + llvm.call @simple_add1_add2_test(%54, %55) : (!llvm.ptr, !llvm.ptr) -> () + %56 = llvm.extractvalue %20[1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> %57 = llvm.mlir.constant(0 : index) : !llvm.i64 %58 = llvm.mlir.constant(1 : index) : !llvm.i64 %59 = llvm.mul %1, %58 : !llvm.i64 %60 = llvm.add %57, %59 : !llvm.i64 - %61 = llvm.getelementptr %56[%60] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - %62 = llvm.load %61 : !llvm<"float*"> + %61 = llvm.getelementptr %56[%60] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + %62 = llvm.load %61 : !llvm.ptr llvm.call @print_f32(%62) : (!llvm.float) -> () llvm.call @print_comma() : () -> () - %63 = llvm.extractvalue %20[1] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> + %63 = llvm.extractvalue %20[1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> %64 = llvm.mlir.constant(0 : index) : !llvm.i64 %65 = llvm.mlir.constant(1 : index) : !llvm.i64 %66 = llvm.mul %2, %65 : !llvm.i64 %67 = llvm.add %64, %66 : !llvm.i64 - %68 = llvm.getelementptr %63[%67] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - %69 = llvm.load %68 : !llvm<"float*"> + %68 = llvm.getelementptr %63[%67] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + %69 = llvm.load %68 : !llvm.ptr llvm.call @print_f32(%69) : (!llvm.float) -> () llvm.call @print_newline() : () -> () - %70 = llvm.extractvalue %36[1] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> + %70 = llvm.extractvalue %36[1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> %71 = llvm.mlir.constant(0 : index) : !llvm.i64 %72 = llvm.mlir.constant(1 : index) : !llvm.i64 %73 = llvm.mul %1, %72 : !llvm.i64 %74 = llvm.add %71, %73 : !llvm.i64 - %75 = llvm.getelementptr %70[%74] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - %76 = llvm.load %75 : !llvm<"float*"> + %75 = llvm.getelementptr %70[%74] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + %76 = llvm.load %75 : !llvm.ptr llvm.call @print_f32(%76) : (!llvm.float) -> () llvm.call @print_comma() : () -> () - %77 = llvm.extractvalue %36[1] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> + %77 = llvm.extractvalue %36[1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> %78 = llvm.mlir.constant(0 : index) : !llvm.i64 %79 = llvm.mlir.constant(1 : index) : !llvm.i64 %80 = llvm.mul %2, %79 : !llvm.i64 %81 = llvm.add %78, %80 : !llvm.i64 - %82 = llvm.getelementptr %77[%81] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - %83 = llvm.load %82 : !llvm<"float*"> + %82 = llvm.getelementptr %77[%81] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + %83 = llvm.load %82 : !llvm.ptr llvm.call @print_f32(%83) : (!llvm.float) -> () llvm.call @print_newline() : () -> () - %84 = llvm.extractvalue %20[0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %85 = llvm.bitcast %84 : !llvm<"float*"> to !llvm<"i8*"> - llvm.call @free(%85) : (!llvm<"i8*">) -> () - %86 = llvm.extractvalue %36[0] : !llvm<"{ float*, float*, i64, [1 x i64], [1 x i64] }"> - %87 = llvm.bitcast %86 : !llvm<"float*"> to !llvm<"i8*"> - llvm.call @free(%87) : (!llvm<"i8*">) -> () + %84 = llvm.extractvalue %20[0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %85 = llvm.bitcast %84 : !llvm.ptr to !llvm.ptr + llvm.call @free(%85) : (!llvm.ptr) -> () + %86 = llvm.extractvalue %36[0] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> + %87 = llvm.bitcast %86 : !llvm.ptr to !llvm.ptr + llvm.call @free(%87) : (!llvm.ptr) -> () llvm.return } diff --git a/mlir/test/mlir-cpu-runner/simple.mlir b/mlir/test/mlir-cpu-runner/simple.mlir --- a/mlir/test/mlir-cpu-runner/simple.mlir +++ b/mlir/test/mlir-cpu-runner/simple.mlir @@ -15,8 +15,8 @@ // Declarations of C library functions. llvm.func @fabsf(!llvm.float) -> !llvm.float -llvm.func @malloc(!llvm.i64) -> !llvm<"i8*"> -llvm.func @free(!llvm<"i8*">) +llvm.func @malloc(!llvm.i64) -> !llvm.ptr +llvm.func @free(!llvm.ptr) // Check that a simple function with a nested call works. llvm.func @main() -> !llvm.float { @@ -27,29 +27,29 @@ // CHECK: 4.200000e+02 // Helper typed functions wrapping calls to "malloc" and "free". -llvm.func @allocation() -> !llvm<"float*"> { +llvm.func @allocation() -> !llvm.ptr { %0 = llvm.mlir.constant(4 : index) : !llvm.i64 - %1 = llvm.call @malloc(%0) : (!llvm.i64) -> !llvm<"i8*"> - %2 = llvm.bitcast %1 : !llvm<"i8*"> to !llvm<"float*"> - llvm.return %2 : !llvm<"float*"> + %1 = llvm.call @malloc(%0) : (!llvm.i64) -> !llvm.ptr + %2 = llvm.bitcast %1 : !llvm.ptr to !llvm.ptr + llvm.return %2 : !llvm.ptr } -llvm.func @deallocation(%arg0: !llvm<"float*">) { - %0 = llvm.bitcast %arg0 : !llvm<"float*"> to !llvm<"i8*"> - llvm.call @free(%0) : (!llvm<"i8*">) -> () +llvm.func @deallocation(%arg0: !llvm.ptr) { + %0 = llvm.bitcast %arg0 : !llvm.ptr to !llvm.ptr + llvm.call @free(%0) : (!llvm.ptr) -> () llvm.return } // Check that allocation and deallocation works, and that a custom entry point // works. llvm.func @foo() -> !llvm.float { - %0 = llvm.call @allocation() : () -> !llvm<"float*"> + %0 = llvm.call @allocation() : () -> !llvm.ptr %1 = llvm.mlir.constant(0 : index) : !llvm.i64 %2 = llvm.mlir.constant(1.234000e+03 : f32) : !llvm.float - %3 = llvm.getelementptr %0[%1] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - llvm.store %2, %3 : !llvm<"float*"> - %4 = llvm.getelementptr %0[%1] : (!llvm<"float*">, !llvm.i64) -> !llvm<"float*"> - %5 = llvm.load %4 : !llvm<"float*"> - llvm.call @deallocation(%0) : (!llvm<"float*">) -> () + %3 = llvm.getelementptr %0[%1] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + llvm.store %2, %3 : !llvm.ptr + %4 = llvm.getelementptr %0[%1] : (!llvm.ptr, !llvm.i64) -> !llvm.ptr + %5 = llvm.load %4 : !llvm.ptr + llvm.call @deallocation(%0) : (!llvm.ptr) -> () llvm.return %5 : !llvm.float } // NOMAIN: 1.234000e+03