[Mlir-commits] [mlir] ec1f4e7 - [mlir] switch the modeling of LLVM types to use the new mechanism
Alex Zinenko
llvmlistbot at llvm.org
Tue Aug 4 05:30:26 PDT 2020
Author: Alex Zinenko
Date: 2020-08-04T14:29:25+02:00
New Revision: ec1f4e7c3b17656658c9cf49c33bc06c4bc747c2
URL: https://github.com/llvm/llvm-project/commit/ec1f4e7c3b17656658c9cf49c33bc06c4bc747c2
DIFF: https://github.com/llvm/llvm-project/commit/ec1f4e7c3b17656658c9cf49c33bc06c4bc747c2.diff
LOG: [mlir] switch the modeling of LLVM types to use the new mechanism
A new first-party modeling for LLVM IR types in the LLVM dialect has been
developed in parallel to the existing modeling based on wrapping LLVM `Type *`
instances. It resolves the long-standing problem of modeling identified
structure types, including recursive structures, and enables future removal of
LLVMContext and related locking mechanisms from LLVMDialect.
This commit only switches the modeling by (a) renaming LLVMTypeNew to LLVMType,
(b) removing the old implementaiton of LLVMType, and (c) updating the tests. It
is intentionally minimal. Separate commits will remove the infrastructure built
for the transition and update API uses where appropriate.
Depends On D85020
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D85021
Added:
Modified:
mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h
mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
mlir/include/mlir/Target/LLVMIR/TypeTranslation.h
mlir/integration_test/Dialect/LLVMIR/CPU/test-vector-reductions-fp.mlir
mlir/integration_test/Dialect/LLVMIR/CPU/test-vector-reductions-int.mlir
mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt
mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
mlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp
mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
mlir/lib/Dialect/LLVMIR/IR/TypeDetail.h
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
mlir/lib/Target/LLVMIR/TypeTranslation.cpp
mlir/test/Conversion/GPUCommon/lower-launch-func-to-gpu-runtime-calls.mlir
mlir/test/Conversion/GPUCommon/memory-attrbution.mlir
mlir/test/Conversion/GPUToCUDA/lower-nvvm-kernel-to-cubin.mlir
mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir
mlir/test/Conversion/GPUToROCm/lower-rocdl-kernel-to-hsaco.mlir
mlir/test/Conversion/GPUToVulkan/invoke-vulkan.mlir
mlir/test/Conversion/SPIRVToLLVM/arithmetic-ops-to-llvm.mlir
mlir/test/Conversion/SPIRVToLLVM/bitwise-ops-to-llvm.mlir
mlir/test/Conversion/SPIRVToLLVM/cast-ops-to-llvm.mlir
mlir/test/Conversion/SPIRVToLLVM/comparison-ops-to-llvm.mlir
mlir/test/Conversion/SPIRVToLLVM/constant-op-to-llvm.mlir
mlir/test/Conversion/SPIRVToLLVM/func-to-llvm.mlir
mlir/test/Conversion/SPIRVToLLVM/glsl-ops-to-llvm.mlir
mlir/test/Conversion/SPIRVToLLVM/logical-ops-to-llvm.mlir
mlir/test/Conversion/SPIRVToLLVM/memory-ops-to-llvm.mlir
mlir/test/Conversion/SPIRVToLLVM/misc-ops-to-llvm.mlir
mlir/test/Conversion/SPIRVToLLVM/shifts-to-llvm.mlir
mlir/test/Conversion/SPIRVToLLVM/spirv-types-to-llvm.mlir
mlir/test/Conversion/StandardToLLVM/calling-convention.mlir
mlir/test/Conversion/StandardToLLVM/convert-dynamic-memref-ops.mlir
mlir/test/Conversion/StandardToLLVM/convert-funcs.mlir
mlir/test/Conversion/StandardToLLVM/convert-static-memref-ops.mlir
mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
mlir/test/Conversion/StandardToLLVM/invalid.mlir
mlir/test/Conversion/StandardToLLVM/standard-to-llvm.mlir
mlir/test/Conversion/VectorToLLVM/vector-reduction-to-llvm.mlir
mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
mlir/test/Conversion/VectorToROCDL/vector-to-rocdl.mlir
mlir/test/Dialect/GPU/invalid.mlir
mlir/test/Dialect/GPU/multiple-all-reduce.mlir
mlir/test/Dialect/GPU/outlining.mlir
mlir/test/Dialect/LLVMIR/func.mlir
mlir/test/Dialect/LLVMIR/global.mlir
mlir/test/Dialect/LLVMIR/invalid.mlir
mlir/test/Dialect/LLVMIR/nvvm.mlir
mlir/test/Dialect/LLVMIR/rocdl.mlir
mlir/test/Dialect/LLVMIR/roundtrip.mlir
mlir/test/Dialect/LLVMIR/types.mlir
mlir/test/Dialect/Linalg/llvm.mlir
mlir/test/Target/avx512.mlir
mlir/test/Target/import.ll
mlir/test/Target/llvmir-intrinsics.mlir
mlir/test/Target/llvmir-invalid.mlir
mlir/test/Target/llvmir.mlir
mlir/test/Target/nvvmir.mlir
mlir/test/Target/rocdl.mlir
mlir/test/lib/Dialect/LLVMIR/LLVMTypeTestDialect.cpp
mlir/test/lib/Target/TestLLVMTypeTranslation.cpp
mlir/test/mlir-cpu-runner/bare_ptr_call_conv.mlir
mlir/test/mlir-cpu-runner/simple.mlir
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h b/mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
index 52acfbfa8e50..6b771f8e9123 100644
--- 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 LLVMTypeStorage;
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<LLVMType, mlir::Type,
- detail::LLVMTypeStorage> {
-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<LLVMType> params,
- bool isVarArg);
- static LLVMType getFunctionTy(LLVMType result, bool isVarArg) {
- return getFunctionTy(result, llvm::None, isVarArg);
- }
- static LLVMType getStructTy(LLVMDialect *dialect, ArrayRef<LLVMType> elements,
- bool isPacked = false);
- static LLVMType getStructTy(LLVMDialect *dialect, bool isPacked = false) {
- return getStructTy(dialect, llvm::None, isPacked);
- }
- template <typename... Args>
- static typename std::enable_if<llvm::are_base_of<LLVMType, Args...>::value,
- LLVMType>::type
- getStructTy(LLVMType elt1, Args... elts) {
- SmallVector<LLVMType, 8> 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<LLVMType> elements,
- Optional<StringRef> name,
- bool isPacked = false);
-
- static LLVMType createStructTy(LLVMDialect *dialect,
- Optional<StringRef> name) {
- return createStructTy(dialect, llvm::None, name);
- }
-
- static LLVMType createStructTy(ArrayRef<LLVMType> elements,
- Optional<StringRef> 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 <typename... Args>
- static typename std::enable_if_t<llvm::are_base_of<LLVMType, Args...>::value,
- LLVMType>
- createStructTy(StringRef name, LLVMType elt1, Args... elts) {
- SmallVector<LLVMType, 8> fields({elt1, elts...});
- Optional<StringRef> opt_name(name);
- return createStructTy(&elt1.getDialect(), fields, opt_name);
- }
-
- static LLVMType setStructTyBody(LLVMType structType,
- ArrayRef<LLVMType> elements,
- bool isPacked = false);
-
- template <typename... Args>
- static typename std::enable_if_t<llvm::are_base_of<LLVMType, Args...>::value,
- LLVMType>
- setStructTyBody(LLVMType structType, LLVMType elt1, Args... elts) {
- SmallVector<LLVMType, 8> 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<LLVMType> types,
- SmallVectorImpl<llvm::Type *> &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<llvm::Type *()> 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
index e409d6880283..7d7839c166f7 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h
@@ -43,7 +43,7 @@ class LLVMDoubleType;
class LLVMIntegerType;
//===----------------------------------------------------------------------===//
-// LLVMTypeNew.
+// LLVMType.
//===----------------------------------------------------------------------===//
/// Base class for LLVM dialect types.
@@ -61,7 +61,7 @@ class LLVMIntegerType;
/// 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 {
+class LLVMType : public Type::TypeBase<LLVMType, Type, TypeStorage> {
public:
enum Kind {
// Keep non-parametric types contiguous in the enum.
@@ -92,12 +92,12 @@ class LLVMTypeNew : public Type {
};
/// Inherit base constructors.
- using Type::Type;
+ using Base::Base;
/// Support for PointerLikeTypeTraits.
using Type::getAsOpaquePointer;
- static LLVMTypeNew getFromOpaquePointer(const void *ptr) {
- return LLVMTypeNew(static_cast<ImplType *>(const_cast<void *>(ptr)));
+ static LLVMType getFromOpaquePointer(const void *ptr) {
+ return LLVMType(static_cast<ImplType *>(const_cast<void *>(ptr)));
}
/// Support for isa/cast.
@@ -118,7 +118,7 @@ class LLVMTypeNew : public Type {
}
/// Array type utilities.
- LLVMTypeNew getArrayElementType();
+ LLVMType getArrayElementType();
unsigned getArrayNumElements();
bool isArrayTy();
@@ -128,124 +128,121 @@ class LLVMTypeNew : public Type {
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<LLVMTypeNew> params, bool isVarArg);
- static LLVMTypeNew getFunctionTy(LLVMTypeNew result, bool isVarArg) {
+ static LLVMType getArrayTy(LLVMType elementType, uint64_t numElements);
+ static LLVMType getFunctionTy(LLVMType result, ArrayRef<LLVMType> params,
+ bool isVarArg);
+ static LLVMType getFunctionTy(LLVMType result, bool isVarArg) {
return getFunctionTy(result, llvm::None, isVarArg);
}
- static LLVMTypeNew getStructTy(LLVMDialect *dialect,
- ArrayRef<LLVMTypeNew> elements,
- bool isPacked = false);
- static LLVMTypeNew getStructTy(LLVMDialect *dialect, bool isPacked = false) {
+ static LLVMType getStructTy(LLVMDialect *dialect, ArrayRef<LLVMType> elements,
+ bool isPacked = false);
+ static LLVMType getStructTy(LLVMDialect *dialect, bool isPacked = false) {
return getStructTy(dialect, llvm::None, isPacked);
}
template <typename... Args>
- static typename std::enable_if<llvm::are_base_of<LLVMTypeNew, Args...>::value,
- LLVMTypeNew>::type
- getStructTy(LLVMTypeNew elt1, Args... elts) {
- SmallVector<LLVMTypeNew, 8> fields({elt1, elts...});
+ static typename std::enable_if<llvm::are_base_of<LLVMType, Args...>::value,
+ LLVMType>::type
+ getStructTy(LLVMType elt1, Args... elts) {
+ SmallVector<LLVMType, 8> 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<LLVMTypeNew> elements,
- Optional<StringRef> name,
- bool isPacked = false);
+ static LLVMType createStructTy(LLVMDialect *dialect,
+ ArrayRef<LLVMType> elements,
+ Optional<StringRef> name,
+ bool isPacked = false);
- static LLVMTypeNew createStructTy(LLVMDialect *dialect,
- Optional<StringRef> name) {
+ static LLVMType createStructTy(LLVMDialect *dialect,
+ Optional<StringRef> name) {
return createStructTy(dialect, llvm::None, name);
}
- static LLVMTypeNew createStructTy(ArrayRef<LLVMTypeNew> elements,
- Optional<StringRef> name,
- bool isPacked = false) {
+ static LLVMType createStructTy(ArrayRef<LLVMType> elements,
+ Optional<StringRef> 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 <typename... Args>
- static
- typename std::enable_if_t<llvm::are_base_of<LLVMTypeNew, Args...>::value,
- LLVMTypeNew>
- createStructTy(StringRef name, LLVMTypeNew elt1, Args... elts) {
- SmallVector<LLVMTypeNew, 8> fields({elt1, elts...});
+ static typename std::enable_if_t<llvm::are_base_of<LLVMType, Args...>::value,
+ LLVMType>
+ createStructTy(StringRef name, LLVMType elt1, Args... elts) {
+ SmallVector<LLVMType, 8> fields({elt1, elts...});
Optional<StringRef> opt_name(name);
return createStructTy(&elt1.getDialect(), fields, opt_name);
}
- static LLVMTypeNew setStructTyBody(LLVMTypeNew structType,
- ArrayRef<LLVMTypeNew> elements,
- bool isPacked = false);
+ static LLVMType setStructTyBody(LLVMType structType,
+ ArrayRef<LLVMType> elements,
+ bool isPacked = false);
template <typename... Args>
- static
- typename std::enable_if_t<llvm::are_base_of<LLVMTypeNew, Args...>::value,
- LLVMTypeNew>
- setStructTyBody(LLVMTypeNew structType, LLVMTypeNew elt1, Args... elts) {
- SmallVector<LLVMTypeNew, 8> fields({elt1, elts...});
+ static typename std::enable_if_t<llvm::are_base_of<LLVMType, Args...>::value,
+ LLVMType>
+ setStructTyBody(LLVMType structType, LLVMType elt1, Args... elts) {
+ SmallVector<LLVMType, 8> fields({elt1, elts...});
return setStructTyBody(structType, fields);
}
};
@@ -256,8 +253,7 @@ class LLVMTypeNew : public Type {
// Batch-define trivial types.
#define DEFINE_TRIVIAL_LLVM_TYPE(ClassName, Kind) \
- class ClassName \
- : public Type::TypeBase<ClassName, LLVMTypeNew, TypeStorage> { \
+ class ClassName : public Type::TypeBase<ClassName, LLVMType, TypeStorage> { \
public: \
using Base::Base; \
static bool kindof(unsigned kind) { return kind == Kind; } \
@@ -266,18 +262,18 @@ class LLVMTypeNew : public Type {
} \
}
-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 @@ DEFINE_TRIVIAL_LLVM_TYPE(LLVMMetadataType, LLVMTypeNew::MetadataType);
/// 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<LLVMArrayType, LLVMTypeNew,
+class LLVMArrayType : public Type::TypeBase<LLVMArrayType, LLVMType,
detail::LLVMTypeAndSizeStorage> {
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 @@ class LLVMArrayType : public Type::TypeBase<LLVMArrayType, LLVMTypeNew,
/// which can have multiple), a list of parameter types and can optionally be
/// variadic.
class LLVMFunctionType
- : public Type::TypeBase<LLVMFunctionType, LLVMTypeNew,
+ : public Type::TypeBase<LLVMFunctionType, LLVMType,
detail::LLVMFunctionTypeStorage> {
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<LLVMTypeNew> arguments,
+ static LLVMFunctionType get(LLVMType result, ArrayRef<LLVMType> 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<LLVMTypeNew> getParams();
- ArrayRef<LLVMTypeNew> params() { return getParams(); }
+ ArrayRef<LLVMType> getParams();
+ ArrayRef<LLVMType> params() { return getParams(); }
};
//===----------------------------------------------------------------------===//
@@ -355,14 +348,14 @@ class LLVMFunctionType
//===----------------------------------------------------------------------===//
/// LLVM dialect signless integer type parameterized by bitwidth.
-class LLVMIntegerType : public Type::TypeBase<LLVMIntegerType, LLVMTypeNew,
+class LLVMIntegerType : public Type::TypeBase<LLVMIntegerType, LLVMType,
detail::LLVMIntegerTypeStorage> {
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 @@ class LLVMIntegerType : public Type::TypeBase<LLVMIntegerType, LLVMTypeNew,
/// 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<LLVMPointerType, LLVMTypeNew,
+class LLVMPointerType : public Type::TypeBase<LLVMPointerType, LLVMType,
detail::LLVMPointerTypeStorage> {
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 @@ class LLVMPointerType : public Type::TypeBase<LLVMPointerType, LLVMTypeNew,
///
/// 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<LLVMStructType, LLVMTypeNew,
+class LLVMStructType : public Type::TypeBase<LLVMStructType, LLVMType,
detail::LLVMStructTypeStorage> {
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 @@ class LLVMStructType : public Type::TypeBase<LLVMStructType, LLVMTypeNew,
/// Gets or creates a literal struct with the given body in the provided
/// context.
static LLVMStructType getLiteral(MLIRContext *context,
- ArrayRef<LLVMTypeNew> types,
+ ArrayRef<LLVMType> types,
bool isPacked = false);
/// Gets or creates an intentionally-opaque identified struct. Such a struct
@@ -464,7 +457,7 @@ class LLVMStructType : public Type::TypeBase<LLVMStructType, LLVMTypeNew,
///
diff erent 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<LLVMTypeNew> types, bool isPacked);
+ LogicalResult setBody(ArrayRef<LLVMType> types, bool isPacked);
/// Checks if a struct is packed.
bool isPacked();
@@ -482,7 +475,7 @@ class LLVMStructType : public Type::TypeBase<LLVMStructType, LLVMTypeNew,
StringRef getName();
/// Returns the list of element types contained in a non-opaque struct.
- ArrayRef<LLVMTypeNew> getBody();
+ ArrayRef<LLVMType> getBody();
};
//===----------------------------------------------------------------------===//
@@ -492,19 +485,20 @@ class LLVMStructType : public Type::TypeBase<LLVMStructType, LLVMTypeNew,
/// 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 LLVMTypeNew {
+class LLVMVectorType : public Type::TypeBase<LLVMVectorType, LLVMType,
+ detail::LLVMTypeAndSizeStorage> {
public:
/// Inherit base constructor.
- using LLVMTypeNew::LLVMTypeNew;
+ using Base::Base;
/// 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();
@@ -525,12 +519,12 @@ class LLVMFixedVectorType
/// 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();
@@ -552,12 +546,12 @@ class LLVMScalableVectorType
/// 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
@@ -572,10 +566,10 @@ class LLVMScalableVectorType
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
@@ -587,34 +581,35 @@ void printType(LLVMTypeNew type, DialectAsmPrinter &printer);
namespace llvm {
-// LLVMTypeNew instances hash just like pointers.
-template <> struct DenseMapInfo<mlir::LLVM::LLVMTypeNew> {
- static mlir::LLVM::LLVMTypeNew getEmptyKey() {
+// LLVMType instances hash just like pointers.
+template <>
+struct DenseMapInfo<mlir::LLVM::LLVMType> {
+ static mlir::LLVM::LLVMType getEmptyKey() {
void *pointer = llvm::DenseMapInfo<void *>::getEmptyKey();
- return mlir::LLVM::LLVMTypeNew(
- static_cast<mlir::LLVM::LLVMTypeNew::ImplType *>(pointer));
+ return mlir::LLVM::LLVMType(
+ static_cast<mlir::LLVM::LLVMType::ImplType *>(pointer));
}
- static mlir::LLVM::LLVMTypeNew getTombstoneKey() {
+ static mlir::LLVM::LLVMType getTombstoneKey() {
void *pointer = llvm::DenseMapInfo<void *>::getTombstoneKey();
- return mlir::LLVM::LLVMTypeNew(
- static_cast<mlir::LLVM::LLVMTypeNew::ImplType *>(pointer));
+ return mlir::LLVM::LLVMType(
+ static_cast<mlir::LLVM::LLVMType::ImplType *>(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<mlir::LLVM::LLVMTypeNew> {
- static inline void *getAsVoidPointer(mlir::LLVM::LLVMTypeNew type) {
+// LLVMType behaves like a pointer similarly to mlir::Type.
+template <>
+struct PointerLikeTypeTraits<mlir::LLVM::LLVMType> {
+ static inline void *getAsVoidPointer(mlir::LLVM::LLVMType type) {
return const_cast<void *>(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<mlir::Type>::NumLowBitsAvailable;
diff --git a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
index 5c793f8547da..5f022e32b801 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
@@ -112,7 +112,8 @@ def NVVM_ShflBflyOp :
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
index 5a82f0a096df..3ab962b9ab11 100644
--- a/mlir/include/mlir/Target/LLVMIR/TypeTranslation.h
+++ b/mlir/include/mlir/Target/LLVMIR/TypeTranslation.h
@@ -25,10 +25,10 @@ class MLIRContext;
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
index 9b61414277b6..2f17dbe4455f 100644
--- 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 @@ module {
%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
index 3fa556c62b31..227c00a08ad8 100644
--- 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 @@ module {
%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/CMakeLists.txt b/mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt
index 569619f2bcef..eeefd372f85f 100644
--- a/mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt
+++ b/mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt
@@ -14,6 +14,7 @@ add_mlir_conversion_library(MLIRVectorToLLVM
LINK_LIBS PUBLIC
MLIRLLVMIR
MLIRStandardToLLVM
- MLIRVector
+ MLIRTargetLLVMIRModuleTranslation
MLIRTransforms
+ MLIRVector
)
diff --git a/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp b/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
index 4fa7b573f84e..3dbfaf88a443 100644
--- 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 @@ LogicalResult getMemRefAlignment(LLVMTypeConverter &typeConverter, T op,
return failure();
auto dataLayout = typeConverter.getDialect()->getLLVMModule().getDataLayout();
- align = dataLayout.getPrefTypeAlignment(
- LLVM::convertLLVMType(elementTy.cast<LLVM::LLVMType>()));
+ // TODO: this should be abstracted away to avoid depending on translation.
+ align = dataLayout.getPrefTypeAlignment(LLVM::translateTypeToLLVMIR(
+ elementTy.cast<LLVM::LLVMType>(),
+ typeConverter.getDialect()->getLLVMContext()));
return success();
}
diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
index 17848c6bf3ee..cc2200e84da5 100644
--- 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 @@ struct LLVMDialectImpl {
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<true> mutex;
@@ -1708,7 +1703,27 @@ struct LLVMDialectImpl {
LLVMDialect::LLVMDialect(MLIRContext *context)
: Dialect(getDialectNamespace(), context),
impl(new detail::LLVMDialectImpl()) {
- addTypes<LLVMType>();
+ // clang-format off
+ addTypes<LLVMVoidType,
+ LLVMHalfType,
+ LLVMBFloatType,
+ LLVMFloatType,
+ LLVMDoubleType,
+ LLVMFP128Type,
+ LLVMX86FP80Type,
+ LLVMPPCFP128Type,
+ LLVMX86MMXType,
+ LLVMTokenType,
+ LLVMLabelType,
+ LLVMMetadataType,
+ LLVMFunctionType,
+ LLVMIntegerType,
+ LLVMPointerType,
+ LLVMFixedVectorType,
+ LLVMScalableVectorType,
+ LLVMArrayType,
+ LLVMStructType>();
+ // clang-format on
addOperations<
#define GET_OP_LIST
#include "mlir/Dialect/LLVMIR/LLVMOps.cpp.inc"
@@ -1716,26 +1731,6 @@ LLVMDialect::LLVMDialect(MLIRContext *context)
// 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 @@ llvm::sys::SmartMutex<true> &LLVMDialect::getLLVMContextMutex() {
/// 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<true> 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<LLVMType>();
- assert(llvmType && "printing wrong type");
- assert(llvmType.getUnderlyingType() && "no underlying LLVM type");
- llvmType.getUnderlyingType()->print(os.getStream());
+ return detail::printType(type.cast<LLVMType>(), os);
}
/// Verify LLVMIR function argument attributes.
@@ -1788,242 +1770,6 @@ LogicalResult LLVMDialect::verifyRegionArgAttribute(Operation *op,
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>()) 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<llvm::Type *()> typeBuilder) {
- // Lock access to the llvm context and build the type.
- llvm::sys::SmartScopedLock<true> lock(dialect->impl->mutex);
- return get(dialect->getContext(), typeBuilder());
-}
-
-LLVMDialect &LLVMType::getDialect() {
- return static_cast<LLVMDialect &>(Type::getDialect());
-}
-
-llvm::Type *LLVMType::getUnderlyingType() const {
- return getImpl()->underlyingType;
-}
-
-void LLVMType::getUnderlyingTypes(ArrayRef<LLVMType> types,
- SmallVectorImpl<llvm::Type *> &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<llvm::VectorType>(getUnderlyingType())->getElementType());
-}
-unsigned LLVMType::getVectorNumElements() {
- return llvm::cast<llvm::FixedVectorType>(getUnderlyingType())
- ->getNumElements();
-}
-llvm::ElementCount LLVMType::getVectorElementCount() {
- return llvm::cast<llvm::VectorType>(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<llvm::FunctionType>(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<LLVMType> params,
- bool isVarArg) {
- SmallVector<llvm::Type *, 8> 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<LLVMType> elements, bool isPacked) {
- SmallVector<llvm::Type *, 8> 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<LLVMType> elements,
- Optional<StringRef> name, bool isPacked) {
- StringRef sr = name.hasValue() ? *name : "";
- SmallVector<llvm::Type *, 8> 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<LLVMType> elements, bool isPacked) {
- llvm::StructType *st =
- llvm::cast<llvm::StructType>(structType.getUnderlyingType());
- SmallVector<llvm::Type *, 8> 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
index d272297525c1..7df3ebe7c5b4 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp
@@ -18,48 +18,48 @@ using namespace mlir::LLVM;
// Printing.
//===----------------------------------------------------------------------===//
-static void printTypeImpl(llvm::raw_ostream &os, LLVMTypeNew type,
+static void printTypeImpl(llvm::raw_ostream &os, LLVMType type,
llvm::SetVector<StringRef> &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 @@ static void printStructTypeBody(llvm::raw_ostream &os, LLVMStructType type,
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 @@ static void printFunctionType(llvm::raw_ostream &os, LLVMFunctionType funcType,
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 @@ static void printFunctionType(llvm::raw_ostream &os, LLVMFunctionType funcType,
/// struct<"c", (ptr<struct<"b", (ptr<struct<"c">>)>>,
/// ptr<struct<"b", (ptr<struct<"c">>)>>)>
/// 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<StringRef> &stack) {
if (!type) {
os << "<<NULL-TYPE>>";
@@ -158,8 +157,8 @@ static void printTypeImpl(llvm::raw_ostream &os, LLVMTypeNew type,
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<LLVMIntegerType>()) {
@@ -194,8 +193,7 @@ static void printTypeImpl(llvm::raw_ostream &os, LLVMTypeNew type,
printFunctionType(os, type.cast<LLVMFunctionType>(), stack);
}
-void mlir::LLVM::detail::printType(LLVMTypeNew type,
- DialectAsmPrinter &printer) {
+void mlir::LLVM::detail::printType(LLVMType type, DialectAsmPrinter &printer) {
llvm::SetVector<StringRef> stack;
return printTypeImpl(printer.getStream(), type, stack);
}
@@ -204,13 +202,13 @@ void mlir::LLVM::detail::printType(LLVMTypeNew type,
// Parsing.
//===----------------------------------------------------------------------===//
-static LLVMTypeNew parseTypeImpl(DialectAsmParser &parser,
- llvm::SetVector<StringRef> &stack);
+static LLVMType parseTypeImpl(DialectAsmParser &parser,
+ llvm::SetVector<StringRef> &stack);
/// Helper to be chained with other parsing functions.
static ParseResult parseTypeImpl(DialectAsmParser &parser,
llvm::SetVector<StringRef> &stack,
- LLVMTypeNew &result) {
+ LLVMType &result) {
result = parseTypeImpl(parser, stack);
return success(result != nullptr);
}
@@ -219,7 +217,7 @@ static ParseResult parseTypeImpl(DialectAsmParser &parser,
/// llvm-type :: = `func<` llvm-type `(` llvm-type-list `...`? `)>`
static LLVMFunctionType parseFunctionType(DialectAsmParser &parser,
llvm::SetVector<StringRef> &stack) {
- LLVMTypeNew returnType;
+ LLVMType returnType;
if (parser.parseLess() || parseTypeImpl(parser, stack, returnType) ||
parser.parseLParen())
return LLVMFunctionType();
@@ -232,7 +230,7 @@ static LLVMFunctionType parseFunctionType(DialectAsmParser &parser,
}
// Parse arguments.
- SmallVector<LLVMTypeNew, 8> argTypes;
+ SmallVector<LLVMType, 8> argTypes;
do {
if (succeeded(parser.parseOptionalEllipsis())) {
if (parser.parseOptionalRParen() || parser.parseOptionalGreater())
@@ -254,7 +252,7 @@ static LLVMFunctionType parseFunctionType(DialectAsmParser &parser,
/// llvm-type ::= `ptr<` llvm-type (`,` integer)? `>`
static LLVMPointerType parsePointerType(DialectAsmParser &parser,
llvm::SetVector<StringRef> &stack) {
- LLVMTypeNew elementType;
+ LLVMType elementType;
if (parser.parseLess() || parseTypeImpl(parser, stack, elementType))
return LLVMPointerType();
@@ -274,7 +272,7 @@ static LLVMVectorType parseVectorType(DialectAsmParser &parser,
llvm::SetVector<StringRef> &stack) {
SmallVector<int64_t, 2> 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 @@ static LLVMArrayType parseArrayType(DialectAsmParser &parser,
llvm::SetVector<StringRef> &stack) {
SmallVector<int64_t, 1> 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 @@ static LLVMArrayType parseArrayType(DialectAsmParser &parser,
/// 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<LLVMTypeNew> subtypes,
+ ArrayRef<LLVMType> subtypes,
bool isPacked, DialectAsmParser &parser,
llvm::SMLoc subtypesLoc,
llvm::SetVector<StringRef> &stack) {
@@ -398,12 +396,12 @@ static LLVMStructType parseStructType(DialectAsmParser &parser,
// Parse subtypes. For identified structs, put the identifier of the struct on
// the stack to support self-references in the recursive calls.
- SmallVector<LLVMTypeNew, 4> subtypes;
+ SmallVector<LLVMType, 4> 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 @@ static LLVMStructType parseStructType(DialectAsmParser &parser,
}
/// Parses one of the LLVM dialect types.
-static LLVMTypeNew parseTypeImpl(DialectAsmParser &parser,
- llvm::SetVector<StringRef> &stack) {
+static LLVMType parseTypeImpl(DialectAsmParser &parser,
+ llvm::SetVector<StringRef> &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 @@ static LLVMTypeNew parseTypeImpl(DialectAsmParser &parser,
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 @@ static LLVMTypeNew parseTypeImpl(DialectAsmParser &parser,
// Dispatch to concrete functions.
StringRef key;
if (failed(parser.parseKeyword(&key)))
- return LLVMTypeNew();
+ return LLVMType();
- return llvm::StringSwitch<function_ref<LLVMTypeNew()>>(key)
+ return llvm::StringSwitch<function_ref<LLVMType()>>(key)
.Case("void", [&] { return LLVMVoidType::get(ctx); })
.Case("half", [&] { return LLVMHalfType::get(ctx); })
.Case("bfloat", [&] { return LLVMBFloatType::get(ctx); })
@@ -467,11 +465,11 @@ static LLVMTypeNew parseTypeImpl(DialectAsmParser &parser,
.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<StringRef> stack;
return parseTypeImpl(parser, stack);
}
diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
index abecbccb1d4a..fa25f2dcdad8 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
@@ -24,92 +24,89 @@ using namespace mlir;
using namespace mlir::LLVM;
//===----------------------------------------------------------------------===//
-// LLVMTypeNew.
+// LLVMType.
//===----------------------------------------------------------------------===//
-// TODO: when these types are registered with the LLVMDialect, this method
-// should be removed and the regular Type::getDialect should just work.
-LLVMDialect &LLVMTypeNew::getDialect() {
- return *getContext()->getRegisteredDialect<LLVM::LLVMDialect>();
+LLVMDialect &LLVMType::getDialect() {
+ return static_cast<LLVMDialect &>(Type::getDialect());
}
//----------------------------------------------------------------------------//
// Integer type utilities.
-bool LLVMTypeNew::isIntegerTy(unsigned bitwidth) {
+bool LLVMType::isIntegerTy(unsigned bitwidth) {
if (auto intType = dyn_cast<LLVMIntegerType>())
return intType.getBitWidth() == bitwidth;
return false;
}
-
-unsigned LLVMTypeNew::getIntegerBitWidth() {
+unsigned LLVMType::getIntegerBitWidth() {
return cast<LLVMIntegerType>().getBitWidth();
}
-LLVMTypeNew LLVMTypeNew::getArrayElementType() {
+LLVMType LLVMType::getArrayElementType() {
return cast<LLVMArrayType>().getElementType();
}
//----------------------------------------------------------------------------//
// Array type utilities.
-unsigned LLVMTypeNew::getArrayNumElements() {
+unsigned LLVMType::getArrayNumElements() {
return cast<LLVMArrayType>().getNumElements();
}
-bool LLVMTypeNew::isArrayTy() { return isa<LLVMArrayType>(); }
+bool LLVMType::isArrayTy() { return isa<LLVMArrayType>(); }
//----------------------------------------------------------------------------//
// Vector type utilities.
-LLVMTypeNew LLVMTypeNew::getVectorElementType() {
+LLVMType LLVMType::getVectorElementType() {
return cast<LLVMVectorType>().getElementType();
}
-unsigned LLVMTypeNew::getVectorNumElements() {
+unsigned LLVMType::getVectorNumElements() {
return cast<LLVMFixedVectorType>().getNumElements();
}
-llvm::ElementCount LLVMTypeNew::getVectorElementCount() {
+llvm::ElementCount LLVMType::getVectorElementCount() {
return cast<LLVMVectorType>().getElementCount();
}
-bool LLVMTypeNew::isVectorTy() { return isa<LLVMVectorType>(); }
+bool LLVMType::isVectorTy() { return isa<LLVMVectorType>(); }
//----------------------------------------------------------------------------//
// Function type utilities.
-LLVMTypeNew LLVMTypeNew::getFunctionParamType(unsigned argIdx) {
+LLVMType LLVMType::getFunctionParamType(unsigned argIdx) {
return cast<LLVMFunctionType>().getParamType(argIdx);
}
-unsigned LLVMTypeNew::getFunctionNumParams() {
+unsigned LLVMType::getFunctionNumParams() {
return cast<LLVMFunctionType>().getNumParams();
}
-LLVMTypeNew LLVMTypeNew::getFunctionResultType() {
+LLVMType LLVMType::getFunctionResultType() {
return cast<LLVMFunctionType>().getReturnType();
}
-bool LLVMTypeNew::isFunctionTy() { return isa<LLVMFunctionType>(); }
+bool LLVMType::isFunctionTy() { return isa<LLVMFunctionType>(); }
-bool LLVMTypeNew::isFunctionVarArg() {
+bool LLVMType::isFunctionVarArg() {
return cast<LLVMFunctionType>().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<LLVMPointerType>().getElementType();
}
-bool LLVMTypeNew::isPointerTy() { return isa<LLVMPointerType>(); }
+bool LLVMType::isPointerTy() { return isa<LLVMPointerType>(); }
-bool LLVMTypeNew::isValidPointerElementType(LLVMTypeNew type) {
+bool LLVMType::isValidPointerElementType(LLVMType type) {
return !type.isa<LLVMVoidType>() && !type.isa<LLVMTokenType>() &&
!type.isa<LLVMMetadataType>() && !type.isa<LLVMLabelType>();
}
@@ -117,91 +114,86 @@ bool LLVMTypeNew::isValidPointerElementType(LLVMTypeNew type) {
//----------------------------------------------------------------------------//
// Struct type utilities.
-LLVMTypeNew LLVMTypeNew::getStructElementType(unsigned i) {
+LLVMType LLVMType::getStructElementType(unsigned i) {
return cast<LLVMStructType>().getBody()[i];
}
-unsigned LLVMTypeNew::getStructNumElements() {
+unsigned LLVMType::getStructNumElements() {
return cast<LLVMStructType>().getBody().size();
}
-bool LLVMTypeNew::isStructTy() { return isa<LLVMStructType>(); }
+bool LLVMType::isStructTy() { return isa<LLVMStructType>(); }
//----------------------------------------------------------------------------//
// 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<LLVMTypeNew> params,
- bool isVarArg) {
+LLVMType LLVMType::getFunctionTy(LLVMType result, ArrayRef<LLVMType> params,
+ bool isVarArg) {
return LLVMFunctionType::get(result, params, isVarArg);
}
-LLVMTypeNew LLVMTypeNew::getStructTy(LLVMDialect *dialect,
- ArrayRef<LLVMTypeNew> elements,
- bool isPacked) {
+LLVMType LLVMType::getStructTy(LLVMDialect *dialect,
+ ArrayRef<LLVMType> 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<LLVMVoidType>(); }
+bool LLVMType::isVoidTy() { return isa<LLVMVoidType>(); }
//----------------------------------------------------------------------------//
// Creation and setting of LLVM's identified struct types
-LLVMTypeNew LLVMTypeNew::createStructTy(LLVMDialect *dialect,
- ArrayRef<LLVMTypeNew> elements,
- Optional<StringRef> name,
- bool isPacked) {
+LLVMType LLVMType::createStructTy(LLVMDialect *dialect,
+ ArrayRef<LLVMType> elements,
+ Optional<StringRef> name, bool isPacked) {
assert(name.hasValue() &&
"identified structs with no identifier not supported");
StringRef stringNameBase = name.getValueOr("");
@@ -220,9 +212,8 @@ LLVMTypeNew LLVMTypeNew::createStructTy(LLVMDialect *dialect,
} while (true);
}
-LLVMTypeNew LLVMTypeNew::setStructTyBody(LLVMTypeNew structType,
- ArrayRef<LLVMTypeNew> elements,
- bool isPacked) {
+LLVMType LLVMType::setStructTyBody(LLVMType structType,
+ ArrayRef<LLVMType> elements, bool isPacked) {
LogicalResult couldSet =
structType.cast<LLVMStructType>().setBody(elements, isPacked);
assert(succeeded(couldSet) && "failed to set the body");
@@ -233,29 +224,28 @@ LLVMTypeNew LLVMTypeNew::setStructTyBody(LLVMTypeNew structType,
//===----------------------------------------------------------------------===//
// 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<LLVMTypeNew> arguments,
+LLVMFunctionType LLVMFunctionType::get(LLVMType result,
+ ArrayRef<LLVMType> 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 +253,13 @@ unsigned LLVMFunctionType::getNumParams() {
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<LLVMTypeNew> LLVMFunctionType::getParams() {
+ArrayRef<LLVMType> LLVMFunctionType::getParams() {
return getImpl()->getArgumentTypes();
}
@@ -277,7 +267,7 @@ ArrayRef<LLVMTypeNew> LLVMFunctionType::getParams() {
// 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 +275,13 @@ unsigned LLVMIntegerType::getBitWidth() { return getImpl()->bitwidth; }
//===----------------------------------------------------------------------===//
// 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 +290,20 @@ unsigned LLVMPointerType::getAddressSpace() { return getImpl()->addressSpace; }
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<LLVMTypeNew> types,
+ ArrayRef<LLVMType> 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<LLVMTypeNew> types,
- bool isPacked) {
+LogicalResult LLVMStructType::setBody(ArrayRef<LLVMType> types, bool isPacked) {
assert(isIdentified() && "can only set bodies of identified structs");
return Base::mutate(types, isPacked);
}
@@ -327,7 +315,7 @@ bool LLVMStructType::isOpaque() {
}
bool LLVMStructType::isInitialized() { return getImpl()->isInitialized(); }
StringRef LLVMStructType::getName() { return getImpl()->getIdentifier(); }
-ArrayRef<LLVMTypeNew> LLVMStructType::getBody() {
+ArrayRef<LLVMType> LLVMStructType::getBody() {
return isIdentified() ? getImpl()->getIdentifiedStructBody()
: getImpl()->getTypeList();
}
@@ -335,7 +323,7 @@ ArrayRef<LLVMTypeNew> LLVMStructType::getBody() {
//===----------------------------------------------------------------------===//
// Vector types.
-LLVMTypeNew LLVMVectorType::getElementType() {
+LLVMType LLVMVectorType::getElementType() {
// Both derived classes share the implementation type.
return static_cast<detail::LLVMTypeAndSizeStorage *>(impl)->elementType;
}
@@ -347,10 +335,10 @@ llvm::ElementCount LLVMVectorType::getElementCount() {
this->isa<LLVMScalableVectorType>());
}
-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<LLVMFixedVectorType>();
}
@@ -359,10 +347,10 @@ unsigned LLVMFixedVectorType::getNumElements() {
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<LLVMScalableVectorType>();
}
diff --git a/mlir/lib/Dialect/LLVMIR/IR/TypeDetail.h b/mlir/lib/Dialect/LLVMIR/IR/TypeDetail.h
index 2b72e43e5164..3f2cc13299a4 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/TypeDetail.h
+++ b/mlir/lib/Dialect/LLVMIR/IR/TypeDetail.h
@@ -72,7 +72,7 @@ struct LLVMStructTypeStorage : public TypeStorage {
Key(StringRef name, bool opaque)
: name(name), identified(true), packed(false), opaque(opaque) {}
/// Constructs a key for a literal struct.
- Key(ArrayRef<LLVMTypeNew> types, bool packed)
+ Key(ArrayRef<LLVMType> types, bool packed)
: types(types), identified(false), packed(packed), opaque(false) {}
/// Checks a specific property of the struct.
@@ -96,7 +96,7 @@ struct LLVMStructTypeStorage : public TypeStorage {
}
/// Returns the list of type contained in the key of a literal struct.
- ArrayRef<LLVMTypeNew> getTypeList() const {
+ ArrayRef<LLVMType> getTypeList() const {
assert(!isIdentified() &&
"identified struct key cannot have a type list");
return types;
@@ -138,7 +138,7 @@ struct LLVMStructTypeStorage : public TypeStorage {
}
private:
- ArrayRef<LLVMTypeNew> types;
+ ArrayRef<LLVMType> types;
StringRef name;
bool identified;
bool packed;
@@ -153,19 +153,18 @@ struct LLVMStructTypeStorage : public TypeStorage {
}
/// Returns the list of types (partially) identifying a literal struct.
- ArrayRef<LLVMTypeNew> getTypeList() const {
+ ArrayRef<LLVMType> getTypeList() const {
// If this triggers, use getIdentifiedStructBody() instead.
assert(!isIdentified() && "requested typelist on an identified struct");
- return ArrayRef<LLVMTypeNew>(static_cast<const LLVMTypeNew *>(keyPtr),
- keySize());
+ return ArrayRef<LLVMType>(static_cast<const LLVMType *>(keyPtr), keySize());
}
/// Returns the list of types contained in an identified struct.
- ArrayRef<LLVMTypeNew> getIdentifiedStructBody() const {
+ ArrayRef<LLVMType> getIdentifiedStructBody() const {
// If this triggers, use getTypeList() instead.
assert(isIdentified() &&
"requested struct body on a non-identified struct");
- return ArrayRef<LLVMTypeNew>(identifiedBodyArray, identifiedBodySize());
+ return ArrayRef<LLVMType>(identifiedBodyArray, identifiedBodySize());
}
/// Checks whether the struct is identified.
@@ -200,7 +199,7 @@ struct LLVMStructTypeStorage : public TypeStorage {
/// as initalized and can no longer be mutated.
LLVMStructTypeStorage(const KeyTy &key) {
if (!key.isIdentified()) {
- ArrayRef<LLVMTypeNew> types = key.getTypeList();
+ ArrayRef<LLVMType> types = key.getTypeList();
keyPtr = static_cast<const void *>(types.data());
setKeySize(types.size());
llvm::Bitfield::set<KeyFlagPacked>(keySizeAndFlags, key.isPacked());
@@ -233,8 +232,8 @@ struct LLVMStructTypeStorage : public TypeStorage {
/// 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<LLVMTypeNew> body, bool packed) {
+ LogicalResult mutate(TypeStorageAllocator &allocator, ArrayRef<LLVMType> body,
+ bool packed) {
if (!isIdentified())
return failure();
if (isInitialized())
@@ -245,7 +244,7 @@ struct LLVMStructTypeStorage : public TypeStorage {
true);
llvm::Bitfield::set<MutableFlagPacked>(identifiedBodySizeAndFlags, packed);
- ArrayRef<LLVMTypeNew> typesInAllocator = allocator.copyInto(body);
+ ArrayRef<LLVMType> typesInAllocator = allocator.copyInto(body);
identifiedBodyArray = typesInAllocator.data();
setIdentifiedBodySize(typesInAllocator.size());
@@ -311,7 +310,7 @@ struct LLVMStructTypeStorage : public TypeStorage {
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 @@ struct LLVMStructTypeStorage : public TypeStorage {
/// 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<LLVMTypeNew, ArrayRef<LLVMTypeNew>, bool>;
+ using KeyTy = std::tuple<LLVMType, ArrayRef<LLVMType>, bool>;
/// Construct a storage from the given components. The list is expected to be
/// allocated in the context.
- LLVMFunctionTypeStorage(LLVMTypeNew result, ArrayRef<LLVMTypeNew> arguments,
+ LLVMFunctionTypeStorage(LLVMType result, ArrayRef<LLVMType> arguments,
bool variadic)
: argumentTypes(arguments) {
returnTypeAndVariadic.setPointerAndInt(result, variadic);
@@ -360,21 +359,19 @@ struct LLVMFunctionTypeStorage : public TypeStorage {
}
/// Returns the list of function argument types.
- ArrayRef<LLVMTypeNew> getArgumentTypes() const { return argumentTypes; }
+ ArrayRef<LLVMType> 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<LLVMTypeNew, 1, bool> returnTypeAndVariadic;
+ llvm::PointerIntPair<LLVMType, 1, bool> returnTypeAndVariadic;
/// Argument types.
- ArrayRef<LLVMTypeNew> argumentTypes;
+ ArrayRef<LLVMType> argumentTypes;
};
//===----------------------------------------------------------------------===//
@@ -405,7 +402,7 @@ struct LLVMIntegerTypeStorage : public TypeStorage {
/// 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<LLVMTypeNew, unsigned>;
+ using KeyTy = std::tuple<LLVMType, unsigned>;
LLVMPointerTypeStorage(const KeyTy &key)
: pointeeType(std::get<0>(key)), addressSpace(std::get<1>(key)) {}
@@ -420,7 +417,7 @@ struct LLVMPointerTypeStorage : public TypeStorage {
return std::make_tuple(pointeeType, addressSpace) == key;
}
- LLVMTypeNew pointeeType;
+ LLVMType pointeeType;
unsigned addressSpace;
};
@@ -432,7 +429,7 @@ struct LLVMPointerTypeStorage : public TypeStorage {
/// 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<LLVMTypeNew, unsigned>;
+ using KeyTy = std::tuple<LLVMType, unsigned>;
LLVMTypeAndSizeStorage(const KeyTy &key)
: elementType(std::get<0>(key)), numElements(std::get<1>(key)) {}
@@ -447,7 +444,7 @@ struct LLVMTypeAndSizeStorage : public TypeStorage {
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
index 6b068660d98f..5107efe28971 100644
--- 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"
@@ -932,7 +933,9 @@ LogicalResult ModuleTranslation::convertFunctions() {
}
llvm::Type *ModuleTranslation::convertType(LLVMType type) {
- return LLVM::convertLLVMType(type);
+ // Lock the LLVM context as we create types in it.
+ llvm::sys::SmartScopedLock<true> 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
index 6163334d3b4e..15e0f158007a 100644
--- a/mlir/lib/Target/LLVMIR/TypeTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/TypeTranslation.cpp
@@ -24,14 +24,14 @@ class TypeToLLVMIRTranslator {
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<LLVM::LLVMTypeNew, llvm::Type *>(type)
+ llvm::TypeSwitch<LLVM::LLVMType, llvm::Type *>(type)
.Case([this](LLVM::LLVMVoidType) {
return llvm::Type::getVoidTy(context);
})
@@ -73,7 +73,7 @@ class TypeToLLVMIRTranslator {
LLVM::LLVMStructType, LLVM::LLVMFixedVectorType,
LLVM::LLVMScalableVectorType>(
[this](auto array) { return translate(array); })
- .Default([](LLVM::LLVMTypeNew t) -> llvm::Type * {
+ .Default([](LLVM::LLVMType t) -> llvm::Type * {
llvm_unreachable("unknown LLVM dialect type");
});
@@ -144,7 +144,7 @@ class TypeToLLVMIRTranslator {
}
/// Translates a list of types.
- void translateTypes(ArrayRef<LLVM::LLVMTypeNew> types,
+ void translateTypes(ArrayRef<LLVM::LLVMType> types,
SmallVectorImpl<llvm::Type *> &result) {
result.reserve(result.size() + types.size());
for (auto type : types)
@@ -158,14 +158,14 @@ class TypeToLLVMIRTranslator {
/// 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<LLVM::LLVMTypeNew, llvm::Type *> knownTranslations;
+ llvm::DenseMap<LLVM::LLVMType, llvm::Type *> 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);
}
@@ -178,12 +178,12 @@ class TypeFromLLVMIRTranslator {
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<llvm::Type *, LLVM::LLVMTypeNew>(type)
+ LLVM::LLVMType translated =
+ llvm::TypeSwitch<llvm::Type *, LLVM::LLVMType>(type)
.Case<llvm::ArrayType, llvm::FunctionType, llvm::IntegerType,
llvm::PointerType, llvm::StructType, llvm::FixedVectorType,
llvm::ScalableVectorType>(
@@ -198,7 +198,7 @@ class TypeFromLLVMIRTranslator {
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())
@@ -225,33 +225,33 @@ class TypeFromLLVMIRTranslator {
}
/// Translates the given array type.
- LLVM::LLVMTypeNew translate(llvm::ArrayType *type) {
+ LLVM::LLVMType translate(llvm::ArrayType *type) {
return LLVM::LLVMArrayType::get(translateType(type->getElementType()),
type->getNumElements());
}
/// Translates the given function type.
- LLVM::LLVMTypeNew translate(llvm::FunctionType *type) {
- SmallVector<LLVM::LLVMTypeNew, 8> paramTypes;
+ LLVM::LLVMType translate(llvm::FunctionType *type) {
+ SmallVector<LLVM::LLVMType, 8> paramTypes;
translateTypes(type->params(), paramTypes);
return LLVM::LLVMFunctionType::get(translateType(type->getReturnType()),
paramTypes, type->isVarArg());
}
/// Translates the given integer type.
- LLVM::LLVMTypeNew translate(llvm::IntegerType *type) {
+ LLVM::LLVMType translate(llvm::IntegerType *type) {
return LLVM::LLVMIntegerType::get(&context, type->getBitWidth());
}
/// Translates the given pointer type.
- LLVM::LLVMTypeNew translate(llvm::PointerType *type) {
+ LLVM::LLVMType translate(llvm::PointerType *type) {
return LLVM::LLVMPointerType::get(translateType(type->getElementType()),
type->getAddressSpace());
}
/// Translates the given structure type.
- LLVM::LLVMTypeNew translate(llvm::StructType *type) {
- SmallVector<LLVM::LLVMTypeNew, 8> subtypes;
+ LLVM::LLVMType translate(llvm::StructType *type) {
+ SmallVector<LLVM::LLVMType, 8> subtypes;
if (type->isLiteral()) {
translateTypes(type->subtypes(), subtypes);
return LLVM::LLVMStructType::getLiteral(&context, subtypes,
@@ -273,20 +273,20 @@ class TypeFromLLVMIRTranslator {
}
/// Translates the given fixed-vector type.
- LLVM::LLVMTypeNew translate(llvm::FixedVectorType *type) {
+ LLVM::LLVMType translate(llvm::FixedVectorType *type) {
return LLVM::LLVMFixedVectorType::get(translateType(type->getElementType()),
type->getNumElements());
}
/// Translates the given scalable-vector type.
- LLVM::LLVMTypeNew translate(llvm::ScalableVectorType *type) {
+ LLVM::LLVMType translate(llvm::ScalableVectorType *type) {
return LLVM::LLVMScalableVectorType::get(
translateType(type->getElementType()), type->getMinNumElements());
}
/// Translates a list of types.
void translateTypes(ArrayRef<llvm::Type *> types,
- SmallVectorImpl<LLVM::LLVMTypeNew> &result) {
+ SmallVectorImpl<LLVM::LLVMType> &result) {
result.reserve(result.size() + types.size());
for (llvm::Type *type : types)
result.push_back(translateType(type));
@@ -294,7 +294,7 @@ class TypeFromLLVMIRTranslator {
/// Map of known translations. Serves as a cache and as recursion stopper for
/// translating recursive structs.
- llvm::DenseMap<llvm::Type *, LLVM::LLVMTypeNew> knownTranslations;
+ llvm::DenseMap<llvm::Type *, LLVM::LLVMType> knownTranslations;
/// The context in which MLIR types are created.
MLIRContext &context;
@@ -303,7 +303,7 @@ class TypeFromLLVMIRTranslator {
/// 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
index bdcde0be60c2..f5c085224f07 100644
--- 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 @@ module attributes {gpu.container_module} {
// 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<float>) attributes {gpu.kernel} {
llvm.return
}
}
llvm.func @foo() {
%0 = "op"() : () -> (!llvm.float)
- %1 = "op"() : () -> (!llvm<"float*">)
+ %1 = "op"() : () -> (!llvm.ptr<float>)
%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<i8>
+ // CHECK: %[[module:.*]] = llvm.call @mgpuModuleLoad(%[[binary]]) : (!llvm.ptr<i8>) -> !llvm.ptr<i8>
+ // CHECK: %[[func:.*]] = llvm.call @mgpuModuleGetFunction(%[[module]], {{.*}}) : (!llvm.ptr<i8>, !llvm.ptr<i8>) -> !llvm.ptr<i8>
// 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<float>) -> ()
llvm.return
}
diff --git a/mlir/test/Conversion/GPUCommon/memory-attrbution.mlir b/mlir/test/Conversion/GPUCommon/memory-attrbution.mlir
index c13afefdb78d..a2764d424205 100644
--- a/mlir/test/Conversion/GPUCommon/memory-attrbution.mlir
+++ b/mlir/test/Conversion/GPUCommon/memory-attrbution.mlir
@@ -6,13 +6,13 @@ gpu.module @kernel {
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<float>
// 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<float, 5>
// 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<float>, ptr<float>, 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 @@ gpu.module @kernel {
// 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<float, 5>, ptr<float, 5>, 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 @@ gpu.module @kernel {
// 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.module @kernel {
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<array<4 x float>, 3>
// NVVM: %[[raw:.*]] = llvm.getelementptr %[[addr]][%[[c0]], %[[c0]]]
- // NVVM-SAME: !llvm<"float addrspace(3)*">
+ // NVVM-SAME: !llvm.ptr<float, 3>
// 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<array<4 x float>, 3>
// ROCDL: %[[raw:.*]] = llvm.getelementptr %[[addr]][%[[c0]], %[[c0]]]
- // ROCDL-SAME: !llvm<"float addrspace(3)*">
+ // ROCDL-SAME: !llvm.ptr<float, 3>
// 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<float, 3>, ptr<float, 3>, 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 @@ gpu.module @kernel {
// 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<float, 3>, ptr<float, 3>, 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 @@ gpu.module @kernel {
// 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<array<48 x float>, 3>
// NVVM: %[[raw:.*]] = llvm.getelementptr %[[addr]][%[[c0]], %[[c0]]]
- // NVVM-SAME: !llvm<"float addrspace(3)*">
+ // NVVM-SAME: !llvm.ptr<float, 3>
// 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<array<48 x float>, 3>
// ROCDL: %[[raw:.*]] = llvm.getelementptr %[[addr]][%[[c0]], %[[c0]]]
- // ROCDL-SAME: !llvm<"float addrspace(3)*">
+ // ROCDL-SAME: !llvm.ptr<float, 3>
// 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<float, 3>, ptr<float, 3>, 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 @@ gpu.module @kernel {
// 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<float, 3>, ptr<float, 3>, 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 {
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 @@ gpu.module @kernel {
// 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<float>
// 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<float>
// 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<float, 5>
// 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<float, 5>
%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
index 78b9f56b6202..d103031fbd54 100644
--- 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<float>)
// 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
index fa9a478c1d83..df38df1749cb 100644
--- a/mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir
+++ b/mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir
@@ -120,9 +120,9 @@ gpu.module @test_module {
// 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
index 5ee3bb21aa91..d88f842a2186 100644
--- 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<float>)
// 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
index f944d007ebaa..e39bfa41e692 100644
--- 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<i8>
// 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<i8>, !llvm.i32, !llvm.i32, !llvm.ptr<struct<(ptr<float>, ptr<float>, 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<i8>, !llvm.ptr<i8>, !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<i8>, !llvm.ptr<i8>) -> !llvm.void
+// CHECK: llvm.call @setNumWorkGroups(%[[Vulkan_Runtime_ptr]], %{{.*}}, %{{.*}}, %{{.*}}) : (!llvm.ptr<i8>, !llvm.i64, !llvm.i64, !llvm.i64) -> !llvm.void
+// CHECK: llvm.call @runOnVulkan(%[[Vulkan_Runtime_ptr]]) : (!llvm.ptr<i8>) -> !llvm.void
+// CHECK: llvm.call @deinitVulkan(%[[Vulkan_Runtime_ptr]]) : (!llvm.ptr<i8>) -> !llvm.void
module attributes {gpu.container_module} {
- llvm.func @malloc(!llvm.i64) -> !llvm<"i8*">
+ llvm.func @malloc(!llvm.i64) -> !llvm.ptr<i8>
llvm.func @foo() {
%0 = llvm.mlir.constant(12 : index) : !llvm.i64
- %1 = llvm.mlir.null : !llvm<"float*">
+ %1 = llvm.mlir.null : !llvm.ptr<float>
%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<float>, !llvm.i64) -> !llvm.ptr<float>
+ %4 = llvm.ptrtoint %3 : !llvm.ptr<float> 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<i8>
+ %7 = llvm.bitcast %6 : !llvm.ptr<i8> to !llvm.ptr<float>
+ %8 = llvm.mlir.undef : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %9 = llvm.insertvalue %7, %8[0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %10 = llvm.insertvalue %7, %9[1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %15 = llvm.insertvalue %13, %14[4, 0] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %18 = llvm.extractvalue %15[1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %19 = llvm.extractvalue %15[2] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %20 = llvm.extractvalue %15[3, 0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %21 = llvm.extractvalue %15[4, 0] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, !llvm.ptr<float>, !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<float>, %arg7: !llvm.ptr<float>, %arg8: !llvm.i64, %arg9: !llvm.i64, %arg10: !llvm.i64) {
+ %0 = llvm.mlir.undef : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %1 = llvm.insertvalue %arg6, %0[0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %2 = llvm.insertvalue %arg7, %1[1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %3 = llvm.insertvalue %arg8, %2[2] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %4 = llvm.insertvalue %arg9, %3[3, 0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %5 = llvm.insertvalue %arg10, %4[4, 0] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)> : (!llvm.i64) -> !llvm.ptr<struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>>
+ llvm.store %5, %7 : !llvm.ptr<struct<(ptr<float>, ptr<float>, 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<struct<(ptr<float>, ptr<float>, 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<struct<(ptr<float>, ptr<float>, 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
index 8ae0d9840713..a37e82bf5995 100644
--- a/mlir/test/Conversion/SPIRVToLLVM/arithmetic-ops-to-llvm.mlir
+++ b/mlir/test/Conversion/SPIRVToLLVM/arithmetic-ops-to-llvm.mlir
@@ -13,7 +13,7 @@ func @iadd_scalar(%arg0: i32, %arg1: i32) {
// CHECK-LABEL: @iadd_vector
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
}
@@ -31,7 +31,7 @@ func @isub_scalar(%arg0: i8, %arg1: i8) {
// CHECK-LABEL: @isub_vector
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
}
@@ -49,7 +49,7 @@ func @imul_scalar(%arg0: i32, %arg1: i32) {
// CHECK-LABEL: @imul_vector
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
}
@@ -67,7 +67,7 @@ func @fadd_scalar(%arg0: f16, %arg1: f16) {
// CHECK-LABEL: @fadd_vector
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
}
@@ -85,7 +85,7 @@ func @fsub_scalar(%arg0: f32, %arg1: f32) {
// CHECK-LABEL: @fsub_vector
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
}
@@ -103,7 +103,7 @@ func @fdiv_scalar(%arg0: f32, %arg1: f32) {
// CHECK-LABEL: @fdiv_vector
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
}
@@ -121,7 +121,7 @@ func @fmul_scalar(%arg0: f32, %arg1: f32) {
// CHECK-LABEL: @fmul_vector
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
}
@@ -139,7 +139,7 @@ func @frem_scalar(%arg0: f32, %arg1: f32) {
// CHECK-LABEL: @frem_vector
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
}
@@ -157,7 +157,7 @@ func @fneg_scalar(%arg: f64) {
// CHECK-LABEL: @fneg_vector
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
}
@@ -175,7 +175,7 @@ func @udiv_scalar(%arg0: i32, %arg1: i32) {
// CHECK-LABEL: @udiv_vector
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
}
@@ -193,7 +193,7 @@ func @umod_scalar(%arg0: i32, %arg1: i32) {
// CHECK-LABEL: @umod_vector
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
}
@@ -211,7 +211,7 @@ func @sdiv_scalar(%arg0: i16, %arg1: i16) {
// CHECK-LABEL: @sdiv_vector
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
}
@@ -229,7 +229,7 @@ func @srem_scalar(%arg0: i32, %arg1: i32) {
// CHECK-LABEL: @srem_vector
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
index aed82d218db2..e37072c7282d 100644
--- a/mlir/test/Conversion/SPIRVToLLVM/bitwise-ops-to-llvm.mlir
+++ b/mlir/test/Conversion/SPIRVToLLVM/bitwise-ops-to-llvm.mlir
@@ -13,7 +13,7 @@ func @bitcount_scalar(%arg0: i16) {
// CHECK-LABEL: @bitcount_vector
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
}
@@ -31,7 +31,7 @@ func @bitreverse_scalar(%arg0: i64) {
// CHECK-LABEL: @bitreverse_vector
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
}
@@ -89,27 +89,27 @@ func @bitfield_insert_scalar_greater_bit_width(%base: i16, %insert: i16, %offset
return
}
-// CHECK-LABEL: @bitfield_insert_vector
-// CHECK-SAME: %[[BASE:.*]]: !llvm<"<2 x i32>">, %[[INSERT:.*]]: !llvm<"<2 x i32>">, %[[OFFSET:.*]]: !llvm.i32, %[[COUNT:.*]]: !llvm.i32
+// CHECK-LABEL: func @bitfield_insert_vector
+// 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
}
@@ -161,25 +161,25 @@ func @bitfield_sextract_scalar_greater_bit_width(%base: i32, %offset: i64, %coun
return
}
-// CHECK-LABEL: @bitfield_sextract_vector
-// CHECK-SAME: %[[BASE:.*]]: !llvm<"<2 x i32>">, %[[OFFSET:.*]]: !llvm.i32, %[[COUNT:.*]]: !llvm.i32
+// CHECK-LABEL: func @bitfield_sextract_vector
+// 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
}
@@ -227,24 +227,24 @@ func @bitfield_uextract_scalar_greater_bit_width(%base: i8, %offset: i16, %count
return
}
-// CHECK-LABEL: @bitfield_uextract_vector
-// CHECK-SAME: %[[BASE:.*]]: !llvm<"<2 x i32>">, %[[OFFSET:.*]]: !llvm.i32, %[[COUNT:.*]]: !llvm.i32
+// CHECK-LABEL: func @bitfield_uextract_vector
+// 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
}
@@ -262,7 +262,7 @@ func @bitwise_and_scalar(%arg0: i32, %arg1: i32) {
// CHECK-LABEL: @bitwise_and_vector
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
}
@@ -280,7 +280,7 @@ func @bitwise_or_scalar(%arg0: i64, %arg1: i64) {
// CHECK-LABEL: @bitwise_or_vector
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
}
@@ -298,7 +298,7 @@ func @bitwise_xor_scalar(%arg0: i32, %arg1: i32) {
// CHECK-LABEL: @bitwise_xor_vector
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
}
@@ -317,8 +317,8 @@ func @not_scalar(%arg0: i32) {
// CHECK-LABEL: @not_vector
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
index a0434aad3bea..5071783073c2 100644
--- a/mlir/test/Conversion/SPIRVToLLVM/cast-ops-to-llvm.mlir
+++ b/mlir/test/Conversion/SPIRVToLLVM/cast-ops-to-llvm.mlir
@@ -13,35 +13,35 @@ func @bitcast_float_to_integer_scalar(%arg0 : f32) {
// CHECK-LABEL: @bitcast_float_to_integer_vector
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
}
// CHECK-LABEL: @bitcast_vector_to_scalar
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
}
// CHECK-LABEL: @bitcast_scalar_to_vector
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
}
// CHECK-LABEL: @bitcast_vector_to_vector
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
}
// CHECK-LABEL: @bitcast_pointer
func @bitcast_pointer(%arg0: !spv.ptr<f32, Function>) {
- // CHECK: llvm.bitcast %{{.*}} : !llvm<"float*"> to !llvm<"i32*">
+ // CHECK: llvm.bitcast %{{.*}} : !llvm.ptr<float> to !llvm.ptr<i32>
%0 = spv.Bitcast %arg0 : !spv.ptr<f32, Function> to !spv.ptr<i32, Function>
return
}
@@ -59,8 +59,8 @@ func @convert_float_to_signed_scalar(%arg0: f32) {
// CHECK-LABEL: @convert_float_to_signed_vector
func @convert_float_to_signed_vector(%arg0: vector<2xf32>) {
- // CHECK: llvm.fptosi %{{.*}} : !llvm<"<2 x float>"> to !llvm<"<2 x i32>">
- %0 = spv.ConvertFToS %arg0: vector<2xf32> to vector<2xi32>
+ // CHECK: llvm.fptosi %{{.*}} : !llvm.vec<2 x float> to !llvm.vec<2 x i32>
+ %0 = spv.ConvertFToS %arg0: vector<2xf32> to vector<2xi32>
return
}
@@ -77,8 +77,8 @@ func @convert_float_to_unsigned_scalar(%arg0: f32) {
// CHECK-LABEL: @convert_float_to_unsigned_vector
func @convert_float_to_unsigned_vector(%arg0: vector<2xf32>) {
- // CHECK: llvm.fptoui %{{.*}} : !llvm<"<2 x float>"> to !llvm<"<2 x i32>">
- %0 = spv.ConvertFToU %arg0: vector<2xf32> to vector<2xi32>
+ // CHECK: llvm.fptoui %{{.*}} : !llvm.vec<2 x float> to !llvm.vec<2 x i32>
+ %0 = spv.ConvertFToU %arg0: vector<2xf32> to vector<2xi32>
return
}
@@ -95,8 +95,8 @@ func @convert_signed_to_float_scalar(%arg0: i32) {
// CHECK-LABEL: @convert_signed_to_float_vector
func @convert_signed_to_float_vector(%arg0: vector<3xi32>) {
- // CHECK: llvm.sitofp %{{.*}} : !llvm<"<3 x i32>"> to !llvm<"<3 x float>">
- %0 = spv.ConvertSToF %arg0: vector<3xi32> to vector<3xf32>
+ // CHECK: llvm.sitofp %{{.*}} : !llvm.vec<3 x i32> to !llvm.vec<3 x float>
+ %0 = spv.ConvertSToF %arg0: vector<3xi32> to vector<3xf32>
return
}
@@ -113,8 +113,8 @@ func @convert_unsigned_to_float_scalar(%arg0: i32) {
// CHECK-LABEL: @convert_unsigned_to_float_vector
func @convert_unsigned_to_float_vector(%arg0: vector<3xi32>) {
- // CHECK: llvm.uitofp %{{.*}} : !llvm<"<3 x i32>"> to !llvm<"<3 x float>">
- %0 = spv.ConvertUToF %arg0: vector<3xi32> to vector<3xf32>
+ // CHECK: llvm.uitofp %{{.*}} : !llvm.vec<3 x i32> to !llvm.vec<3 x float>
+ %0 = spv.ConvertUToF %arg0: vector<3xi32> to vector<3xf32>
return
}
@@ -134,10 +134,10 @@ func @fconvert_scalar(%arg0: f32, %arg1: f64) {
// CHECK-LABEL: @fconvert_vector
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
}
@@ -158,10 +158,10 @@ func @sconvert_scalar(%arg0: i32, %arg1: i64) {
// CHECK-LABEL: @sconvert_vector
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
}
@@ -182,10 +182,10 @@ func @uconvert_scalar(%arg0: i32, %arg1: i64) {
// CHECK-LABEL: @uconvert_vector
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
index bcfe234f7080..0592d59ba6ee 100644
--- a/mlir/test/Conversion/SPIRVToLLVM/comparison-ops-to-llvm.mlir
+++ b/mlir/test/Conversion/SPIRVToLLVM/comparison-ops-to-llvm.mlir
@@ -13,7 +13,7 @@ func @i_equal_scalar(%arg0: i32, %arg1: i32) {
// CHECK-LABEL: @i_equal_vector
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
}
@@ -31,7 +31,7 @@ func @i_not_equal_scalar(%arg0: i64, %arg1: i64) {
// CHECK-LABEL: @i_not_equal_vector
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
}
@@ -49,7 +49,7 @@ func @s_greater_than_equal_scalar(%arg0: i64, %arg1: i64) {
// CHECK-LABEL: @s_greater_than_equal_vector
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
}
@@ -67,7 +67,7 @@ func @s_greater_than_scalar(%arg0: i64, %arg1: i64) {
// CHECK-LABEL: @s_greater_than_vector
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
}
@@ -85,7 +85,7 @@ func @s_less_than_equal_scalar(%arg0: i64, %arg1: i64) {
// CHECK-LABEL: @s_less_than_equal_vector
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
}
@@ -103,7 +103,7 @@ func @s_less_than_scalar(%arg0: i64, %arg1: i64) {
// CHECK-LABEL: @s_less_than_vector
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
}
@@ -121,7 +121,7 @@ func @u_greater_than_equal_scalar(%arg0: i64, %arg1: i64) {
// CHECK-LABEL: @u_greater_than_equal_vector
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
}
@@ -139,7 +139,7 @@ func @u_greater_than_scalar(%arg0: i64, %arg1: i64) {
// CHECK-LABEL: @u_greater_than_vector
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
}
@@ -157,7 +157,7 @@ func @u_less_than_equal_scalar(%arg0: i64, %arg1: i64) {
// CHECK-LABEL: @u_less_than_equal_vector
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
}
@@ -175,7 +175,7 @@ func @u_less_than_scalar(%arg0: i64, %arg1: i64) {
// CHECK-LABEL: @u_less_than_vector
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
}
@@ -193,7 +193,7 @@ func @f_ord_equal_scalar(%arg0: f32, %arg1: f32) {
// CHECK-LABEL: @f_ord_equal_vector
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
}
@@ -211,9 +211,9 @@ func @f_ord_greater_than_equal_scalar(%arg0: f64, %arg1: f64) {
// CHECK-LABEL: @f_ord_greater_than_equal_vector
func @f_ord_greater_than_equal_vector(%arg0: vector<2xf64>, %arg1: vector<2xf64>) {
- // CHECK: llvm.fcmp "oge" %{{.*}}, %{{.*}} : !llvm<"<2 x double>">
- %0 = spv.FOrdGreaterThanEqual %arg0, %arg1 : vector<2xf64>
- return
+ // CHECK: llvm.fcmp "oge" %{{.*}}, %{{.*}} : !llvm.vec<2 x double>
+ %0 = spv.FOrdGreaterThanEqual %arg0, %arg1 : vector<2xf64>
+ return
}
//===----------------------------------------------------------------------===//
@@ -229,7 +229,7 @@ func @f_ord_greater_than_scalar(%arg0: f64, %arg1: f64) {
// CHECK-LABEL: @f_ord_greater_than_vector
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
}
@@ -247,7 +247,7 @@ func @f_ord_less_than_scalar(%arg0: f64, %arg1: f64) {
// CHECK-LABEL: @f_ord_less_than_vector
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
}
@@ -265,7 +265,7 @@ func @f_ord_less_than_equal_scalar(%arg0: f64, %arg1: f64) {
// CHECK-LABEL: @f_ord_less_than_equal_vector
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
}
@@ -283,7 +283,7 @@ func @f_ord_not_equal_scalar(%arg0: f32, %arg1: f32) {
// CHECK-LABEL: @f_ord_not_equal_vector
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
}
@@ -301,7 +301,7 @@ func @f_unord_equal_scalar(%arg0: f32, %arg1: f32) {
// CHECK-LABEL: @f_unord_equal_vector
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
}
@@ -319,7 +319,7 @@ func @f_unord_greater_than_equal_scalar(%arg0: f64, %arg1: f64) {
// CHECK-LABEL: @f_unord_greater_than_equal_vector
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
}
@@ -337,7 +337,7 @@ func @f_unord_greater_than_scalar(%arg0: f64, %arg1: f64) {
// CHECK-LABEL: @f_unord_greater_than_vector
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
}
@@ -355,7 +355,7 @@ func @f_unord_less_than_scalar(%arg0: f64, %arg1: f64) {
// CHECK-LABEL: @f_unord_less_than_vector
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
}
@@ -373,7 +373,7 @@ func @f_unord_less_than_equal_scalar(%arg0: f64, %arg1: f64) {
// CHECK-LABEL: @f_unord_less_than_equal_vector
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
}
@@ -391,7 +391,7 @@ func @f_unord_not_equal_scalar(%arg0: f32, %arg1: f32) {
// CHECK-LABEL: @f_unord_not_equal_vector
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
index b9605e791857..dc84f404906c 100644
--- 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_scalar() {
}
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<false> : vector<3xi1>) : !llvm<"<3 x i1>">
+ // CHECK: {{.*}} = llvm.mlir.constant(dense<false> : vector<3xi1>) : !llvm.vec<3 x i1>
%1 = constant dense<false> : vector<3xi1>
return
}
@@ -31,11 +31,11 @@ func @integer_constant_scalar() {
}
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_scalar() {
}
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
index 23174f34fcec..7e7820dee6be 100644
--- a/mlir/test/Conversion/SPIRVToLLVM/func-to-llvm.mlir
+++ b/mlir/test/Conversion/SPIRVToLLVM/func-to-llvm.mlir
@@ -52,7 +52,7 @@ spv.func @scalar_types(%arg0: i32, %arg1: i1, %arg2: f64, %arg3: f32) -> () "Non
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 @@ spv.func @vector_types(%arg0: vector<2xi64>, %arg1: vector<2xi64>) -> vector<2xi
//===----------------------------------------------------------------------===//
// 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/glsl-ops-to-llvm.mlir b/mlir/test/Conversion/SPIRVToLLVM/glsl-ops-to-llvm.mlir
index ecb9843d64fd..0cb975da5653 100644
--- a/mlir/test/Conversion/SPIRVToLLVM/glsl-ops-to-llvm.mlir
+++ b/mlir/test/Conversion/SPIRVToLLVM/glsl-ops-to-llvm.mlir
@@ -6,11 +6,11 @@
// CHECK-LABEL: @ceil
func @ceil(%arg0: f32, %arg1: vector<3xf16>) {
- // CHECK: "llvm.intr.ceil"(%{{.*}}) : (!llvm.float) -> !llvm.float
- %0 = spv.GLSL.Ceil %arg0 : f32
- // CHECK: "llvm.intr.ceil"(%{{.*}}) : (!llvm<"<3 x half>">) -> !llvm<"<3 x half>">
- %1 = spv.GLSL.Ceil %arg1 : vector<3xf16>
- return
+ // CHECK: "llvm.intr.ceil"(%{{.*}}) : (!llvm.float) -> !llvm.float
+ %0 = spv.GLSL.Ceil %arg0 : f32
+ // CHECK: "llvm.intr.ceil"(%{{.*}}) : (!llvm.vec<3 x half>) -> !llvm.vec<3 x half>
+ %1 = spv.GLSL.Ceil %arg1 : vector<3xf16>
+ return
}
//===----------------------------------------------------------------------===//
@@ -19,11 +19,11 @@ func @ceil(%arg0: f32, %arg1: vector<3xf16>) {
// CHECK-LABEL: @cos
func @cos(%arg0: f32, %arg1: vector<3xf16>) {
- // CHECK: "llvm.intr.cos"(%{{.*}}) : (!llvm.float) -> !llvm.float
- %0 = spv.GLSL.Cos %arg0 : f32
- // CHECK: "llvm.intr.cos"(%{{.*}}) : (!llvm<"<3 x half>">) -> !llvm<"<3 x half>">
- %1 = spv.GLSL.Cos %arg1 : vector<3xf16>
- return
+ // CHECK: "llvm.intr.cos"(%{{.*}}) : (!llvm.float) -> !llvm.float
+ %0 = spv.GLSL.Cos %arg0 : f32
+ // CHECK: "llvm.intr.cos"(%{{.*}}) : (!llvm.vec<3 x half>) -> !llvm.vec<3 x half>
+ %1 = spv.GLSL.Cos %arg1 : vector<3xf16>
+ return
}
//===----------------------------------------------------------------------===//
@@ -32,11 +32,11 @@ func @cos(%arg0: f32, %arg1: vector<3xf16>) {
// CHECK-LABEL: @exp
func @exp(%arg0: f32, %arg1: vector<3xf16>) {
- // CHECK: "llvm.intr.exp"(%{{.*}}) : (!llvm.float) -> !llvm.float
- %0 = spv.GLSL.Exp %arg0 : f32
- // CHECK: "llvm.intr.exp"(%{{.*}}) : (!llvm<"<3 x half>">) -> !llvm<"<3 x half>">
- %1 = spv.GLSL.Exp %arg1 : vector<3xf16>
- return
+ // CHECK: "llvm.intr.exp"(%{{.*}}) : (!llvm.float) -> !llvm.float
+ %0 = spv.GLSL.Exp %arg0 : f32
+ // CHECK: "llvm.intr.exp"(%{{.*}}) : (!llvm.vec<3 x half>) -> !llvm.vec<3 x half>
+ %1 = spv.GLSL.Exp %arg1 : vector<3xf16>
+ return
}
//===----------------------------------------------------------------------===//
@@ -45,11 +45,11 @@ func @exp(%arg0: f32, %arg1: vector<3xf16>) {
// CHECK-LABEL: @fabs
func @fabs(%arg0: f32, %arg1: vector<3xf16>) {
- // CHECK: "llvm.intr.fabs"(%{{.*}}) : (!llvm.float) -> !llvm.float
- %0 = spv.GLSL.FAbs %arg0 : f32
- // CHECK: "llvm.intr.fabs"(%{{.*}}) : (!llvm<"<3 x half>">) -> !llvm<"<3 x half>">
- %1 = spv.GLSL.FAbs %arg1 : vector<3xf16>
- return
+ // CHECK: "llvm.intr.fabs"(%{{.*}}) : (!llvm.float) -> !llvm.float
+ %0 = spv.GLSL.FAbs %arg0 : f32
+ // CHECK: "llvm.intr.fabs"(%{{.*}}) : (!llvm.vec<3 x half>) -> !llvm.vec<3 x half>
+ %1 = spv.GLSL.FAbs %arg1 : vector<3xf16>
+ return
}
//===----------------------------------------------------------------------===//
@@ -58,11 +58,11 @@ func @fabs(%arg0: f32, %arg1: vector<3xf16>) {
// CHECK-LABEL: @floor
func @floor(%arg0: f32, %arg1: vector<3xf16>) {
- // CHECK: "llvm.intr.floor"(%{{.*}}) : (!llvm.float) -> !llvm.float
- %0 = spv.GLSL.Floor %arg0 : f32
- // CHECK: "llvm.intr.floor"(%{{.*}}) : (!llvm<"<3 x half>">) -> !llvm<"<3 x half>">
- %1 = spv.GLSL.Floor %arg1 : vector<3xf16>
- return
+ // CHECK: "llvm.intr.floor"(%{{.*}}) : (!llvm.float) -> !llvm.float
+ %0 = spv.GLSL.Floor %arg0 : f32
+ // CHECK: "llvm.intr.floor"(%{{.*}}) : (!llvm.vec<3 x half>) -> !llvm.vec<3 x half>
+ %1 = spv.GLSL.Floor %arg1 : vector<3xf16>
+ return
}
//===----------------------------------------------------------------------===//
@@ -71,11 +71,11 @@ func @floor(%arg0: f32, %arg1: vector<3xf16>) {
// CHECK-LABEL: @fmax
func @fmax(%arg0: f32, %arg1: vector<3xf16>) {
- // CHECK: "llvm.intr.maxnum"(%{{.*}}, %{{.*}}) : (!llvm.float, !llvm.float) -> !llvm.float
- %0 = spv.GLSL.FMax %arg0, %arg0 : f32
- // CHECK: "llvm.intr.maxnum"(%{{.*}}, %{{.*}}) : (!llvm<"<3 x half>">, !llvm<"<3 x half>">) -> !llvm<"<3 x half>">
- %1 = spv.GLSL.FMax %arg1, %arg1 : vector<3xf16>
- return
+ // CHECK: "llvm.intr.maxnum"(%{{.*}}, %{{.*}}) : (!llvm.float, !llvm.float) -> !llvm.float
+ %0 = spv.GLSL.FMax %arg0, %arg0 : f32
+ // CHECK: "llvm.intr.maxnum"(%{{.*}}, %{{.*}}) : (!llvm.vec<3 x half>, !llvm.vec<3 x half>) -> !llvm.vec<3 x half>
+ %1 = spv.GLSL.FMax %arg1, %arg1 : vector<3xf16>
+ return
}
//===----------------------------------------------------------------------===//
@@ -84,11 +84,11 @@ func @fmax(%arg0: f32, %arg1: vector<3xf16>) {
// CHECK-LABEL: @fmin
func @fmin(%arg0: f32, %arg1: vector<3xf16>) {
- // CHECK: "llvm.intr.minnum"(%{{.*}}, %{{.*}}) : (!llvm.float, !llvm.float) -> !llvm.float
- %0 = spv.GLSL.FMin %arg0, %arg0 : f32
- // CHECK: "llvm.intr.minnum"(%{{.*}}, %{{.*}}) : (!llvm<"<3 x half>">, !llvm<"<3 x half>">) -> !llvm<"<3 x half>">
- %1 = spv.GLSL.FMin %arg1, %arg1 : vector<3xf16>
- return
+ // CHECK: "llvm.intr.minnum"(%{{.*}}, %{{.*}}) : (!llvm.float, !llvm.float) -> !llvm.float
+ %0 = spv.GLSL.FMin %arg0, %arg0 : f32
+ // CHECK: "llvm.intr.minnum"(%{{.*}}, %{{.*}}) : (!llvm.vec<3 x half>, !llvm.vec<3 x half>) -> !llvm.vec<3 x half>
+ %1 = spv.GLSL.FMin %arg1, %arg1 : vector<3xf16>
+ return
}
//===----------------------------------------------------------------------===//
@@ -97,11 +97,11 @@ func @fmin(%arg0: f32, %arg1: vector<3xf16>) {
// CHECK-LABEL: @log
func @log(%arg0: f32, %arg1: vector<3xf16>) {
- // CHECK: "llvm.intr.log"(%{{.*}}) : (!llvm.float) -> !llvm.float
- %0 = spv.GLSL.Log %arg0 : f32
- // CHECK: "llvm.intr.log"(%{{.*}}) : (!llvm<"<3 x half>">) -> !llvm<"<3 x half>">
- %1 = spv.GLSL.Log %arg1 : vector<3xf16>
- return
+ // CHECK: "llvm.intr.log"(%{{.*}}) : (!llvm.float) -> !llvm.float
+ %0 = spv.GLSL.Log %arg0 : f32
+ // CHECK: "llvm.intr.log"(%{{.*}}) : (!llvm.vec<3 x half>) -> !llvm.vec<3 x half>
+ %1 = spv.GLSL.Log %arg1 : vector<3xf16>
+ return
}
//===----------------------------------------------------------------------===//
@@ -110,11 +110,11 @@ func @log(%arg0: f32, %arg1: vector<3xf16>) {
// CHECK-LABEL: @sin
func @sin(%arg0: f32, %arg1: vector<3xf16>) {
- // CHECK: "llvm.intr.sin"(%{{.*}}) : (!llvm.float) -> !llvm.float
- %0 = spv.GLSL.Sin %arg0 : f32
- // CHECK: "llvm.intr.sin"(%{{.*}}) : (!llvm<"<3 x half>">) -> !llvm<"<3 x half>">
- %1 = spv.GLSL.Sin %arg1 : vector<3xf16>
- return
+ // CHECK: "llvm.intr.sin"(%{{.*}}) : (!llvm.float) -> !llvm.float
+ %0 = spv.GLSL.Sin %arg0 : f32
+ // CHECK: "llvm.intr.sin"(%{{.*}}) : (!llvm.vec<3 x half>) -> !llvm.vec<3 x half>
+ %1 = spv.GLSL.Sin %arg1 : vector<3xf16>
+ return
}
//===----------------------------------------------------------------------===//
@@ -123,11 +123,11 @@ func @sin(%arg0: f32, %arg1: vector<3xf16>) {
// CHECK-LABEL: @smax
func @smax(%arg0: i16, %arg1: vector<3xi32>) {
- // CHECK: "llvm.intr.smax"(%{{.*}}, %{{.*}}) : (!llvm.i16, !llvm.i16) -> !llvm.i16
- %0 = spv.GLSL.SMax %arg0, %arg0 : i16
- // CHECK: "llvm.intr.smax"(%{{.*}}, %{{.*}}) : (!llvm<"<3 x i32>">, !llvm<"<3 x i32>">) -> !llvm<"<3 x i32>">
- %1 = spv.GLSL.SMax %arg1, %arg1 : vector<3xi32>
- return
+ // CHECK: "llvm.intr.smax"(%{{.*}}, %{{.*}}) : (!llvm.i16, !llvm.i16) -> !llvm.i16
+ %0 = spv.GLSL.SMax %arg0, %arg0 : i16
+ // CHECK: "llvm.intr.smax"(%{{.*}}, %{{.*}}) : (!llvm.vec<3 x i32>, !llvm.vec<3 x i32>) -> !llvm.vec<3 x i32>
+ %1 = spv.GLSL.SMax %arg1, %arg1 : vector<3xi32>
+ return
}
//===----------------------------------------------------------------------===//
@@ -136,11 +136,11 @@ func @smax(%arg0: i16, %arg1: vector<3xi32>) {
// CHECK-LABEL: @smin
func @smin(%arg0: i16, %arg1: vector<3xi32>) {
- // CHECK: "llvm.intr.smin"(%{{.*}}, %{{.*}}) : (!llvm.i16, !llvm.i16) -> !llvm.i16
- %0 = spv.GLSL.SMin %arg0, %arg0 : i16
- // CHECK: "llvm.intr.smin"(%{{.*}}, %{{.*}}) : (!llvm<"<3 x i32>">, !llvm<"<3 x i32>">) -> !llvm<"<3 x i32>">
- %1 = spv.GLSL.SMin %arg1, %arg1 : vector<3xi32>
- return
+ // CHECK: "llvm.intr.smin"(%{{.*}}, %{{.*}}) : (!llvm.i16, !llvm.i16) -> !llvm.i16
+ %0 = spv.GLSL.SMin %arg0, %arg0 : i16
+ // CHECK: "llvm.intr.smin"(%{{.*}}, %{{.*}}) : (!llvm.vec<3 x i32>, !llvm.vec<3 x i32>) -> !llvm.vec<3 x i32>
+ %1 = spv.GLSL.SMin %arg1, %arg1 : vector<3xi32>
+ return
}
//===----------------------------------------------------------------------===//
@@ -149,11 +149,11 @@ func @smin(%arg0: i16, %arg1: vector<3xi32>) {
// CHECK-LABEL: @sqrt
func @sqrt(%arg0: f32, %arg1: vector<3xf16>) {
- // CHECK: "llvm.intr.sqrt"(%{{.*}}) : (!llvm.float) -> !llvm.float
- %0 = spv.GLSL.Sqrt %arg0 : f32
- // CHECK: "llvm.intr.sqrt"(%{{.*}}) : (!llvm<"<3 x half>">) -> !llvm<"<3 x half>">
- %1 = spv.GLSL.Sqrt %arg1 : vector<3xf16>
- return
+ // CHECK: "llvm.intr.sqrt"(%{{.*}}) : (!llvm.float) -> !llvm.float
+ %0 = spv.GLSL.Sqrt %arg0 : f32
+ // CHECK: "llvm.intr.sqrt"(%{{.*}}) : (!llvm.vec<3 x half>) -> !llvm.vec<3 x half>
+ %1 = spv.GLSL.Sqrt %arg1 : vector<3xf16>
+ return
}
//===----------------------------------------------------------------------===//
@@ -162,11 +162,11 @@ func @sqrt(%arg0: f32, %arg1: vector<3xf16>) {
// CHECK-LABEL: @tan
func @tan(%arg0: f32) {
- // CHECK: %[[SIN:.*]] = "llvm.intr.sin"(%{{.*}}) : (!llvm.float) -> !llvm.float
+ // CHECK: %[[SIN:.*]] = "llvm.intr.sin"(%{{.*}}) : (!llvm.float) -> !llvm.float
// CHECK: %[[COS:.*]] = "llvm.intr.cos"(%{{.*}}) : (!llvm.float) -> !llvm.float
- // CHECK: llvm.fdiv %[[SIN]], %[[COS]] : !llvm.float
- %0 = spv.GLSL.Tan %arg0 : f32
- return
+ // CHECK: llvm.fdiv %[[SIN]], %[[COS]] : !llvm.float
+ %0 = spv.GLSL.Tan %arg0 : f32
+ return
}
//===----------------------------------------------------------------------===//
@@ -175,15 +175,15 @@ func @tan(%arg0: f32) {
// CHECK-LABEL: @tanh
func @tanh(%arg0: f32) {
- // CHECK: %[[TWO:.*]] = llvm.mlir.constant(2.000000e+00 : f32) : !llvm.float
+ // CHECK: %[[TWO:.*]] = llvm.mlir.constant(2.000000e+00 : f32) : !llvm.float
// CHECK: %[[X2:.*]] = llvm.fmul %[[TWO]], %{{.*}} : !llvm.float
// CHECK: %[[EXP:.*]] = "llvm.intr.exp"(%[[X2]]) : (!llvm.float) -> !llvm.float
// CHECK: %[[ONE:.*]] = llvm.mlir.constant(1.000000e+00 : f32) : !llvm.float
// CHECK: %[[T0:.*]] = llvm.fsub %[[EXP]], %[[ONE]] : !llvm.float
// CHECK: %[[T1:.*]] = llvm.fadd %[[EXP]], %[[ONE]] : !llvm.float
// CHECK: llvm.fdiv %[[T0]], %[[T1]] : !llvm.float
- %0 = spv.GLSL.Tanh %arg0 : f32
- return
+ %0 = spv.GLSL.Tanh %arg0 : f32
+ return
}
//===----------------------------------------------------------------------===//
@@ -192,9 +192,9 @@ func @tanh(%arg0: f32) {
// CHECK-LABEL: @inverse_sqrt
func @inverse_sqrt(%arg0: f32) {
- // CHECK: %[[ONE:.*]] = llvm.mlir.constant(1.000000e+00 : f32) : !llvm.float
+ // CHECK: %[[ONE:.*]] = llvm.mlir.constant(1.000000e+00 : f32) : !llvm.float
// CHECK: %[[SQRT:.*]] = "llvm.intr.sqrt"(%{{.*}}) : (!llvm.float) -> !llvm.float
- // CHECK: llvm.fdiv %[[ONE]], %[[SQRT]] : !llvm.float
- %0 = spv.GLSL.InverseSqrt %arg0 : f32
- return
+ // CHECK: llvm.fdiv %[[ONE]], %[[SQRT]] : !llvm.float
+ %0 = spv.GLSL.InverseSqrt %arg0 : f32
+ return
}
diff --git a/mlir/test/Conversion/SPIRVToLLVM/logical-ops-to-llvm.mlir b/mlir/test/Conversion/SPIRVToLLVM/logical-ops-to-llvm.mlir
index a816424d5b1c..9c9035ae8933 100644
--- a/mlir/test/Conversion/SPIRVToLLVM/logical-ops-to-llvm.mlir
+++ b/mlir/test/Conversion/SPIRVToLLVM/logical-ops-to-llvm.mlir
@@ -13,7 +13,7 @@ func @logical_equal_scalar(%arg0: i1, %arg1: i1) {
// CHECK-LABEL: @logical_equal_vector
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
}
@@ -31,7 +31,7 @@ func @logical_not_equal_scalar(%arg0: i1, %arg1: i1) {
// CHECK-LABEL: @logical_not_equal_vector
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
}
@@ -50,8 +50,8 @@ func @logical_not_scalar(%arg0: i1) {
// CHECK-LABEL: @logical_not_vector
func @logical_not_vector(%arg0: vector<4xi1>) {
- // CHECK: %[[CONST:.*]] = llvm.mlir.constant(dense<true> : vector<4xi1>) : !llvm<"<4 x i1>">
- // CHECK: llvm.xor %{{.*}}, %[[CONST]] : !llvm<"<4 x i1>">
+ // CHECK: %[[CONST:.*]] = llvm.mlir.constant(dense<true> : vector<4xi1>) : !llvm.vec<4 x i1>
+ // CHECK: llvm.xor %{{.*}}, %[[CONST]] : !llvm.vec<4 x i1>
%0 = spv.LogicalNot %arg0 : vector<4xi1>
return
}
@@ -69,7 +69,7 @@ func @logical_and_scalar(%arg0: i1, %arg1: i1) {
// CHECK-LABEL: @logical_and_vector
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
}
@@ -87,7 +87,7 @@ func @logical_or_scalar(%arg0: i1, %arg1: i1) {
// CHECK-LABEL: @logical_or_vector
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
index f717948f8069..6dafab982e35 100644
--- a/mlir/test/Conversion/SPIRVToLLVM/memory-ops-to-llvm.mlir
+++ b/mlir/test/Conversion/SPIRVToLLVM/memory-ops-to-llvm.mlir
@@ -6,35 +6,35 @@
func @load() {
%0 = spv.Variable : !spv.ptr<f32, Function>
- // CHECK: %{{.*}} = llvm.load %{{.*}} : !llvm<"float*">
+ // CHECK: %{{.*}} = llvm.load %{{.*}} : !llvm.ptr<float>
%1 = spv.Load "Function" %0 : f32
return
}
func @load_none() {
%0 = spv.Variable : !spv.ptr<f32, Function>
- // CHECK: %{{.*}} = llvm.load %{{.*}} : !llvm<"float*">
+ // CHECK: %{{.*}} = llvm.load %{{.*}} : !llvm.ptr<float>
%1 = spv.Load "Function" %0 ["None"] : f32
return
}
func @load_with_alignment() {
%0 = spv.Variable : !spv.ptr<f32, Function>
- // CHECK: %{{.*}} = llvm.load %{{.*}} {alignment = 4 : i64} : !llvm<"float*">
+ // CHECK: %{{.*}} = llvm.load %{{.*}} {alignment = 4 : i64} : !llvm.ptr<float>
%1 = spv.Load "Function" %0 ["Aligned", 4] : f32
return
}
func @load_volatile() {
%0 = spv.Variable : !spv.ptr<f32, Function>
- // CHECK: %{{.*}} = llvm.load volatile %{{.*}} : !llvm<"float*">
+ // CHECK: %{{.*}} = llvm.load volatile %{{.*}} : !llvm.ptr<float>
%1 = spv.Load "Function" %0 ["Volatile"] : f32
return
}
func @load_nontemporal() {
%0 = spv.Variable : !spv.ptr<f32, Function>
- // CHECK: %{{.*}} = llvm.load %{{.*}} {nontemporal} : !llvm<"float*">
+ // CHECK: %{{.*}} = llvm.load %{{.*}} {nontemporal} : !llvm.ptr<float>
%1 = spv.Load "Function" %0 ["Nontemporal"] : f32
return
}
@@ -45,35 +45,35 @@ func @load_nontemporal() {
func @store(%arg0 : f32) -> () {
%0 = spv.Variable : !spv.ptr<f32, Function>
- // CHECK: llvm.store %{{.*}}, %{{.*}} : !llvm<"float*">
+ // CHECK: llvm.store %{{.*}}, %{{.*}} : !llvm.ptr<float>
spv.Store "Function" %0, %arg0 : f32
return
}
func @store_composite(%arg0 : !spv.struct<f64>) -> () {
%0 = spv.Variable : !spv.ptr<!spv.struct<f64>, Function>
- // CHECK: llvm.store %{{.*}}, %{{.*}} : !llvm<"<{ double }>*">
+ // CHECK: llvm.store %{{.*}}, %{{.*}} : !llvm.ptr<struct<packed (double)>>
spv.Store "Function" %0, %arg0 : !spv.struct<f64>
return
}
func @store_with_alignment(%arg0 : f32) -> () {
%0 = spv.Variable : !spv.ptr<f32, Function>
- // CHECK: llvm.store %{{.*}}, %{{.*}} {alignment = 4 : i64} : !llvm<"float*">
+ // CHECK: llvm.store %{{.*}}, %{{.*}} {alignment = 4 : i64} : !llvm.ptr<float>
spv.Store "Function" %0, %arg0 ["Aligned", 4] : f32
return
}
func @store_volatile(%arg0 : f32) -> () {
%0 = spv.Variable : !spv.ptr<f32, Function>
- // CHECK: llvm.store volatile %{{.*}}, %{{.*}} : !llvm<"float*">
+ // CHECK: llvm.store volatile %{{.*}}, %{{.*}} : !llvm.ptr<float>
spv.Store "Function" %0, %arg0 ["Volatile"] : f32
return
}
func @store_nontemporal(%arg0 : f32) -> () {
%0 = spv.Variable : !spv.ptr<f32, Function>
- // CHECK: llvm.store %{{.*}}, %{{.*}} {nontemporal} : !llvm<"float*">
+ // CHECK: llvm.store %{{.*}}, %{{.*}} {nontemporal} : !llvm.ptr<float>
spv.Store "Function" %0, %arg0 ["Nontemporal"] : f32
return
}
@@ -83,45 +83,45 @@ func @store_nontemporal(%arg0 : f32) -> () {
//===----------------------------------------------------------------------===//
func @variable_scalar() {
- // CHECK: %[[SIZE1:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32
- // CHECK: %{{.*}} = llvm.alloca %[[SIZE1]] x !llvm.float : (!llvm.i32) -> !llvm<"float*">
- %0 = spv.Variable : !spv.ptr<f32, Function>
- // CHECK: %[[SIZE2:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32
- // CHECK: %{{.*}} = llvm.alloca %[[SIZE2]] x !llvm.i8 : (!llvm.i32) -> !llvm<"i8*">
- %1 = spv.Variable : !spv.ptr<i8, Function>
+ // CHECK: %[[SIZE1:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32
+ // CHECK: %{{.*}} = llvm.alloca %[[SIZE1]] x !llvm.float : (!llvm.i32) -> !llvm.ptr<float>
+ %0 = spv.Variable : !spv.ptr<f32, Function>
+ // CHECK: %[[SIZE2:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32
+ // CHECK: %{{.*}} = llvm.alloca %[[SIZE2]] x !llvm.i8 : (!llvm.i32) -> !llvm.ptr<i8>
+ %1 = spv.Variable : !spv.ptr<i8, Function>
return
}
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*">
- %c = spv.constant 0 : i64
- %0 = spv.Variable init(%c) : !spv.ptr<i64, Function>
+ // 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.ptr<i64>
+ // CHECK: llvm.store %[[VALUE]], %[[ALLOCATED]] : !llvm.ptr<i64>
+ %c = spv.constant 0 : i64
+ %0 = spv.Variable init(%c) : !spv.ptr<i64, Function>
return
}
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>*">
- %0 = spv.Variable : !spv.ptr<vector<3xf32>, Function>
- return
+ // CHECK: %[[SIZE:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32
+ // CHECK: %{{.*}} = llvm.alloca %[[SIZE]] x !llvm.vec<3 x float> : (!llvm.i32) -> !llvm.ptr<vec<3 x float>>
+ %0 = spv.Variable : !spv.ptr<vector<3xf32>, Function>
+ return
}
func @variable_vector_with_initialization() {
- // CHECK: %[[VALUE:.*]] = llvm.mlir.constant(dense<false> : vector<3xi1>) : !llvm<"<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>*">
- %c = spv.constant dense<false> : vector<3xi1>
- %0 = spv.Variable init(%c) : !spv.ptr<vector<3xi1>, Function>
+ // CHECK: %[[VALUE:.*]] = llvm.mlir.constant(dense<false> : vector<3xi1>) : !llvm.vec<3 x i1>
+ // CHECK: %[[SIZE:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32
+ // CHECK: %[[ALLOCATED:.*]] = llvm.alloca %[[SIZE]] x !llvm.vec<3 x i1> : (!llvm.i32) -> !llvm.ptr<vec<3 x i1>>
+ // CHECK: llvm.store %[[VALUE]], %[[ALLOCATED]] : !llvm.ptr<vec<3 x i1>>
+ %c = spv.constant dense<false> : vector<3xi1>
+ %0 = spv.Variable init(%c) : !spv.ptr<vector<3xi1>, Function>
return
}
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]*">
- %0 = spv.Variable : !spv.ptr<!spv.array<10 x i32>, Function>
- return
+ // CHECK: %[[SIZE:.*]] = llvm.mlir.constant(1 : i32) : !llvm.i32
+ // CHECK: %{{.*}} = llvm.alloca %[[SIZE]] x !llvm.array<10 x i32> : (!llvm.i32) -> !llvm.ptr<array<10 x i32>>
+ %0 = spv.Variable : !spv.ptr<!spv.array<10 x i32>, Function>
+ return
}
diff --git a/mlir/test/Conversion/SPIRVToLLVM/misc-ops-to-llvm.mlir b/mlir/test/Conversion/SPIRVToLLVM/misc-ops-to-llvm.mlir
index 8f407ba8f596..60fe79c0007e 100644
--- 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_scalar(%arg0: i1, %arg1: vector<3xi32>, %arg2: f32) {
}
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_scalar() {
}
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
index 09e396d6400f..41431ea3b3b2 100644
--- 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_scalar(%arg0: i32, %arg1: si32, %arg2 : i16, %arg3
}
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_scalar(%arg0: i32, %arg1: si32, %arg2 : si16, %arg3 :
}
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_scalar(%arg0: i32, %arg1: si32, %arg2 : i16, %arg3 : ui
}
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
index 466f8ad4a9ea..d6618a7de7fe 100644
--- 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<i1>, !llvm.ptr<float>)
func @pointer_scalar(!spv.ptr<i1, Uniform>, !spv.ptr<f32, Private>) -> ()
-// CHECK-LABEL: @pointer_vector(!llvm<"<4 x i32>*">)
+// CHECK-LABEL: @pointer_vector(!llvm.ptr<vec<4 x i32>>)
func @pointer_vector(!spv.ptr<vector<4xi32>, 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<f32>) -> ()
//===----------------------------------------------------------------------===//
// Struct type
//===----------------------------------------------------------------------===//
-// CHECK-LABEL: @struct(!llvm<"<{ double }>">)
+// CHECK-LABEL: @struct(!llvm.struct<packed (double)>)
func @struct(!spv.struct<f64>) -> ()
-// CHECK-LABEL: @struct_nested(!llvm<"<{ i32, <{ i64, i32 }> }>">)
+// CHECK-LABEL: @struct_nested(!llvm.struct<packed (i32, struct<packed (i64, i32)>)>)
func @struct_nested(!spv.struct<i32, !spv.struct<i64, i32>>)
diff --git a/mlir/test/Conversion/StandardToLLVM/calling-convention.mlir b/mlir/test/Conversion/StandardToLLVM/calling-convention.mlir
index e17bf3e24225..4cdf9d6bace8 100644
--- 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<float>, %[[ALIGN0:.*]]: !llvm.ptr<float>, %[[OFFSET0:.*]]: !llvm.i64, %[[SIZE00:.*]]: !llvm.i64, %[[SIZE01:.*]]: !llvm.i64, %[[STRIDE00:.*]]: !llvm.i64, %[[STRIDE01:.*]]: !llvm.i64,
+// CHECK: %[[ALLOC1:.*]]: !llvm.ptr<float>, %[[ALIGN1:.*]]: !llvm.ptr<float>, %[[OFFSET1:.*]]: !llvm.i64)
func @external(%arg0: memref<?x?xf32>, %arg1: memref<f32>)
// 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<float>, ptr<float>, 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 @@ func @external(%arg0: memref<?x?xf32>, %arg1: memref<f32>)
// 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<float>, ptr<float>, 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<float>, ptr<float>, i64)>
+ // CHECK: %[[DESC11:.*]] = llvm.insertvalue %arg7, %[[DESC10]][0] : !llvm.struct<(ptr<float>, ptr<float>, i64)>
+ // CHECK: %[[DESC12:.*]] = llvm.insertvalue %arg8, %[[DESC11]][1] : !llvm.struct<(ptr<float>, ptr<float>, i64)>
+ // CHECK: %[[DESC13:.*]] = llvm.insertvalue %arg9, %[[DESC12]][2] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64)>
// CHECK: llvm.store %[[DESC13]], %[[DESC1_ALLOCA]]
// Call the interface function.
@@ -42,18 +42,18 @@ func @external(%arg0: memref<?x?xf32>, %arg1: memref<f32>)
// 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<struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>>, !llvm.ptr<struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>, struct<(ptr<float>, ptr<float>, i64)>)>
func @returner() -> (memref<?x?xf32>, memref<f32>)
// CHECK-LABEL: @caller
func @caller() {
%0:2 = call @returner() : () -> (memref<?x?xf32>, memref<f32>)
// 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<float>, ptr<float>, 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 @@ func @caller() {
// 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<float>, ptr<float>, 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<float>, !llvm.ptr<float>, !llvm.i64, !llvm.i64, !llvm.i64, !llvm.i64, !llvm.i64, !llvm.ptr<float>, !llvm.ptr<float>, !llvm.i64) -> ()
call @external(%0#0, %0#1) : (memref<?x?xf32>, memref<f32>) -> ()
return
}
@@ -81,9 +81,9 @@ func @callee(%arg0: memref<?xf32>, %arg1: index) {
// 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<struct<(ptr<float>, ptr<float>, 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<struct<(ptr<float>, ptr<float>, 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 @@ func @callee(%arg0: memref<?xf32>, %arg1: index) {
// 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<float>, !llvm.ptr<float>, !llvm.i64, !llvm.i64, !llvm.i64, !llvm.i64) -> ()
// EMIT_C_ATTRIBUTE-NOT: @mlir_ciface_callee
@@ -126,7 +126,7 @@ func @return_var_memref_caller(%arg0: memref<4x3xf32>) {
// 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<i8>)>
// 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 @@ func @return_var_memref_caller(%arg0: memref<4x3xf32>) {
// 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<i8>)>
+ // CHECK: %[[RANK:.*]] = llvm.extractvalue %[[CALL_RES]][0] : !llvm.struct<(i64, ptr<i8>)>
// CHECK: %[[DESC_1:.*]] = llvm.insertvalue %[[RANK]], %[[DESC]][0]
// CHECK: llvm.insertvalue %[[ALLOCA]], %[[DESC_1]][1]
return
@@ -148,7 +148,7 @@ func @return_var_memref(%arg0: memref<4x3xf32>) -> memref<*xf32> {
// 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<i8>)>
// 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 @@ func @return_var_memref(%arg0: memref<4x3xf32>) -> memref<*xf32> {
// 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<i8>)>
// 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 @@ func @return_var_memref(%arg0: memref<4x3xf32>) -> memref<*xf32> {
// 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<i8>)>
+ // CHECK: %[[RANK:.*]] = llvm.extractvalue %[[DESC_2]][0] : !llvm.struct<(i64, ptr<i8>)>
// 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 @@ func @return_two_var_memref(%arg0: memref<4x3xf32>) -> (memref<*xf32>, memref<*x
// 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<i8>)>
// 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 @@ func @return_two_var_memref(%arg0: memref<4x3xf32>) -> (memref<*xf32>, memref<*x
// 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<i8>)>, struct<(i64, ptr<i8>)>)>
// 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
index 32365f362d04..e5d8ca72d9ad 100644
--- 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<float>
// CHECK-COUNT-5: !llvm.i64
-// CHECK-COUNT-2: !llvm<"float*">
+// CHECK-COUNT-2: !llvm.ptr<float>
// CHECK-COUNT-5: !llvm.i64
-// CHECK-COUNT-2: !llvm<"float*">
+// CHECK-COUNT-2: !llvm.ptr<float>
// CHECK-COUNT-5: !llvm.i64
func @check_strided_memref_arguments(%static: memref<10x20xf32, affine_map<(i,j)->(20 * i + j + 1)>>,
%dynamic : memref<?x?xf32, affine_map<(i,j)[M]->(M * i + j + 1)>>,
@@ -15,148 +15,148 @@ func @check_strided_memref_arguments(%static: memref<10x20xf32, affine_map<(i,j)
}
// CHECK-LABEL: func @check_arguments
-// CHECK-COUNT-2: !llvm<"float*">
+// CHECK-COUNT-2: !llvm.ptr<float>
// CHECK-COUNT-5: !llvm.i64
-// CHECK-COUNT-2: !llvm<"float*">
+// CHECK-COUNT-2: !llvm.ptr<float>
// CHECK-COUNT-5: !llvm.i64
-// CHECK-COUNT-2: !llvm<"float*">
+// CHECK-COUNT-2: !llvm.ptr<float>
// CHECK-COUNT-5: !llvm.i64
func @check_arguments(%static: memref<10x20xf32>, %dynamic : memref<?x?xf32>, %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<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)> {
func @mixed_alloc(%arg0: index, %arg1: index) -> memref<?x42x?xf32> {
// 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<float>
// 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr<float> to !llvm.i64
// CHECK-NEXT: %[[sz_bytes:.*]] = llvm.mul %[[sz]], %[[sizeof]] : !llvm.i64
// CHECK-NEXT: %[[one_1:.*]] = llvm.mlir.constant(1 : index) : !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<i8>
+// CHECK-NEXT: llvm.bitcast %{{.*}} : !llvm.ptr<i8> to !llvm.ptr<float>
+// CHECK-NEXT: llvm.mlir.undef : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %[[st0]], %{{.*}}[4, 0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %[[c42]], %{{.*}}[3, 1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %[[st1]], %{{.*}}[4, 1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %[[N]], %{{.*}}[3, 2] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %[[st2]], %{{.*}}[4, 2] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
%0 = alloc(%arg0, %arg1) : memref<?x42x?xf32>
-// CHECK-NEXT: llvm.return %{{.*}} : !llvm<"{ float*, float*, i64, [3 x i64], [3 x i64] }">
+// CHECK-NEXT: llvm.return %{{.*}} : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
return %0 : memref<?x42x?xf32>
}
// CHECK-LABEL: func @mixed_dealloc
func @mixed_dealloc(%arg0: memref<?x42x?xf32>) {
-// 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<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK-NEXT: %[[ptri8:.*]] = llvm.bitcast %[[ptr]] : !llvm.ptr<float> to !llvm.ptr<i8>
+// CHECK-NEXT: llvm.call @free(%[[ptri8]]) : (!llvm.ptr<i8>) -> ()
dealloc %arg0 : memref<?x42x?xf32>
// 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)> {
func @dynamic_alloc(%arg0: index, %arg1: index) -> memref<?x?xf32> {
// CHECK: %[[sz:.*]] = llvm.mul %[[M]], %[[N]] : !llvm.i64
-// CHECK-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm<"float*">
+// CHECK-NEXT: %[[null:.*]] = llvm.mlir.null : !llvm.ptr<float>
// 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr<float> to !llvm.i64
// CHECK-NEXT: %[[sz_bytes:.*]] = llvm.mul %[[sz]], %[[sizeof]] : !llvm.i64
// CHECK-NEXT: %[[one_1:.*]] = llvm.mlir.constant(1 : index) : !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<i8>
+// CHECK-NEXT: llvm.bitcast %{{.*}} : !llvm.ptr<i8> to !llvm.ptr<float>
+// CHECK-NEXT: llvm.mlir.undef : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %[[st0]], %{{.*}}[4, 0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %[[N]], %{{.*}}[3, 1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %[[st1]], %{{.*}}[4, 1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
%0 = alloc(%arg0, %arg1) : memref<?x?xf32>
-// CHECK-NEXT: llvm.return %{{.*}} : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }">
+// CHECK-NEXT: llvm.return %{{.*}} : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
return %0 : memref<?x?xf32>
}
// -----
// 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)> {
func @dynamic_alloca(%arg0: index, %arg1: index) -> memref<?x?xf32> {
// 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<float>
// 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr<float> to !llvm.i64
// CHECK-NEXT: %[[sz_bytes:.*]] = llvm.mul %[[num_elems]], %[[sizeof]] : !llvm.i64
// CHECK-NEXT: %[[one_1:.*]] = llvm.mlir.constant(1 : index) : !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<float>
+// CHECK-NEXT: llvm.mlir.undef : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %[[allocated]], %{{.*}}[0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %[[allocated]], %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %[[st0]], %{{.*}}[4, 0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %[[N]], %{{.*}}[3, 1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %[[st1]], %{{.*}}[4, 1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
%0 = alloca(%arg0, %arg1) : memref<?x?xf32>
// 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<float>
+// CHECK: %[[desc:.*]] = llvm.mlir.undef : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK: %[[desc1:.*]] = llvm.insertvalue %[[alloca_aligned]], %[[desc]][0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK: llvm.insertvalue %[[alloca_aligned]], %[[desc1]][1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
alloca(%arg0, %arg1) {alignment = 32} : memref<?x?xf32>
return %0 : memref<?x?xf32>
}
// CHECK-LABEL: func @dynamic_dealloc
func @dynamic_dealloc(%arg0: memref<?x?xf32>) {
-// 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK-NEXT: %[[ptri8:.*]] = llvm.bitcast %[[ptr]] : !llvm.ptr<float> to !llvm.ptr<i8>
+// CHECK-NEXT: llvm.call @free(%[[ptri8]]) : (!llvm.ptr<i8>) -> ()
dealloc %arg0 : memref<?x?xf32>
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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)> {
+// ALIGNED-ALLOC-LABEL: func @stdlib_aligned_alloc({{.*}}) -> !llvm.struct<(ptr<float>, ptr<float>, 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<float>
// 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// ALIGNED-ALLOC-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr<float> to !llvm.i64
// ALIGNED-ALLOC-NEXT: %[[bytes:.*]] = llvm.mul %[[num_elems]], %[[sizeof]] : !llvm.i64
// ALIGNED-ALLOC-NEXT: %[[one_1:.*]] = llvm.mlir.constant(1 : index) : !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<i8>
+// ALIGNED-ALLOC-NEXT: llvm.bitcast %[[allocated]] : !llvm.ptr<i8> to !llvm.ptr<float>
%0 = alloc() {alignment = 32} : memref<32x18xf32>
// Do another alloc just to test that we have a unique declaration for
// aligned_alloc.
@@ -190,28 +190,28 @@ func @stdlib_aligned_alloc(%N : index) -> memref<32x18xf32> {
}
// CHECK-LABEL: func @mixed_load(
-// CHECK-COUNT-2: !llvm<"float*">,
+// CHECK-COUNT-2: !llvm.ptr<float>,
// 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// CHECK-NEXT: llvm.load %[[addr]] : !llvm.ptr<float>
%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<float>
+// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.ptr<float>
// 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
@@ -220,23 +220,23 @@ func @mixed_load(%mixed : memref<42x?xf32>, %i : index, %j : index) {
// CHECK-SAME: %[[I:[a-zA-Z0-9]*]]: !llvm.i64
// CHECK-SAME: %[[J:[a-zA-Z0-9]*]]: !llvm.i64
func @dynamic_load(%dynamic : memref<?x?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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// CHECK-NEXT: llvm.load %[[addr]] : !llvm.ptr<float>
%0 = load %dynamic[%i, %j] : memref<?x?xf32>
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<float>
+// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.ptr<float>
// 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
@@ -245,36 +245,36 @@ func @dynamic_load(%dynamic : memref<?x?xf32>, %i : index, %j : index) {
// CHECK-SAME: %[[I:[a-zA-Z0-9]*]]: !llvm.i64
// CHECK-SAME: %[[J:[a-zA-Z0-9]*]]: !llvm.i64
func @prefetch(%A : memref<?x?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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, !llvm.i64) -> !llvm.ptr<float>
// 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<float>, !llvm.i32, !llvm.i32, !llvm.i32) -> ()
prefetch %A[%i, %j], write, locality<3>, data : memref<?x?xf32>
// 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<float>, !llvm.i32, !llvm.i32, !llvm.i32) -> ()
prefetch %A[%i, %j], read, locality<0>, data : memref<?x?xf32>
// 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<float>, !llvm.i32, !llvm.i32, !llvm.i32) -> ()
prefetch %A[%i, %j], read, locality<2>, instr : memref<?x?xf32>
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<float>
+// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.ptr<float>
// 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
@@ -283,23 +283,23 @@ func @prefetch(%A : memref<?x?xf32>, %i : index, %j : index) {
// CHECK-SAME: %[[I:[a-zA-Z0-9]*]]: !llvm.i64
// CHECK-SAME: %[[J:[a-zA-Z0-9]*]]: !llvm.i64
func @dynamic_store(%dynamic : memref<?x?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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// CHECK-NEXT: llvm.store %{{.*}}, %[[addr]] : !llvm.ptr<float>
store %val, %dynamic[%i, %j] : memref<?x?xf32>
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<float>
+// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.ptr<float>
// 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
@@ -308,65 +308,65 @@ func @dynamic_store(%dynamic : memref<?x?xf32>, %i : index, %j : index, %val : f
// 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// CHECK-NEXT: llvm.store %{{.*}}, %[[addr]] : !llvm.ptr<float>
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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)> to !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
%0 = memref_cast %static : memref<10x42xf32> to memref<?x?xf32>
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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)> to !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
%0 = memref_cast %static : memref<10x42xf32> to memref<?x42xf32>
return
}
// CHECK-LABEL: func @memref_cast_dynamic_to_static
func @memref_cast_dynamic_to_static(%dynamic : memref<?x?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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)> to !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
%0 = memref_cast %dynamic : memref<?x?xf32> to memref<10x12xf32>
return
}
// CHECK-LABEL: func @memref_cast_dynamic_to_mixed
func @memref_cast_dynamic_to_mixed(%dynamic : memref<?x?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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)> to !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
%0 = memref_cast %dynamic : memref<?x?xf32> to memref<?x12xf32>
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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)> to !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
%0 = memref_cast %mixed : memref<42x?xf32> to memref<?x?xf32>
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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)> to !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)> to !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
%0 = memref_cast %mixed : memref<42x?xf32> to memref<?x1xf32>
return
}
@@ -374,21 +374,21 @@ func @memref_cast_mixed_to_mixed(%mixed : memref<42x?xf32>) {
// 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<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)> : (!llvm.i64) -> !llvm.ptr<struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>>
+// CHECK-DAG: llvm.store %{{.*}}, %[[p]] : !llvm.ptr<struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>>
+// CHECK-DAG: %[[p2:.*]] = llvm.bitcast %[[p]] : !llvm.ptr<struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>> to !llvm.ptr<i8>
// 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<i8>)>
+// CHECK-DAG: llvm.insertvalue %[[r]], %{{.*}}[0] : !llvm.struct<(i64, ptr<i8>)>
+// CHECK-DAG: llvm.insertvalue %[[p2]], %{{.*}}[1] : !llvm.struct<(i64, ptr<i8>)>
%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<i8>)>
+// CHECK-NEXT: llvm.bitcast %[[p]] : !llvm.ptr<i8> to !llvm.ptr<struct<(ptr<float>, ptr<float>, i64, array<4 x i64>, array<4 x i64>)>>
%0 = memref_cast %arg : memref<*xf32> to memref<?x?x10x2xf32>
return
}
@@ -398,25 +398,25 @@ func @mixed_memref_dim(%mixed : memref<42x?x?x13x?xf32>) {
// 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, %[[ALIGN_PTR:.*]]: !llvm.ptr<float>, %[[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<float>, ptr<float>, 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]]
@@ -427,10 +427,10 @@ func @memref_dim_with_dyn_index(%arg : memref<3x?xf32>, %idx : index) -> index {
// 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<array<2 x i64>>
+ // CHECK-DAG: llvm.store %[[SIZES]], %[[SIZES_PTR]] : !llvm.ptr<array<2 x i64>>
+ // CHECK-DAG: %[[RESULT_PTR:.*]] = llvm.getelementptr %[[SIZES_PTR]][%[[C0]], %[[IDX]]] : (!llvm.ptr<array<2 x i64>>, !llvm.i64, !llvm.i64) -> !llvm.ptr<i64>
+ // CHECK-DAG: %[[RESULT:.*]] = llvm.load %[[RESULT_PTR]] : !llvm.ptr<i64>
// 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
index 562918b71ac8..d2a88ed952f7 100644
--- 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<void ()>>)
func @second_order_arg(%arg0 : () -> ())
-//CHECK: llvm.func @second_order_result() -> !llvm<"void ()*">
+//CHECK: llvm.func @second_order_result() -> !llvm.ptr<func<void ()>>
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<func<i32 ()>>, ptr<func<i64 ()>>, ptr<func<float ()>>)>
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<func<ptr<func<void ()>> (ptr<func<void ()>>)>>) -> !llvm.ptr<func<ptr<func<void ()>> (ptr<func<void ()>>)>>
func @third_order(%arg0 : (() -> ()) -> (() -> ())) -> ((() -> ()) -> (() -> ()))
-//CHECK: llvm.func @fifth_order_left(!llvm<"void (void (void (void ()*)*)*)*">)
+//CHECK: llvm.func @fifth_order_left(!llvm.ptr<func<void (ptr<func<void (ptr<func<void (ptr<func<void ()>>)>>)>>)>>)
func @fifth_order_left(%arg0: (((() -> ()) -> ()) -> ()) -> ())
-//CHECK: llvm.func @fifth_order_right(!llvm<"void ()* ()* ()* ()*">)
+//CHECK: llvm.func @fifth_order_right(!llvm.ptr<func<ptr<func<ptr<func<ptr<func<void ()>> ()>> ()>> ()>>)
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<float>, !llvm.ptr<float>, !llvm.i64, !llvm.i64, !llvm.i64)
func @memref_call_conv(%arg0: memref<?xf32>)
// 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<func<void (ptr<float>, ptr<float>, i64, i64, i64)>>)
func @memref_call_conv_nested(%arg0: (memref<?xf32>) -> ())
-//CHECK-LABEL: llvm.func @pass_through(%arg0: !llvm<"void ()*">) -> !llvm<"void ()*"> {
+//CHECK-LABEL: llvm.func @pass_through(%arg0: !llvm.ptr<func<void ()>>) -> !llvm.ptr<func<void ()>> {
func @pass_through(%arg0: () -> ()) -> (() -> ()) {
-// CHECK-NEXT: llvm.br ^bb1(%arg0 : !llvm<"void ()*">)
+// CHECK-NEXT: llvm.br ^bb1(%arg0 : !llvm.ptr<func<void ()>>)
br ^bb1(%arg0 : () -> ())
-//CHECK-NEXT: ^bb1(%0: !llvm<"void ()*">):
+//CHECK-NEXT: ^bb1(%0: !llvm.ptr<func<void ()>>):
^bb1(%bbarg: () -> ()):
-// CHECK-NEXT: llvm.return %0 : !llvm<"void ()*">
+// CHECK-NEXT: llvm.return %0 : !llvm.ptr<func<void ()>>
return %bbarg : () -> ()
}
@@ -43,7 +43,7 @@ func @body(i32)
// 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<func<void (i32)>>
%0 = constant @body : (i32) -> ()
// CHECK-NEXT: llvm.call %[[ADDR]](%[[ARG0:.*]]) : (!llvm.i32) -> ()
call_indirect %0(%arg0) : (i32) -> ()
@@ -51,7 +51,7 @@ func @indirect_const_call(%arg0: i32) {
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<func<i32 (float)>>, %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
index dbf8fe688428..b428d37a3616 100644
--- 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<float> {llvm.noalias = true}, %{{.*}}: !llvm.ptr<float> {llvm.noalias = true}
func @check_noalias(%static : memref<2xf32> {llvm.noalias = true}, %other : memref<2xf32> {llvm.noalias = true}) {
return
}
@@ -10,93 +10,93 @@ func @check_noalias(%static : memref<2xf32> {llvm.noalias = true}, %other : memr
// -----
// CHECK-LABEL: func @check_static_return
-// CHECK-COUNT-2: !llvm<"float*">
+// CHECK-COUNT-2: !llvm.ptr<float>
// CHECK-COUNT-5: !llvm.i64
-// CHECK-SAME: -> !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }">
+// CHECK-SAME: -> !llvm.struct<(ptr<float>, ptr<float>, 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<float>) -> !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// BAREPTR-NEXT: %[[base:.*]] = llvm.insertvalue %[[arg]], %[[udf]][0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// BAREPTR-NEXT: %[[aligned:.*]] = llvm.insertvalue %[[arg]], %[[base]][1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// BAREPTR-NEXT: llvm.return %[[ins4]] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>
// CHECK-COUNT-5: !llvm.i64
-// CHECK-SAME: -> !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }">
+// CHECK-SAME: -> !llvm.struct<(ptr<float>, ptr<float>, 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<float>) -> !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// BAREPTR-NEXT: %[[base:.*]] = llvm.insertvalue %[[arg]], %[[udf]][0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// BAREPTR-NEXT: %[[aligned:.*]] = llvm.insertvalue %[[arg]], %[[base]][1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// BAREPTR-NEXT: llvm.return %[[ins4]] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64)> {
+// BAREPTR-LABEL: func @zero_d_alloc() -> !llvm.struct<(ptr<float>, ptr<float>, i64)> {
func @zero_d_alloc() -> memref<f32> {
// 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<float>
// 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr<float> to !llvm.i64
// CHECK-NEXT: llvm.mul %{{.*}}, %[[sizeof]] : !llvm.i64
// CHECK-NEXT: %[[one_1:.*]] = llvm.mlir.constant(1 : index) : !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<i8>
+// CHECK-NEXT: %[[ptr:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<i8> to !llvm.ptr<float>
+// CHECK-NEXT: llvm.mlir.undef : !llvm.struct<(ptr<float>, ptr<float>, i64)>
+// CHECK-NEXT: llvm.insertvalue %[[ptr]], %{{.*}}[0] : !llvm.struct<(ptr<float>, ptr<float>, i64)>
+// CHECK-NEXT: llvm.insertvalue %[[ptr]], %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>
// 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// BAREPTR-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr<float> to !llvm.i64
// BAREPTR-NEXT: llvm.mul %{{.*}}, %[[sizeof]] : !llvm.i64
// BAREPTR-NEXT: %[[one_1:.*]] = llvm.mlir.constant(1 : index) : !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<i8>
+// BAREPTR-NEXT: %[[ptr:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<i8> to !llvm.ptr<float>
+// BAREPTR-NEXT: llvm.mlir.undef : !llvm.struct<(ptr<float>, ptr<float>, i64)>
+// BAREPTR-NEXT: llvm.insertvalue %[[ptr]], %{{.*}}[0] : !llvm.struct<(ptr<float>, ptr<float>, i64)>
+// BAREPTR-NEXT: llvm.insertvalue %[[ptr]], %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64)>
%0 = alloc() : memref<f32>
return %0 : memref<f32>
}
@@ -104,15 +104,15 @@ func @zero_d_alloc() -> memref<f32> {
// -----
// CHECK-LABEL: func @zero_d_dealloc
-// BAREPTR-LABEL: func @zero_d_dealloc(%{{.*}}: !llvm<"float*">) {
+// BAREPTR-LABEL: func @zero_d_dealloc(%{{.*}}: !llvm.ptr<float>) {
func @zero_d_dealloc(%arg0: memref<f32>) {
-// 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<float>, ptr<float>, i64)>
+// CHECK-NEXT: %[[bc:.*]] = llvm.bitcast %[[ptr]] : !llvm.ptr<float> to !llvm.ptr<i8>
+// CHECK-NEXT: llvm.call @free(%[[bc]]) : (!llvm.ptr<i8>) -> ()
-// 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<float>, ptr<float>, i64)>
+// BAREPTR-NEXT: %[[bc:.*]] = llvm.bitcast %[[ptr]] : !llvm.ptr<float> to !llvm.ptr<i8>
+// BAREPTR-NEXT: llvm.call @free(%[[bc]]) : (!llvm.ptr<i8>) -> ()
dealloc %arg0 : memref<f32>
return
}
@@ -123,111 +123,111 @@ func @zero_d_dealloc(%arg0: memref<f32>) {
// 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<float>
// 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr<float> to !llvm.i64
// CHECK-NEXT: llvm.mul %{{.*}}, %[[sizeof]] : !llvm.i64
// CHECK-NEXT: %[[one_1:.*]] = llvm.mlir.constant(1 : index) : !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_1]] : !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<i8>
+// CHECK-NEXT: %[[ptr:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<i8> to !llvm.ptr<float>
+// CHECK-NEXT: llvm.mlir.undef : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %[[ptr]], %{{.*}}[0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+// CHECK-NEXT: %[[allocatedAsInt:.*]] = llvm.ptrtoint %[[allocated]] : !llvm.ptr<i8> 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 %[[allocated]][%[[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 %[[allocated]][%[[alignAdj3]]] : (!llvm.ptr<i8>, !llvm.i64) -> !llvm.ptr<i8>
+// CHECK-NEXT: %[[alignedBitCast:.*]] = llvm.bitcast %[[aligned]] : !llvm.ptr<i8> to !llvm.ptr<float>
+// CHECK-NEXT: llvm.insertvalue %[[alignedBitCast]], %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>
// 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// BAREPTR-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr<float> to !llvm.i64
// BAREPTR-NEXT: llvm.mul %{{.*}}, %[[sizeof]] : !llvm.i64
// BAREPTR-NEXT: %[[one_1:.*]] = llvm.mlir.constant(1 : index) : !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_1]] : !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<i8>
+// BAREPTR-NEXT: %[[ptr:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<i8> to !llvm.ptr<float>
+// BAREPTR-NEXT: llvm.mlir.undef : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+// BAREPTR-NEXT: llvm.insertvalue %[[ptr]], %{{.*}}[0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+// BAREPTR-NEXT: %[[allocatedAsInt:.*]] = llvm.ptrtoint %[[allocated]] : !llvm.ptr<i8> 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 %[[allocated]][%[[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 %[[allocated]][%[[alignAdj3]]] : (!llvm.ptr<i8>, !llvm.i64) -> !llvm.ptr<i8>
+// BAREPTR-NEXT: %[[alignedBitCast:.*]] = llvm.bitcast %[[aligned]] : !llvm.ptr<i8> to !llvm.ptr<float>
+// BAREPTR-NEXT: llvm.insertvalue %[[alignedBitCast]], %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)> {
+// BAREPTR-LABEL: func @static_alloc() -> !llvm.struct<(ptr<float>, ptr<float>, 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<float>
// 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr<float> to !llvm.i64
// CHECK-NEXT: %[[bytes:.*]] = llvm.mul %[[num_elems]], %[[sizeof]] : !llvm.i64
// CHECK-NEXT: %[[one_1:.*]] = llvm.mlir.constant(1 : index) : !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<i8>
+// CHECK-NEXT: llvm.bitcast %[[allocated]] : !llvm.ptr<i8> to !llvm.ptr<float>
// 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<float>
// 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// BAREPTR-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr<float> to !llvm.i64
// BAREPTR-NEXT: %[[bytes:.*]] = llvm.mul %[[num_elems]], %[[sizeof]] : !llvm.i64
// BAREPTR-NEXT: %[[one_1:.*]] = llvm.mlir.constant(1 : index) : !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<i8>
+// BAREPTR-NEXT: llvm.bitcast %[[allocated]] : !llvm.ptr<i8> to !llvm.ptr<float>
%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<float>, ptr<float>, 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<float>
// 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// CHECK-NEXT: %[[sizeof:.*]] = llvm.ptrtoint %[[gep]] : !llvm.ptr<float> to !llvm.i64
// CHECK-NEXT: %[[bytes:.*]] = llvm.mul %[[num_elems]], %[[sizeof]] : !llvm.i64
// CHECK-NEXT: %[[one_1:.*]] = llvm.mlir.constant(1 : index) : !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<float>
%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<float>
+ // CHECK: %[[desc:.*]] = llvm.mlir.undef : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[desc1:.*]] = llvm.insertvalue %[[alloca_aligned]], %[[desc]][0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: llvm.insertvalue %[[alloca_aligned]], %[[desc1]][1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
alloca() {alignment = 32} : memref<32x18xf32>
return %0 : memref<32x18xf32>
}
@@ -235,15 +235,15 @@ func @static_alloca() -> memref<32x18xf32> {
// -----
// CHECK-LABEL: func @static_dealloc
-// BAREPTR-LABEL: func @static_dealloc(%{{.*}}: !llvm<"float*">) {
+// BAREPTR-LABEL: func @static_dealloc(%{{.*}}: !llvm.ptr<float>) {
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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK-NEXT: %[[bc:.*]] = llvm.bitcast %[[ptr]] : !llvm.ptr<float> to !llvm.ptr<i8>
+// CHECK-NEXT: llvm.call @free(%[[bc]]) : (!llvm.ptr<i8>) -> ()
-// 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// BAREPTR-NEXT: %[[bc:.*]] = llvm.bitcast %[[ptr]] : !llvm.ptr<float> to !llvm.ptr<i8>
+// BAREPTR-NEXT: llvm.call @free(%[[bc]]) : (!llvm.ptr<i8>) -> ()
dealloc %static : memref<10x8xf32>
return
}
@@ -251,17 +251,17 @@ func @static_dealloc(%static: memref<10x8xf32>) {
// -----
// CHECK-LABEL: func @zero_d_load
-// BAREPTR-LABEL: func @zero_d_load(%{{.*}}: !llvm<"float*">) -> !llvm.float
+// BAREPTR-LABEL: func @zero_d_load(%{{.*}}: !llvm.ptr<float>) -> !llvm.float
func @zero_d_load(%arg0: memref<f32>) -> f32 {
-// CHECK: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, float*, i64 }">
+// CHECK: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// CHECK-NEXT: %{{.*}} = llvm.load %[[addr]] : !llvm.ptr<float>
-// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, float*, i64 }">
+// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// BAREPTR-NEXT: llvm.load %[[addr:.*]] : !llvm.ptr<float>
%0 = load %arg0[] : memref<f32>
return %0 : f32
}
@@ -269,14 +269,14 @@ func @zero_d_load(%arg0: memref<f32>) -> f32 {
// -----
// CHECK-LABEL: func @static_load(
-// CHECK-COUNT-2: !llvm<"float*">,
+// CHECK-COUNT-2: !llvm.ptr<float>,
// 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<float>, %[[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<float>, ptr<float>, 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
@@ -284,10 +284,10 @@ func @static_load(%static : memref<10x42xf32>, %i : index, %j : index) {
// 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// CHECK-NEXT: llvm.load %[[addr]] : !llvm.ptr<float>
-// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }">
+// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, 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
@@ -295,8 +295,8 @@ func @static_load(%static : memref<10x42xf32>, %i : index, %j : index) {
// 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// BAREPTR-NEXT: llvm.load %[[addr]] : !llvm.ptr<float>
%0 = load %static[%i, %j] : memref<10x42xf32>
return
}
@@ -305,17 +305,17 @@ func @static_load(%static : memref<10x42xf32>, %i : index, %j : index) {
// 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<float>, %[[val:.*]]: !llvm.float)
func @zero_d_store(%arg0: memref<f32>, %arg1: f32) {
-// CHECK: %[[ptr:.*]] = llvm.extractvalue %[[ld:.*]][1] : !llvm<"{ float*, float*, i64 }">
+// CHECK: %[[ptr:.*]] = llvm.extractvalue %[[ld:.*]][1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// CHECK-NEXT: llvm.store %{{.*}}, %[[addr]] : !llvm.ptr<float>
-// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, float*, i64 }">
+// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// BAREPTR-NEXT: llvm.store %[[val]], %[[addr]] : !llvm.ptr<float>
store %arg1, %arg0[] : memref<f32>
return
}
@@ -323,8 +323,8 @@ func @zero_d_store(%arg0: memref<f32>, %arg1: f32) {
// -----
// 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<float>
+// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.ptr<float>
// 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
@@ -333,11 +333,11 @@ func @zero_d_store(%arg0: memref<f32>, %arg1: f32) {
// 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<float>
// 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<float>, ptr<float>, 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
@@ -345,10 +345,10 @@ func @static_store(%static : memref<10x42xf32>, %i : index, %j : index, %val : f
// 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// CHECK-NEXT: llvm.store %{{.*}}, %[[addr]] : !llvm.ptr<float>
-// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm<"{ float*, float*, i64, [2 x i64], [2 x i64] }">
+// BAREPTR: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, 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
@@ -356,8 +356,8 @@ func @static_store(%static : memref<10x42xf32>, %i : index, %j : index, %val : f
// 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<float>, !llvm.i64) -> !llvm.ptr<float>
+// BAREPTR-NEXT: llvm.store %{{.*}}, %[[addr]] : !llvm.ptr<float>
store %val, %static[%i, %j] : memref<10x42xf32>
return
}
@@ -365,10 +365,10 @@ func @static_store(%static : memref<10x42xf32>, %i : index, %j : index, %val : f
// -----
// CHECK-LABEL: func @static_memref_dim
-// BAREPTR-LABEL: func @static_memref_dim(%{{.*}}: !llvm<"float*">) {
+// BAREPTR-LABEL: func @static_memref_dim(%{{.*}}: !llvm.ptr<float>) {
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<float>, ptr<float>, 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
index c1ec558da86f..d0e883a10bee 100644
--- a/mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
+++ b/mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
@@ -68,11 +68,11 @@ func @simple_loop() {
// 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 @@ func @complex_numbers() {
}
// 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 @@ func @complex_addition() {
}
// 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 @more_imperfectly_nested_loops() {
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<f16>)
-// CHECK-LABEL: func @get_c32() -> !llvm<"{ float, float }">
+// CHECK-LABEL: func @get_c32() -> !llvm.struct<(float, float)>
func @get_c32() -> (complex<f32>)
-// CHECK-LABEL: func @get_c64() -> !llvm<"{ double, double }">
+// CHECK-LABEL: func @get_c64() -> !llvm.struct<(double, double)>
func @get_c64() -> (complex<f64>)
-// 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<float>, ptr<float>, i64, array<4 x i64>, array<4 x i64>)>
+// CHECK32-LABEL: func @get_memref() -> !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64, array<4 x i64>, array<4 x i64>)>)> {
+// CHECK32-LABEL: func @multireturn() -> !llvm.struct<(i64, float, struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, i64, array<4 x i64>, array<4 x i64>)>)>
+// CHECK-NEXT: {{.*}} = llvm.insertvalue {{.*}}, {{.*}}[0] : !llvm.struct<(i64, float, struct<(ptr<float>, ptr<float>, i64, array<4 x i64>, array<4 x i64>)>)>
+// CHECK-NEXT: {{.*}} = llvm.insertvalue {{.*}}, {{.*}}[1] : !llvm.struct<(i64, float, struct<(ptr<float>, ptr<float>, i64, array<4 x i64>, array<4 x i64>)>)>
+// CHECK-NEXT: {{.*}} = llvm.insertvalue {{.*}}, {{.*}}[2] : !llvm.struct<(i64, float, struct<(ptr<float>, ptr<float>, i64, array<4 x i64>, array<4 x i64>)>)>
+// CHECK-NEXT: llvm.return {{.*}} : !llvm.struct<(i64, float, struct<(ptr<float>, ptr<float>, i64, array<4 x i64>, array<4 x i64>)>)>
+// CHECK32-NEXT: {{.*}} = llvm.mlir.undef : !llvm.struct<(i64, float, struct<(ptr<float>, ptr<float>, i32, array<4 x i32>, array<4 x i32>)>)>
+// CHECK32-NEXT: {{.*}} = llvm.insertvalue {{.*}}, {{.*}}[0] : !llvm.struct<(i64, float, struct<(ptr<float>, ptr<float>, i32, array<4 x i32>, array<4 x i32>)>)>
+// CHECK32-NEXT: {{.*}} = llvm.insertvalue {{.*}}, {{.*}}[1] : !llvm.struct<(i64, float, struct<(ptr<float>, ptr<float>, i32, array<4 x i32>, array<4 x i32>)>)>
+// CHECK32-NEXT: {{.*}} = llvm.insertvalue {{.*}}, {{.*}}[2] : !llvm.struct<(i64, float, struct<(ptr<float>, ptr<float>, i32, array<4 x i32>, array<4 x i32>)>)>
+// CHECK32-NEXT: llvm.return {{.*}} : !llvm.struct<(i64, float, struct<(ptr<float>, ptr<float>, i32, array<4 x i32>, array<4 x i32>)>)>
return %0, %1, %2 : i64, f32, memref<42x?x10x?xf32>
}
@@ -468,14 +468,14 @@ func @multireturn() -> (i64, f32, memref<42x?x10x?xf32>) {
// 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<float>, ptr<float>, i64, array<4 x i64>, array<4 x i64>)>)>
+// CHECK-NEXT: {{.*}} = llvm.extractvalue {{.*}}[0] : !llvm.struct<(i64, float, struct<(ptr<float>, ptr<float>, i64, array<4 x i64>, array<4 x i64>)>)>
+// CHECK-NEXT: {{.*}} = llvm.extractvalue {{.*}}[1] : !llvm.struct<(i64, float, struct<(ptr<float>, ptr<float>, i64, array<4 x i64>, array<4 x i64>)>)>
+// CHECK-NEXT: {{.*}} = llvm.extractvalue {{.*}}[2] : !llvm.struct<(i64, float, struct<(ptr<float>, ptr<float>, i64, array<4 x i64>, array<4 x i64>)>)>
+// CHECK32-NEXT: {{.*}} = llvm.call @multireturn() : () -> !llvm.struct<(i64, float, struct<(ptr<float>, ptr<float>, i32, array<4 x i32>, array<4 x i32>)>)>
+// CHECK32-NEXT: {{.*}} = llvm.extractvalue {{.*}}[0] : !llvm.struct<(i64, float, struct<(ptr<float>, ptr<float>, i32, array<4 x i32>, array<4 x i32>)>)>
+// CHECK32-NEXT: {{.*}} = llvm.extractvalue {{.*}}[1] : !llvm.struct<(i64, float, struct<(ptr<float>, ptr<float>, i32, array<4 x i32>, array<4 x i32>)>)>
+// CHECK32-NEXT: {{.*}} = llvm.extractvalue {{.*}}[2] : !llvm.struct<(i64, float, struct<(ptr<float>, ptr<float>, 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 @@ func @multireturn_caller() {
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 @@ func @index_cast(%arg0: index, %arg1: i1) {
// 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 @@ func @fpext(%arg0 : f16, %arg1 : f32) {
// 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 @@ func @fptrunc(%arg0 : f32, %arg1 : f64) {
// 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 @@ func @vec_bin(%arg0: vector<2x2x2xf32>) -> vector<2x2x2xf32> {
%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<i8>, ptr<i8>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[BASE_PTR:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr<i8>, ptr<i8>, i64, array<1 x i64>, array<1 x i64>)>
+ // CHECK: %[[SHIFTED_BASE_PTR:.*]] = llvm.getelementptr %[[BASE_PTR]][%[[ARG2]]] : (!llvm.ptr<i8>, !llvm.i64) -> !llvm.ptr<i8>
+ // CHECK: %[[CAST_SHIFTED_BASE_PTR:.*]] = llvm.bitcast %[[SHIFTED_BASE_PTR]] : !llvm.ptr<i8> to !llvm.ptr<float>
+ // CHECK: llvm.insertvalue %[[CAST_SHIFTED_BASE_PTR]], %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: llvm.insertvalue %[[ARG1]], %{{.*}}[3, 1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: llvm.insertvalue %[[ARG0]], %{{.*}}[3, 0] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
%1 = view %0[%arg2][%arg0, %arg1] : memref<2048xi8> to memref<?x?xf32>
// 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[BASE_PTR_2:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr<i8>, ptr<i8>, i64, array<1 x i64>, array<1 x i64>)>
+ // CHECK: %[[SHIFTED_BASE_PTR_2:.*]] = llvm.getelementptr %[[BASE_PTR_2]][%[[ARG2]]] : (!llvm.ptr<i8>, !llvm.i64) -> !llvm.ptr<i8>
+ // CHECK: %[[CAST_SHIFTED_BASE_PTR_2:.*]] = llvm.bitcast %[[SHIFTED_BASE_PTR_2]] : !llvm.ptr<i8> to !llvm.ptr<float>
+ // CHECK: llvm.insertvalue %[[CAST_SHIFTED_BASE_PTR_2]], %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: llvm.insertvalue %[[ARG1]], %{{.*}}[3, 1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[BASE_PTR_3:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr<i8>, ptr<i8>, i64, array<1 x i64>, array<1 x i64>)>
+ // CHECK: %[[SHIFTED_BASE_PTR_3:.*]] = llvm.getelementptr %[[BASE_PTR_3]][%[[ARG2]]] : (!llvm.ptr<i8>, !llvm.i64) -> !llvm.ptr<i8>
+ // CHECK: %[[CAST_SHIFTED_BASE_PTR_3:.*]] = llvm.bitcast %[[SHIFTED_BASE_PTR_3]] : !llvm.ptr<i8> to !llvm.ptr<float>
+ // CHECK: llvm.insertvalue %[[CAST_SHIFTED_BASE_PTR_3]], %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>,
// 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<float>,
// 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 @@ func @subview(%0 : memref<64x4xf32, offset: 0, strides: [4, 1]>, %arg0 : index,
// 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float> to !llvm.ptr<float>
+ // CHECK: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float> to !llvm.ptr<float>
+ // CHECK: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[DESC3:.*]] = llvm.insertvalue %[[ARG1]], %[[DESC2]][3, 1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[DESC5:.*]] = llvm.insertvalue %[[ARG0]], %[[DESC4]][3, 0] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK32: %[[DESC:.*]] = llvm.mlir.undef : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float> to !llvm.ptr<float>
+ // CHECK32: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float> to !llvm.ptr<float>
+ // CHECK32: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[DESC3:.*]] = llvm.insertvalue %[[ARG1]], %[[DESC2]][3, 1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[DESC5:.*]] = llvm.insertvalue %[[ARG0]], %[[DESC4]][3, 0] : !llvm.struct<(ptr<float>, ptr<float>, 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 @@ func @subview(%0 : memref<64x4xf32, offset: 0, strides: [4, 1]>, %arg0 : index,
}
// CHECK-LABEL: func @subview_non_zero_addrspace(
-// CHECK-COUNT-2: !llvm<"float addrspace(3)*">,
+// CHECK-COUNT-2: !llvm.ptr<float, 3>,
// 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<float, 3>,
// 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 @@ func @subview_non_zero_addrspace(%0 : memref<64x4xf32, offset: 0, strides: [4, 1
// 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<float, 3>, ptr<float, 3>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float, 3> to !llvm.ptr<float, 3>
+ // CHECK: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr<float, 3>, ptr<float, 3>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float, 3> to !llvm.ptr<float, 3>
+ // CHECK: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr<float, 3>, ptr<float, 3>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr<float, 3>, ptr<float, 3>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr<float, 3>, ptr<float, 3>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm.struct<(ptr<float, 3>, ptr<float, 3>, 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<float, 3>, ptr<float, 3>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[DESC3:.*]] = llvm.insertvalue %[[ARG1]], %[[DESC2]][3, 1] : !llvm.struct<(ptr<float, 3>, ptr<float, 3>, 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<float, 3>, ptr<float, 3>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[DESC5:.*]] = llvm.insertvalue %[[ARG0]], %[[DESC4]][3, 0] : !llvm.struct<(ptr<float, 3>, ptr<float, 3>, 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<float, 3>, ptr<float, 3>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK32: %[[DESC:.*]] = llvm.mlir.undef : !llvm.struct<(ptr<float, 3>, ptr<float, 3>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float, 3> to !llvm.ptr<float, 3>
+ // CHECK32: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr<float, 3>, ptr<float, 3>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float, 3> to !llvm.ptr<float, 3>
+ // CHECK32: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr<float, 3>, ptr<float, 3>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr<float, 3>, ptr<float, 3>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr<float, 3>, ptr<float, 3>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm.struct<(ptr<float, 3>, ptr<float, 3>, 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<float, 3>, ptr<float, 3>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[DESC3:.*]] = llvm.insertvalue %[[ARG1]], %[[DESC2]][3, 1] : !llvm.struct<(ptr<float, 3>, ptr<float, 3>, 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<float, 3>, ptr<float, 3>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[DESC5:.*]] = llvm.insertvalue %[[ARG0]], %[[DESC4]][3, 0] : !llvm.struct<(ptr<float, 3>, ptr<float, 3>, 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 @@ func @subview_non_zero_addrspace(%0 : memref<64x4xf32, offset: 0, strides: [4, 1
}
// 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<float>,
+// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.ptr<float>,
// 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 @@ func @subview_non_zero_addrspace(%0 : memref<64x4xf32, offset: 0, strides: [4, 1
// 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<float>,
+// CHECK32-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.ptr<float>,
// 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 @@ func @subview_const_size(%0 : memref<64x4xf32, offset: 0, strides: [4, 1]>, %arg
// 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float> to !llvm.ptr<float>
+ // CHECK: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float> to !llvm.ptr<float>
+ // CHECK: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK32: %[[DESC:.*]] = llvm.mlir.undef : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float> to !llvm.ptr<float>
+ // CHECK32: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float> to !llvm.ptr<float>
+ // CHECK32: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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 @@ func @subview_const_size(%0 : memref<64x4xf32, offset: 0, strides: [4, 1]>, %arg
}
// 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<float>,
+// CHECK-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.ptr<float>,
// 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 @@ func @subview_const_size(%0 : memref<64x4xf32, offset: 0, strides: [4, 1]>, %arg
// 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<float>,
+// CHECK32-SAME: %[[ARG1:[a-zA-Z0-9]*]]: !llvm.ptr<float>,
// 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 @@ func @subview_const_stride(%0 : memref<64x4xf32, offset: 0, strides: [4, 1]>, %a
// 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float> to !llvm.ptr<float>
+ // CHECK: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float> to !llvm.ptr<float>
+ // CHECK: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[DESC3:.*]] = llvm.insertvalue %[[ARG8]], %[[DESC2]][3, 1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK: %[[DESC5:.*]] = llvm.insertvalue %[[ARG7]], %[[DESC4]][3, 0] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+ // CHECK32: %[[DESC:.*]] = llvm.mlir.undef : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float> to !llvm.ptr<float>
+ // CHECK32: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float> to !llvm.ptr<float>
+ // CHECK32: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[DESC3:.*]] = llvm.insertvalue %[[ARG8]], %[[DESC2]][3, 1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[DESC5:.*]] = llvm.insertvalue %[[ARG7]], %[[DESC4]][3, 0] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<?x?xf32, offset: ?, strides: [4, 2]>
@@ -1102,23 +1102,23 @@ func @subview_const_stride_and_offset(%0 : memref<64x4xf32, offset: 0, strides:
// 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<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float> to !llvm.ptr<float>
+ // CHECK32: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float> to !llvm.ptr<float>
+ // CHECK32: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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 @@ func @subview_const_stride_and_offset(%0 : memref<64x4xf32, offset: 0, strides:
}
// CHECK-LABEL: func @subview_mixed_static_dynamic(
-// CHECK-COUNT-2: !llvm<"float*">,
+// CHECK-COUNT-2: !llvm.ptr<float>,
// 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<float>,
// 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 @@ func @subview_mixed_static_dynamic(%0 : memref<64x4xf32, offset: 0, strides: [4,
// 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<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[BITCAST0:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float> to !llvm.ptr<float>
+ // CHECK32: %[[DESC0:.*]] = llvm.insertvalue %[[BITCAST0]], %[[DESC]][0] : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[BITCAST1:.*]] = llvm.bitcast %{{.*}} : !llvm.ptr<float> to !llvm.ptr<float>
+ // CHECK32: %[[DESC1:.*]] = llvm.insertvalue %[[BITCAST1]], %[[DESC0]][1] : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[STRIDE0:.*]] = llvm.extractvalue %[[MEMREF]][4, 0] : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[STRIDE1:.*]] = llvm.extractvalue %[[MEMREF]][4, 1] : !llvm.struct<(ptr<float>, ptr<float>, i32, array<2 x i32>, array<2 x i32>)>
+ // CHECK32: %[[OFF:.*]] = llvm.extractvalue %[[MEMREF]][2] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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 @@ func @generic_atomic_rmw(%I : memref<10xf32>, %i : index) -> f32 {
%c1 = constant 1.0 : f32
atomic_yield %c1 : f32
}
- // CHECK: [[init:%.*]] = llvm.load %{{.*}} : !llvm<"float*">
+ // CHECK: [[init:%.*]] = llvm.load %{{.*}} : !llvm.ptr<float>
// 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 @@ func @generic_atomic_rmw(%I : memref<10xf32>, %i : index) -> f32 {
// 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<half>, ptr<half>, 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<half> 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 @@ func @assume_alignment(%0 : memref<4x4xf16>) {
// 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>
}
@@ -1281,13 +1281,13 @@ func @bfloat(%arg0: bf16) -> bf16 {
// -----
// CHECK-LABEL: func @memref_index
-// CHECK-SAME: %arg0: !llvm<"i64*">, %arg1: !llvm<"i64*">,
+// CHECK-SAME: %arg0: !llvm.ptr<i64>, %arg1: !llvm.ptr<i64>,
// CHECK-SAME: %arg2: !llvm.i64, %arg3: !llvm.i64, %arg4: !llvm.i64)
-// CHECK-SAME: -> !llvm<"{ i64*, i64*, i64, [1 x i64], [1 x i64] }">
+// CHECK-SAME: -> !llvm.struct<(ptr<i64>, ptr<i64>, i64, array<1 x i64>, array<1 x i64>)>
// CHECK32-LABEL: func @memref_index
-// CHECK32-SAME: %arg0: !llvm<"i32*">, %arg1: !llvm<"i32*">,
+// CHECK32-SAME: %arg0: !llvm.ptr<i32>, %arg1: !llvm.ptr<i32>,
// CHECK32-SAME: %arg2: !llvm.i32, %arg3: !llvm.i32, %arg4: !llvm.i32)
-// CHECK32-SAME: -> !llvm<"{ i32*, i32*, i32, [1 x i32], [1 x i32] }">
+// CHECK32-SAME: -> !llvm.struct<(ptr<i32>, ptr<i32>, i32, array<1 x i32>, array<1 x i32>)>
func @memref_index(%arg0: memref<32xindex>) -> memref<32xindex> {
return %arg0 : memref<32xindex>
}
diff --git a/mlir/test/Conversion/StandardToLLVM/invalid.mlir b/mlir/test/Conversion/StandardToLLVM/invalid.mlir
index 56e661242336..469bb9753ec4 100644
--- a/mlir/test/Conversion/StandardToLLVM/invalid.mlir
+++ b/mlir/test/Conversion/StandardToLLVM/invalid.mlir
@@ -24,8 +24,8 @@ func @mlir_cast_to_llvm_int(%0 : i32) -> !llvm.i64 {
// -----
-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 at +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
index a6006023a509..c55950a55634 100644
--- 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<float, 7>
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<float, 5>
%2 = load %0[%1] : memref<32xf32, affine_map<(d0) -> (d0)>, 5>
std.return
}
@@ -53,11 +53,11 @@ func @rsqrt_double(%arg0 : f64) {
// -----
// 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 @@ func @rsqrt_vector(%arg0 : vector<4xf32>) {
// -----
// 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
index eab211ffaaf4..a2a47b0eff26 100644
--- 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 @@ func @reduce_add_f32(%arg0: vector<16xf32>) -> f32 {
//
// 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
index c5259a17fcef..2e5aae886c38 100644
--- a/mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
+++ b/mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
@@ -6,11 +6,11 @@ func @broadcast_vec1d_from_scalar(%arg0: f32) -> vector<2xf32> {
}
// 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 @@ func @broadcast_vec2d_from_scalar(%arg0: f32) -> vector<2x3xf32> {
}
// 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 @@ func @broadcast_vec3d_from_scalar(%arg0: f32) -> vector<2x3x4xf32> {
}
// 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 @@ func @extract_element(%arg0: vector<16xf32>) -> f32 {
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 @@ func @extract_element_from_vec_1d(%arg0: vector<16xf32>) -> f32 {
}
// 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 @@ func @extract_vec_2d_from_vec_3d(%arg0: vector<4x3x16xf32>) -> vector<3x16xf32>
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 @@ func @insert_element(%arg0: f32, %arg1: vector<4xf32>) -> vector<4xf32> {
}
// 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 @@ func @insert_element_into_vec_1d(%arg0: f32, %arg1: vector<4xf32>) -> vector<4xf
}
// 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<vector<8x8x8xf32>> {
%0 = vector.type_cast %arg0: memref<8x8x8xf32> to memref<vector<8x8x8xf32>>
return %0 : memref<vector<8x8x8xf32>>
}
// 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<array<8 x array<8 x vec<8 x float>>>>, ptr<array<8 x array<8 x vec<8 x float>>>>, i64)>
+// CHECK: %[[allocated:.*]] = llvm.extractvalue {{.*}}[0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK: %[[allocatedBit:.*]] = llvm.bitcast %[[allocated]] : !llvm.ptr<float> to !llvm.ptr<array<8 x array<8 x vec<8 x float>>>>
+// CHECK: llvm.insertvalue %[[allocatedBit]], {{.*}}[0] : !llvm.struct<(ptr<array<8 x array<8 x vec<8 x float>>>>, ptr<array<8 x array<8 x vec<8 x float>>>>, i64)>
+// CHECK: %[[aligned:.*]] = llvm.extractvalue {{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK: %[[alignedBit:.*]] = llvm.bitcast %[[aligned]] : !llvm.ptr<float> to !llvm.ptr<array<8 x array<8 x vec<8 x float>>>>
+// CHECK: llvm.insertvalue %[[alignedBit]], {{.*}}[1] : !llvm.struct<(ptr<array<8 x array<8 x vec<8 x float>>>>, ptr<array<8 x array<8 x vec<8 x float>>>>, 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<array<8 x array<8 x vec<8 x float>>>>, ptr<array<8 x array<8 x vec<8 x float>>>>, i64)>
func @vector_type_cast_non_zero_addrspace(%arg0: memref<8x8x8xf32, 3>) -> memref<vector<8x8x8xf32>, 3> {
%0 = vector.type_cast %arg0: memref<8x8x8xf32, 3> to memref<vector<8x8x8xf32>, 3>
return %0 : memref<vector<8x8x8xf32>, 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<array<8 x array<8 x vec<8 x float>>>, 3>, ptr<array<8 x array<8 x vec<8 x float>>>, 3>, i64)>
+// CHECK: %[[allocated:.*]] = llvm.extractvalue {{.*}}[0] : !llvm.struct<(ptr<float, 3>, ptr<float, 3>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK: %[[allocatedBit:.*]] = llvm.bitcast %[[allocated]] : !llvm.ptr<float, 3> to !llvm.ptr<array<8 x array<8 x vec<8 x float>>>, 3>
+// CHECK: llvm.insertvalue %[[allocatedBit]], {{.*}}[0] : !llvm.struct<(ptr<array<8 x array<8 x vec<8 x float>>>, 3>, ptr<array<8 x array<8 x vec<8 x float>>>, 3>, i64)>
+// CHECK: %[[aligned:.*]] = llvm.extractvalue {{.*}}[1] : !llvm.struct<(ptr<float, 3>, ptr<float, 3>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK: %[[alignedBit:.*]] = llvm.bitcast %[[aligned]] : !llvm.ptr<float, 3> to !llvm.ptr<array<8 x array<8 x vec<8 x float>>>, 3>
+// CHECK: llvm.insertvalue %[[alignedBit]], {{.*}}[1] : !llvm.struct<(ptr<array<8 x array<8 x vec<8 x float>>>, 3>, ptr<array<8 x array<8 x vec<8 x float>>>, 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<array<8 x array<8 x vec<8 x float>>>, 3>, ptr<array<8 x array<8 x vec<8 x float>>>, 3>, i64)>
func @vector_print_scalar_i1(%arg0: i1) {
vector.print %arg0 : i1
@@ -482,27 +482,27 @@ func @vector_print_vector(%arg0: vector<2x2xf32>) {
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 @@ func @extract_strided_slice1(%arg0: vector<4xf32>) -> vector<2xf32> {
}
// 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 @@ func @extract_strided_slice2(%arg0: vector<4x8xf32>) -> vector<2x8xf32> {
}
// 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 @@ func @extract_strided_slice3(%arg0: vector<4x8xf32>) -> vector<2x2xf32> {
}
// 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 @@ func @insert_strided_slice2(%a: vector<2x2xf32>, %b: vector<4x4xf32>) -> vector<
// 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 @@ func @insert_strided_slice3(%arg0: vector<2x4xf32>, %arg1: vector<16x4x8xf32>) -
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 @@ func @extract_strides(%arg0: vector<3x3xf32>) -> vector<1x1xf32> {
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 @@ func @reduce_f32(%arg0: vector<16xf32>) -> f32 {
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 @@ func @reduce_f64(%arg0: vector<16xf64>) -> f64 {
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 @@ func @reduce_i32(%arg0: vector<16xi32>) -> i32 {
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 @@ func @reduce_i64(%arg0: vector<16xi64>) -> i64 {
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 @@ func @matrix_ops(%A: vector<64xf64>, %B: vector<48xf64>) -> vector<12xf64> {
// 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<?xf32>, %base: index) -> vector<17xf32> {
%f7 = constant 7.0: f32
@@ -773,72 +773,72 @@ func @transfer_read_1d(%A : memref<?xf32>, %base: index) -> vector<17xf32> {
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<float>, !llvm.i64) -> !llvm.ptr<float>
// CHECK: %[[vecPtr:.*]] = llvm.bitcast %[[gep]] :
-// CHECK-SAME: !llvm<"float*"> to !llvm<"<17 x float>*">
+// CHECK-SAME: !llvm.ptr<float> to !llvm.ptr<vec<17 x float>>
//
// 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<float>, ptr<float>, 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<vec<17 x float>>, !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<float>, !llvm.i64) -> !llvm.ptr<float>
// CHECK: %[[vecPtr_b:.*]] = llvm.bitcast %[[gep_b]] :
-// CHECK-SAME: !llvm<"float*"> to !llvm<"<17 x float>*">
+// CHECK-SAME: !llvm.ptr<float> to !llvm.ptr<vec<17 x float>>
//
// 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 @@ func @transfer_read_1d(%A : memref<?xf32>, %base: index) -> vector<17xf32> {
// 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<vec<17 x float>>
func @transfer_read_2d_to_1d(%A : memref<?x?xf32>, %base0: index, %base1: index) -> vector<17xf32> {
%f7 = constant 7.0: f32
@@ -862,14 +862,14 @@ func @transfer_read_2d_to_1d(%A : memref<?x?xf32>, %base0: index, %base1: index)
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 @@ func @transfer_read_2d_to_1d(%A : memref<?x?xf32>, %base0: index, %base1: index)
// [ 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<float>, ptr<float>, 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<?xf32, 3>, %base: index) -> vector<17xf32> {
%f7 = constant 7.0: f32
@@ -901,23 +901,23 @@ func @transfer_read_1d_non_zero_addrspace(%A : memref<?xf32, 3>, %base: index) -
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<float, 3>, !llvm.i64) -> !llvm.ptr<float, 3>
// CHECK: %[[vecPtr:.*]] = llvm.addrspacecast %[[gep]] :
-// CHECK-SAME: !llvm<"float addrspace(3)*"> to !llvm<"<17 x float>*">
+// CHECK-SAME: !llvm.ptr<float, 3> to !llvm.ptr<vec<17 x float>>
//
// 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<float, 3>, ptr<float, 3>, 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<float, 3>, !llvm.i64) -> !llvm.ptr<float, 3>
// CHECK: %[[vecPtr_b:.*]] = llvm.addrspacecast %[[gep_b]] :
-// CHECK-SAME: !llvm<"float addrspace(3)*"> to !llvm<"<17 x float>*">
+// CHECK-SAME: !llvm.ptr<float, 3> to !llvm.ptr<vec<17 x float>>
func @transfer_read_1d_not_masked(%A : memref<?xf32>, %base: index) -> vector<17xf32> {
%f7 = constant 7.0: f32
@@ -926,24 +926,24 @@ func @transfer_read_1d_not_masked(%A : memref<?xf32>, %base: index) -> vector<17
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<float>, !llvm.i64) -> !llvm.ptr<float>
// CHECK: %[[vecPtr:.*]] = llvm.bitcast %[[gep]] :
-// CHECK-SAME: !llvm<"float*"> to !llvm<"<17 x float>*">
+// CHECK-SAME: !llvm.ptr<float> to !llvm.ptr<vec<17 x float>>
//
// 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<vec<17 x float>>
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 @@ func @genbool_2d() -> vector<4x4xi1> {
}
// 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<false> : 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<false> : 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 @@ func @flat_transpose(%arg0: vector<16xf32>) -> vector<16xf32> {
}
// 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<?xf32>, %arg1: vector<3xi32>, %arg2: vector<3xi1>, %arg3: vector<3xf32>) -> vector<3xf32> {
%0 = vector.gather %arg0, %arg1, %arg2, %arg3 : (memref<?xf32>, vector<3xi32>, vector<3xi1>, vector<3xf32>) -> vector<3xf32>
@@ -976,9 +976,9 @@ func @gather_op(%arg0: memref<?xf32>, %arg1: vector<3xi32>, %arg2: vector<3xi1>,
}
// 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<float>, !llvm.vec<3 x i32>) -> !llvm.vec<3 x ptr<float>>
+// CHECK: %[[G:.*]] = llvm.intr.masked.gather %[[P]], %{{.*}}, %{{.*}} {alignment = 4 : i32} : (!llvm.vec<3 x ptr<float>>, !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<?xf32>, %arg1: vector<3xi32>, %arg2: vector<3xi1>, %arg3: vector<3xf32>) {
vector.scatter %arg0, %arg1, %arg2, %arg3 : vector<3xi32>, vector<3xi1>, vector<3xf32> into memref<?xf32>
@@ -986,6 +986,6 @@ func @scatter_op(%arg0: memref<?xf32>, %arg1: vector<3xi32>, %arg2: vector<3xi1>
}
// 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<float>, !llvm.vec<3 x i32>) -> !llvm.vec<3 x ptr<float>>
+// 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<float>>
// CHECK: llvm.return
diff --git a/mlir/test/Conversion/VectorToROCDL/vector-to-rocdl.mlir b/mlir/test/Conversion/VectorToROCDL/vector-to-rocdl.mlir
index 1113197aa589..f8522c896008 100644
--- a/mlir/test/Conversion/VectorToROCDL/vector-to-rocdl.mlir
+++ b/mlir/test/Conversion/VectorToROCDL/vector-to-rocdl.mlir
@@ -9,7 +9,7 @@ func @transfer_readx2(%A : memref<?xf32>, %base: index) -> vector<2xf32> {
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<?xf32>, %base: index) -> vector<4xf32> {
%f0 = constant 0.0: f32
@@ -19,7 +19,7 @@ func @transfer_readx4(%A : memref<?xf32>, %base: index) -> vector<4xf32> {
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<?xf32>, %base: index) -> vector<4xf32> {
%f0 = constant 0.0: f32
@@ -43,7 +43,7 @@ func @transfer_writex2(%A : memref<?xf32>, %B : vector<2xf32>, %base: index) {
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<?xf32>, %B : vector<4xf32>, %base: index) {
vector.transfer_write %B, %A[%base]
@@ -52,7 +52,7 @@ func @transfer_writex4(%A : memref<?xf32>, %B : vector<4xf32>, %base: index) {
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<?xf32>, %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
index 43b2434a2cdf..739d23a59f05 100644
--- a/mlir/test/Dialect/GPU/invalid.mlir
+++ b/mlir/test/Dialect/GPU/invalid.mlir
@@ -89,7 +89,7 @@ module attributes {gpu.container_module} {
module attributes {gpu.container_module} {
module @kernels {
// expected-error at +1 {{'gpu.func' op expects parent op 'gpu.module'}}
- gpu.func @kernel_1(%arg1 : !llvm<"float*">) {
+ gpu.func @kernel_1(%arg1 : !llvm.ptr<float>) {
gpu.return
}
}
@@ -128,16 +128,16 @@ module attributes {gpu.container_module} {
module attributes {gpu.container_module} {
module @kernels {
- gpu.func @kernel_1(%arg1 : !llvm<"float*">) kernel {
+ gpu.func @kernel_1(%arg1 : !llvm.ptr<float>) 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<float>) {
// expected-error at +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<float>) -> ()
return
}
}
@@ -146,16 +146,16 @@ module attributes {gpu.container_module} {
module attributes {gpu.container_module} {
gpu.module @kernels {
- gpu.func @kernel_1(%arg1 : !llvm<"float*">) {
+ gpu.func @kernel_1(%arg1 : !llvm.ptr<float>) {
gpu.return
}
}
- func @launch_func_missing_kernel_attr(%sz : index, %arg : !llvm<"float*">) {
+ func @launch_func_missing_kernel_attr(%sz : index, %arg : !llvm.ptr<float>) {
// expected-error at +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<float>) -> ()
return
}
}
@@ -164,17 +164,17 @@ module attributes {gpu.container_module} {
module attributes {gpu.container_module} {
gpu.module @kernels {
- gpu.func @kernel_1(%arg1 : !llvm<"float*">) kernel {
+ gpu.func @kernel_1(%arg1 : !llvm.ptr<float>) 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<float>) {
// expected-error at +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<float>,
+ !llvm.ptr<float>) -> ()
return
}
}
diff --git a/mlir/test/Dialect/GPU/multiple-all-reduce.mlir b/mlir/test/Dialect/GPU/multiple-all-reduce.mlir
index f1437dbb1adb..a084faec29c8 100644
--- a/mlir/test/Dialect/GPU/multiple-all-reduce.mlir
+++ b/mlir/test/Dialect/GPU/multiple-all-reduce.mlir
@@ -18,8 +18,8 @@ func @main() {
}
// 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
index 9a3206f31345..23a8b9d98881 100644
--- a/mlir/test/Dialect/GPU/outlining.mlir
+++ b/mlir/test/Dialect/GPU/outlining.mlir
@@ -143,7 +143,7 @@ func @function_call(%arg0 : memref<?xf32>) {
%block_z = %cst) {
call @device_function() : () -> ()
call @device_function() : () -> ()
- %0 = llvm.mlir.addressof @global : !llvm<"i64*">
+ %0 = llvm.mlir.addressof @global : !llvm.ptr<i64>
gpu.terminator
}
return
@@ -163,7 +163,7 @@ func @recursive_device_function() {
// 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<i64>
// 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
index 689e6db54065..65dc33cc1c4f 100644
--- 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<void ()>
// GENERIC-SAME: () -> ()
// CHECK: llvm.func @foo()
"llvm.func"() ({
- }) {sym_name = "foo", type = !llvm<"void ()">} : () -> ()
+ }) {sym_name = "foo", type = !llvm.func<void ()>} : () -> ()
// GENERIC: "llvm.func"
// GENERIC: sym_name = "bar"
- // GENERIC-SAME: type = !llvm<"i64 (i64, i64)">
+ // GENERIC-SAME: type = !llvm.func<i64 (i64, i64)>
// 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<i64 (i64, i64)>} : () -> ()
// GENERIC: "llvm.func"
// CHECK: llvm.func @baz(%{{.*}}: !llvm.i64) -> !llvm.i64
@@ -27,14 +27,14 @@ module {
llvm.return %arg0 : !llvm.i64
// GENERIC: sym_name = "baz"
- // GENERIC-SAME: type = !llvm<"i64 (i64)">
+ // GENERIC-SAME: type = !llvm.func<i64 (i64)>
// GENERIC-SAME: () -> ()
- }) {sym_name = "baz", type = !llvm<"i64 (i64)">} : () -> ()
+ }) {sym_name = "baz", type = !llvm.func<i64 (i64)>} : () -> ()
- // CHECK: llvm.func @qux(!llvm<"i64*"> {llvm.noalias = true}, !llvm.i64)
+ // CHECK: llvm.func @qux(!llvm.ptr<i64> {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<void (ptr<i64>, i64)>,
arg0 = {llvm.noalias = true}, xxx = {yyy = 42}} : () -> ()
// CHECK: llvm.func @roundtrip1()
@@ -69,20 +69,20 @@ module {
// 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<i32> {llvm.noalias = true})
+ llvm.func @roundtrip9(!llvm.ptr<i32> {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<i32> {llvm.noalias = true})
+ llvm.func @roundtrip10(%arg0: !llvm.ptr<i32> {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<i32> {llvm.noalias = true}) {
+ llvm.func @roundtrip11(%arg0: !llvm.ptr<i32> {llvm.noalias = true}) {
llvm.return
}
- // CHECK: llvm.func @roundtrip12(%{{.*}}: !llvm<"i32*"> {llvm.noalias = true})
+ // CHECK: llvm.func @roundtrip12(%{{.*}}: !llvm.ptr<i32> {llvm.noalias = true})
// CHECK: attributes {foo = 42 : i32}
- llvm.func @roundtrip12(%arg0: !llvm<"i32*"> {llvm.noalias = true})
+ llvm.func @roundtrip12(%arg0: !llvm.ptr<i32> {llvm.noalias = true})
attributes {foo = 42 : i32} {
llvm.return
}
@@ -119,7 +119,7 @@ module {
module {
// expected-error at +1 {{requires one region}}
- "llvm.func"() {sym_name = "no_region", type = !llvm<"void ()">} : () -> ()
+ "llvm.func"() {sym_name = "no_region", type = !llvm.func<void ()>} : () -> ()
}
// -----
@@ -140,7 +140,7 @@ module {
module {
// expected-error at +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 @@ module {
"llvm.func"() ({
^bb0(%arg0: !llvm.i64):
llvm.return
- }) {sym_name = "wrong_arg_number", type = !llvm<"void ()">} : () -> ()
+ }) {sym_name = "wrong_arg_number", type = !llvm.func<void ()>} : () -> ()
}
// -----
@@ -160,7 +160,7 @@ module {
"llvm.func"() ({
^bb0(%arg0: i64):
llvm.return
- }) {sym_name = "wrong_arg_number", type = !llvm<"void (i64)">} : () -> ()
+ }) {sym_name = "wrong_arg_number", type = !llvm.func<void (i64)>} : () -> ()
}
// -----
@@ -170,7 +170,7 @@ module {
"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<void (i64)>} : () -> ()
}
// -----
diff --git a/mlir/test/Dialect/LLVMIR/global.mlir b/mlir/test/Dialect/LLVMIR/global.mlir
index e3faec63f00a..7d7860645ee9 100644
--- a/mlir/test/Dialect/LLVMIR/global.mlir
+++ b/mlir/test/Dialect/LLVMIR/global.mlir
@@ -13,7 +13,7 @@ llvm.mlir.global internal @global(42 : i64) : !llvm.i64
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 @@ llvm.mlir.global weak_odr @weak_odr() : !llvm.i64
// 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<i64>
+ %0 = llvm.mlir.addressof @global : !llvm.ptr<i64>
- // 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<array<6 x i8>>
+ %1 = llvm.mlir.addressof @".string" : !llvm.ptr<array<6 x i8>>
llvm.return
}
@@ -76,7 +76,7 @@ func @references() {
// -----
// 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 @@ func @foo() {
// -----
// 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 @@ func @foo() {
// 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<void ()>>
}
// -----
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<func<void ()>>
}
// -----
@@ -141,7 +141,7 @@ llvm.mlir.global internal @foo(0: i32) : !llvm.i32
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<i64>
}
// -----
@@ -150,7 +150,7 @@ llvm.func @foo()
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<i8>
}
// -----
@@ -182,7 +182,7 @@ llvm.mlir.global internal @g(43 : i64) : !llvm.i64 {
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<i64>
}
// -----
@@ -190,5 +190,5 @@ func @mismatch_addr_space_implicit_global() {
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<i64, 4>
}
diff --git a/mlir/test/Dialect/LLVMIR/invalid.mlir b/mlir/test/Dialect/LLVMIR/invalid.mlir
index 6ef25f85a506..b4475df66fd1 100644
--- a/mlir/test/Dialect/LLVMIR/invalid.mlir
+++ b/mlir/test/Dialect/LLVMIR/invalid.mlir
@@ -18,7 +18,7 @@ func @invalid_align(%arg0: !llvm.i32 {llvm.align = "foo"}) {
// -----
-func @icmp_non_string(%arg0 : !llvm.i32, %arg1 : !llvm<"i16">) {
+func @icmp_non_string(%arg0 : !llvm.i32, %arg1 : !llvm.i16) {
// expected-error at +1 {{invalid kind of attribute specified}}
llvm.icmp 42 %arg0, %arg0 : !llvm.i32
return
@@ -26,7 +26,7 @@ func @icmp_non_string(%arg0 : !llvm.i32, %arg1 : !llvm<"i16">) {
// -----
-func @icmp_wrong_string(%arg0 : !llvm.i32, %arg1 : !llvm<"i16">) {
+func @icmp_wrong_string(%arg0 : !llvm.i32, %arg1 : !llvm.i16) {
// expected-error at +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_result_type(%size : !llvm.i64) {
func @alloca_missing_input_type() {
// expected-error at +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<i32>)
}
// -----
@@ -57,42 +57,42 @@ func @alloca_mising_result_type() {
func @alloca_non_function_type() {
// expected-error at +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<i32>
}
// -----
func @alloca_nonpositive_alignment(%size : !llvm.i64) {
// expected-error at +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<i32>)
}
// -----
-func @gep_missing_input_result_type(%pos : !llvm.i64, %base : !llvm<"float*">) {
+func @gep_missing_input_result_type(%pos : !llvm.i64, %base : !llvm.ptr<float>) {
// expected-error at +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<float>) {
// expected-error at +1 {{2 operands present, but expected 0}}
- llvm.getelementptr %base[%pos] : () -> (!llvm<"float*">)
+ llvm.getelementptr %base[%pos] : () -> (!llvm.ptr<float>)
}
// -----
-func @gep_missing_result_type(%pos : !llvm.i64, %base : !llvm<"float*">) {
+func @gep_missing_result_type(%pos : !llvm.i64, %base : !llvm.ptr<float>) {
// expected-error at +1 {{op requires one result}}
- llvm.getelementptr %base[%pos] : (!llvm<"float *">, !llvm.i64) -> ()
+ llvm.getelementptr %base[%pos] : (!llvm.ptr<float>, !llvm.i64) -> ()
}
// -----
-func @gep_non_function_type(%pos : !llvm.i64, %base : !llvm<"float*">) {
+func @gep_non_function_type(%pos : !llvm.i64, %base : !llvm.ptr<float>) {
// expected-error at +1 {{invalid kind of type specified}}
- llvm.getelementptr %base[%pos] : !llvm<"float*">
+ llvm.getelementptr %base[%pos] : !llvm.ptr<float>
}
// -----
@@ -125,9 +125,9 @@ func @store_non_ptr_type(%foo : !llvm.float, %bar : !llvm.float) {
// -----
-func @call_non_function_type(%callee : !llvm<"i8(i8)">, %arg : !llvm<"i8">) {
+func @call_non_function_type(%callee : !llvm.func<i8 (i8)>, %arg : !llvm.i8) {
// expected-error at +1 {{expected function type}}
- llvm.call %callee(%arg) : !llvm<"i8(i8)">
+ llvm.call %callee(%arg) : !llvm.func<i8 (i8)>
}
// -----
@@ -155,7 +155,7 @@ func @call_non_llvm_input(%callee : (i32) -> (), %arg : i32) {
func @constant_wrong_type() {
// expected-error at +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<func<void ()>>
}
// -----
@@ -171,35 +171,35 @@ func @insertvalue_non_array_position() {
// Note the double-type, otherwise attribute parsing consumes the trailing
// type of the op as the (wrong) attribute type.
// expected-error at +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 at +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 at +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 at +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 at +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 @@ func @extractvalue_non_array_position() {
// Note the double-type, otherwise attribute parsing consumes the trailing
// type of the op as the (wrong) attribute type.
// expected-error at +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 at +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 at +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 at +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 at +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 at +1 {{expected LLVM IR dialect vector type for operand #1}}
%0 = llvm.extractelement %arg2[%arg1 : !llvm.i32] : !llvm.float
}
@@ -257,7 +257,7 @@ func @invalid_vector_type_1(%arg0: !llvm<"<4 x float>">, %arg1: !llvm.i32, %arg2
// -----
// 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 at +1 {{expected LLVM IR dialect vector type for operand #1}}
%0 = llvm.insertelement %arg2, %arg2[%arg1 : !llvm.i32] : !llvm.float
}
@@ -265,7 +265,7 @@ func @invalid_vector_type_2(%arg0: !llvm<"<4 x float>">, %arg1: !llvm.i32, %arg2
// -----
// 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 at +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 @@ func @null_non_llvm_type() {
// 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 at +1 {{expected return type !llvm<"{ ?, i1 }">}}
+ // expected-error at +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 @@ func @nvvm_invalid_shfl_pred_1(%arg0 : !llvm.i32, %arg1 : !llvm.i32, %arg2 : !ll
// 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 at +1 {{expected return type !llvm<"{ ?, i1 }">}}
- %0 = nvvm.shfl.sync.bfly %arg0, %arg3, %arg1, %arg2 {return_value_and_is_valid} : !llvm<"{ i32 }">
+ // expected-error at +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 at +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 at +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 at +1 {{expected operands to be 4 <halfx2>s followed by either 4 <halfx2>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 at +1 {{expected result type to be a struct of either 4 <halfx2>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 at +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 at +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 at +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 at +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 at +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 at +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 at +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 @@ func @atomicrmw_expected_ptr(%f32 : !llvm.float) {
// -----
// CHECK-LABEL: @atomicrmw_mismatched_operands
-func @atomicrmw_mismatched_operands(%f32_ptr : !llvm<"float*">, %i32 : !llvm.i32) {
+func @atomicrmw_mismatched_operands(%f32_ptr : !llvm.ptr<float>, %i32 : !llvm.i32) {
// expected-error at +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<float>, !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<float>, %f32 : !llvm.float) {
// expected-error at +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<float>, !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>, %i32 : !llvm.i32) {
// expected-error at +1 {{expected LLVM IR floating point type}}
%0 = llvm.atomicrmw fadd %i32_ptr, %i32 unordered : !llvm.i32
llvm.return
@@ -446,7 +436,7 @@ func @atomicrmw_expected_float(%i32_ptr : !llvm<"i32*">, %i32 : !llvm.i32) {
// -----
// 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>, %i1 : !llvm.i1) {
// expected-error at +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 @@ func @atomicrmw_unexpected_xchg_type(%i1_ptr : !llvm<"i1*">, %i1 : !llvm.i1) {
// -----
// CHECK-LABEL: @atomicrmw_expected_int
-func @atomicrmw_expected_int(%f32_ptr : !llvm<"float*">, %f32 : !llvm.float) {
+func @atomicrmw_expected_int(%f32_ptr : !llvm.ptr<float>, %f32 : !llvm.float) {
// expected-error at +1 {{expected LLVM IR integer type}}
%0 = llvm.atomicrmw max %f32_ptr, %f32 unordered : !llvm.float
llvm.return
@@ -464,25 +454,25 @@ func @atomicrmw_expected_int(%f32_ptr : !llvm<"float*">, %f32 : !llvm.float) {
// -----
// CHECK-LABEL: @cmpxchg_expected_ptr
-func @cmpxchg_expected_ptr(%f32_ptr : !llvm<"float*">, %f32 : !llvm.float) {
+func @cmpxchg_expected_ptr(%f32_ptr : !llvm.ptr<float>, %f32 : !llvm.float) {
// expected-error at +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<float>, %i32 : !llvm.i32) {
// expected-error at +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<float>, !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>, %i1 : !llvm.i1) {
// expected-error at +1 {{unexpected LLVM IR type}}
%0 = llvm.cmpxchg %i1_ptr, %i1, %i1 monotonic monotonic : !llvm.i1
llvm.return
@@ -491,7 +481,7 @@ func @cmpxchg_unexpected_type(%i1_ptr : !llvm<"i1*">, %i1 : !llvm.i1) {
// -----
// 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>, %i32 : !llvm.i32) {
// expected-error at +1 {{ordering must be at least 'monotonic'}}
%0 = llvm.cmpxchg %i32_ptr, %i32, %i32 unordered monotonic : !llvm.i32
llvm.return
@@ -500,7 +490,7 @@ func @cmpxchg_at_least_monotonic_success(%i32_ptr : !llvm<"i32*">, %i32 : !llvm.
// -----
// 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>, %i32 : !llvm.i32) {
// expected-error at +1 {{ordering must be at least 'monotonic'}}
%0 = llvm.cmpxchg %i32_ptr, %i32, %i32 monotonic unordered : !llvm.i32
llvm.return
@@ -509,7 +499,7 @@ func @cmpxchg_at_least_monotonic_failure(%i32_ptr : !llvm<"i32*">, %i32 : !llvm.
// -----
// 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>, %i32 : !llvm.i32) {
// expected-error at +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 @@ func @cmpxchg_failure_release(%i32_ptr : !llvm<"i32*">, %i32 : !llvm.i32) {
// -----
// 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>, %i32 : !llvm.i32) {
// expected-error at +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 @@ func @cmpxchg_failure_acq_rel(%i32_ptr : !llvm<"i32*">, %i32 : !llvm.i32) {
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<ptr<i8>>) 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.func @bad_landingpad(%arg0: !llvm<"i8**">) attributes { personality = @__gx
llvm.return %1 : !llvm.i32
^bb2: // pred: ^bb0
// expected-error at +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<ptr<i8>>) : !llvm.struct<(ptr<i8>, i32)>
llvm.return %0 : !llvm.i32
}
@@ -548,15 +538,15 @@ llvm.func @__gxx_personality_v0(...) -> !llvm.i32
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<i8> : (!llvm.i32) -> !llvm.ptr<ptr<i8>>
// expected-note at +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<ptr<i8>> to !llvm.ptr<i8>
%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 at +1 {{constant clauses expected}}
- %5 = llvm.landingpad (catch %2 : !llvm<"i8*">) : !llvm<"{ i8*, i32 }">
+ %5 = llvm.landingpad (catch %2 : !llvm.ptr<i8>) : !llvm.struct<(ptr<i8>, i32)>
llvm.return %0 : !llvm.i32
}
@@ -572,7 +562,7 @@ llvm.func @caller(%arg0: !llvm.i32) -> !llvm.i32 attributes { personality = @__g
llvm.return %0 : !llvm.i32
^bb2: // pred: ^bb0
// expected-error at +1 {{landingpad instruction expects at least one clause or cleanup attribute}}
- %2 = llvm.landingpad : !llvm<"{ i8*, i32 }">
+ %2 = llvm.landingpad : !llvm.struct<(ptr<i8>, i32)>
llvm.return %0 : !llvm.i32
}
@@ -587,7 +577,7 @@ llvm.func @caller(%arg0: !llvm.i32) -> !llvm.i32 attributes { personality = @__g
^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<i8>, i32)>
// expected-error at +1 {{'llvm.resume' op expects landingpad value as operand}}
llvm.resume %0 : !llvm.i32
}
@@ -603,8 +593,8 @@ llvm.func @caller(%arg0: !llvm.i32) -> !llvm.i32 {
llvm.return %0 : !llvm.i32
^bb2: // pred: ^bb0
// expected-error at +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<i8>, i32)>
+ llvm.resume %2 : !llvm.struct<(ptr<i8>, i32)>
}
// -----
diff --git a/mlir/test/Dialect/LLVMIR/nvvm.mlir b/mlir/test/Dialect/LLVMIR/nvvm.mlir
index a55b35907db0..67d43f7146d5 100644
--- a/mlir/test/Dialect/LLVMIR/nvvm.mlir
+++ b/mlir/test/Dialect/LLVMIR/nvvm.mlir
@@ -46,12 +46,12 @@ func @nvvm_shfl(
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 @@ func @nvvm_vote(%arg0 : !llvm.i32, %arg1 : !llvm.i1) -> !llvm.i32 {
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
index 5fb28c45805c..3f640810c543 100644
--- a/mlir/test/Dialect/LLVMIR/rocdl.mlir
+++ b/mlir/test/Dialect/LLVMIR/rocdl.mlir
@@ -36,133 +36,133 @@ func @rocdl.barrier() {
}
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
index 1180561cf77b..ef89d76387d7 100644
--- 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<i8>, %[[I8PTR2:.*]]: !llvm.ptr<i8>, %[[BOOL:.*]]: !llvm.i1)
func @ops(%arg0: !llvm.i32, %arg1: !llvm.float,
- %arg2: !llvm<"i8*">, %arg3: !llvm<"i8*">,
+ %arg2: !llvm.ptr<i8>, %arg3: !llvm.ptr<i8>,
%arg4: !llvm.i1) {
// Integer arithmetic binary operations.
//
@@ -39,29 +39,29 @@ func @ops(%arg0: !llvm.i32, %arg1: !llvm.float,
// 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<double>
+// CHECK-NEXT: %[[GEP:.*]] = llvm.getelementptr %[[ALLOCA]][%[[I32]], %[[I32]]] : (!llvm.ptr<double>, !llvm.i32, !llvm.i32) -> !llvm.ptr<double>
+// CHECK-NEXT: %[[VALUE:.*]] = llvm.load %[[GEP]] : !llvm.ptr<double>
+// CHECK-NEXT: llvm.store %[[VALUE]], %[[ALLOCA]] : !llvm.ptr<double>
+// CHECK-NEXT: %{{.*}} = llvm.bitcast %[[ALLOCA]] : !llvm.ptr<double> to !llvm.ptr<i64>
+ %13 = llvm.alloca %arg0 x !llvm.double : (!llvm.i32) -> !llvm.ptr<double>
+ %14 = llvm.getelementptr %13[%arg0, %arg0] : (!llvm.ptr<double>, !llvm.i32, !llvm.i32) -> !llvm.ptr<double>
+ %15 = llvm.load %14 : !llvm.ptr<double>
+ llvm.store %15, %13 : !llvm.ptr<double>
+ %16 = llvm.bitcast %13 : !llvm.ptr<double> to !llvm.ptr<i64>
// 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<func<struct<(i32, double, i32)> (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<func<struct<(i32, double, i32)> (i32)>>
+ %21 = llvm.call %20(%arg0) : (!llvm.i32) -> !llvm.struct<(i32, double, i32)>
// Terminator operations and their successors.
@@ -76,9 +76,9 @@ func @ops(%arg0: !llvm.i32, %arg1: !llvm.float,
// 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 @@ func @ops(%arg0: !llvm.i32, %arg1: !llvm.float,
// 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<i32>
+// CHECK: %{{.*}} = llvm.ptrtoint %[[PTR]] : !llvm.ptr<i32> to !llvm.i32
+ %25 = llvm.inttoptr %arg0 : !llvm.i32 to !llvm.ptr<i32>
+ %26 = llvm.ptrtoint %25 : !llvm.ptr<i32> to !llvm.i32
// Extended and Quad floating point
//
@@ -114,24 +114,24 @@ func @ops(%arg0: !llvm.i32, %arg1: !llvm.float,
// 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<i8>, !llvm.ptr<i8>, !llvm.i32, !llvm.i1) -> ()
+ "llvm.intr.memcpy"(%arg2, %arg3, %arg0, %arg4) : (!llvm.ptr<i8>, !llvm.ptr<i8>, !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<i8>, !llvm.ptr<i8>, !llvm.i32, !llvm.i1) -> ()
+ "llvm.intr.memcpy"(%arg2, %arg3, %arg0, %arg4) : (!llvm.ptr<i8>, !llvm.ptr<i8>, !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<i8>, !llvm.ptr<i8>, !llvm.i64, !llvm.i1) -> ()
+ "llvm.intr.memcpy.inline"(%arg2, %arg3, %sz, %arg4) : (!llvm.ptr<i8>, !llvm.ptr<i8>, !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.func @foo(%arg0: !llvm.i32) -> !llvm<"{ i32, double, i32 }"> {
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<i32>)
+func @casts(%arg0: !llvm.i32, %arg1: !llvm.i64, %arg2: !llvm.vec<4 x i32>,
+ %arg3: !llvm.vec<4 x i64>, %arg4: !llvm.ptr<i32>) {
// 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 @@ func @casts(%arg0: !llvm.i32, %arg1: !llvm.i64, %arg2: !llvm<"<4 x i32>">,
%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<i32> to !llvm.ptr<i32, 2>
+ %10 = llvm.addrspacecast %arg4 : !llvm.ptr<i32> to !llvm.ptr<i32, 2>
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<i32>
+ llvm.alloca %size x !llvm.i32 {alignment = 0} : (!llvm.i64) -> (!llvm.ptr<i32>)
+ // CHECK: llvm.alloca %{{.*}} x !llvm.i32 {alignment = 8 : i64} : (!llvm.i64) -> !llvm.ptr<i32>
+ llvm.alloca %size x !llvm.i32 {alignment = 8} : (!llvm.i64) -> (!llvm.ptr<i32>)
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<i8>
+ %0 = llvm.mlir.null : !llvm.ptr<i8>
+ // CHECK: llvm.mlir.null : !llvm.ptr<struct<(ptr<func<void (i32, ptr<func<void ()>>)>>, i64)>>
+ %1 = llvm.mlir.null : !llvm.ptr<struct<(ptr<func<void (i32, ptr<func<void ()>>)>>, i64)>>
llvm.return
}
// CHECK-LABEL: @atomicrmw
-func @atomicrmw(%ptr : !llvm<"float*">, %val : !llvm.float) {
+func @atomicrmw(%ptr : !llvm.ptr<float>, %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<float>, %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<i8>
+llvm.func @bar(!llvm.ptr<i8>, !llvm.ptr<i8>, !llvm.ptr<i8>)
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<ptr<i8>>
+// CHECK: %[[a4:.*]] = llvm.mlir.null : !llvm.ptr<i8>
+// CHECK: %[[a5:.*]] = llvm.mlir.addressof @_ZTIi : !llvm.ptr<ptr<i8>>
+// CHECK: %[[a6:.*]] = llvm.bitcast %[[a5]] : !llvm.ptr<ptr<i8>> to !llvm.ptr<i8>
// 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<i8>
+// 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<ptr<i8>>
+ %4 = llvm.mlir.null : !llvm.ptr<i8>
+ %5 = llvm.mlir.addressof @_ZTIi : !llvm.ptr<ptr<i8>>
+ %6 = llvm.bitcast %5 : !llvm.ptr<ptr<i8>> to !llvm.ptr<i8>
%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<i8>
+ %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<ptr<i8>>) (catch %[[a6]] : !llvm.ptr<i8>) (filter %[[a2]] : !llvm.array<1 x i8>) : !llvm.struct<(ptr<i8>, i32)>
+// CHECK: llvm.resume %[[lp]] : !llvm.struct<(ptr<i8>, 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<ptr<i8>>) (catch %6 : !llvm.ptr<i8>) (filter %2 : !llvm.array<1 x i8>) : !llvm.struct<(ptr<i8>, i32)>
+ llvm.resume %10 : !llvm.struct<(ptr<i8>, i32)>
// CHECK: ^[[BB2]]:
// CHECK: llvm.return %[[a7]] : !llvm.i32
@@ -302,9 +302,9 @@ llvm.func @invokeLandingpad() -> !llvm.i32 attributes { personality = @__gxx_per
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<i8>, !llvm.ptr<i8>, !llvm.ptr<i8>) -> ()
^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<i8>, !llvm.ptr<i8>, !llvm.ptr<i8>) -> ()
// CHECK: ^[[BB4:.*]]:
// CHECK: llvm.return %[[a0]] : !llvm.i32
diff --git a/mlir/test/Dialect/LLVMIR/types.mlir b/mlir/test/Dialect/LLVMIR/types.mlir
index 7ce606fe8c6a..bd24c68b8883 100644
--- 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<void ()>
- "some.op"() : () -> !llvm2.func<void ()>
- // CHECK: !llvm2.func<void (i32)>
- "some.op"() : () -> !llvm2.func<void (i32)>
- // CHECK: !llvm2.func<i32 ()>
- "some.op"() : () -> !llvm2.func<i32 ()>
- // CHECK: !llvm2.func<i32 (half, bfloat, float, double)>
- "some.op"() : () -> !llvm2.func<i32 (half, bfloat, float, double)>
- // CHECK: !llvm2.func<i32 (i32, i32)>
- "some.op"() : () -> !llvm2.func<i32 (i32, i32)>
- // CHECK: !llvm2.func<void (...)>
- "some.op"() : () -> !llvm2.func<void (...)>
- // CHECK: !llvm2.func<void (i32, i32, ...)>
- "some.op"() : () -> !llvm2.func<void (i32, i32, ...)>
+ // CHECK: !llvm.func<void ()>
+ "some.op"() : () -> !llvm.func<void ()>
+ // CHECK: !llvm.func<void (i32)>
+ "some.op"() : () -> !llvm.func<void (i32)>
+ // CHECK: !llvm.func<i32 ()>
+ "some.op"() : () -> !llvm.func<i32 ()>
+ // CHECK: !llvm.func<i32 (half, bfloat, float, double)>
+ "some.op"() : () -> !llvm.func<i32 (half, bfloat, float, double)>
+ // CHECK: !llvm.func<i32 (i32, i32)>
+ "some.op"() : () -> !llvm.func<i32 (i32, i32)>
+ // CHECK: !llvm.func<void (...)>
+ "some.op"() : () -> !llvm.func<void (...)>
+ // CHECK: !llvm.func<void (i32, i32, ...)>
+ "some.op"() : () -> !llvm.func<void (i32, i32, ...)>
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<i8>
- "some.op"() : () -> !llvm2.ptr<i8>
- // CHECK: !llvm2.ptr<float>
- "some.op"() : () -> !llvm2.ptr<float>
- // CHECK: !llvm2.ptr<ptr<i8>>
- "some.op"() : () -> !llvm2.ptr<ptr<i8>>
- // CHECK: !llvm2.ptr<ptr<ptr<ptr<ptr<i8>>>>>
- "some.op"() : () -> !llvm2.ptr<ptr<ptr<ptr<ptr<i8>>>>>
- // CHECK: !llvm2.ptr<i8>
- "some.op"() : () -> !llvm2.ptr<i8, 0>
- // CHECK: !llvm2.ptr<i8, 1>
- "some.op"() : () -> !llvm2.ptr<i8, 1>
- // CHECK: !llvm2.ptr<i8, 42>
- "some.op"() : () -> !llvm2.ptr<i8, 42>
- // CHECK: !llvm2.ptr<ptr<i8, 42>, 9>
- "some.op"() : () -> !llvm2.ptr<ptr<i8, 42>, 9>
+ // CHECK: !llvm.ptr<i8>
+ "some.op"() : () -> !llvm.ptr<i8>
+ // CHECK: !llvm.ptr<float>
+ "some.op"() : () -> !llvm.ptr<float>
+ // CHECK: !llvm.ptr<ptr<i8>>
+ "some.op"() : () -> !llvm.ptr<ptr<i8>>
+ // CHECK: !llvm.ptr<ptr<ptr<ptr<ptr<i8>>>>>
+ "some.op"() : () -> !llvm.ptr<ptr<ptr<ptr<ptr<i8>>>>>
+ // CHECK: !llvm.ptr<i8>
+ "some.op"() : () -> !llvm.ptr<i8, 0>
+ // CHECK: !llvm.ptr<i8, 1>
+ "some.op"() : () -> !llvm.ptr<i8, 1>
+ // CHECK: !llvm.ptr<i8, 42>
+ "some.op"() : () -> !llvm.ptr<i8, 42>
+ // CHECK: !llvm.ptr<ptr<i8, 42>, 9>
+ "some.op"() : () -> !llvm.ptr<ptr<i8, 42>, 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<? x 4 x i32>
- "some.op"() : () -> !llvm2.vec<? x 4 x i32>
- // CHECK: !llvm2.vec<? x 8 x half>
- "some.op"() : () -> !llvm2.vec<? x 8 x half>
- // CHECK: !llvm2.vec<4 x ptr<i8>>
- "some.op"() : () -> !llvm2.vec<4 x ptr<i8>>
+ // 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<? x 4 x i32>
+ "some.op"() : () -> !llvm.vec<? x 4 x i32>
+ // CHECK: !llvm.vec<? x 8 x half>
+ "some.op"() : () -> !llvm.vec<? x 8 x half>
+ // CHECK: !llvm.vec<4 x ptr<i8>>
+ "some.op"() : () -> !llvm.vec<4 x ptr<i8>>
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<i32, 4>>
- "some.op"() : () -> !llvm2.array<10 x ptr<i32, 4>>
- // 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<i32, 4>>
+ "some.op"() : () -> !llvm.array<10 x ptr<i32, 4>>
+ // 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<packed ()>
- "some.op"() : () -> !llvm2.struct<packed ()>
- // CHECK: !llvm2.struct<packed (i32)>
- "some.op"() : () -> !llvm2.struct<packed (i32)>
- // CHECK: !llvm2.struct<packed (float, i32)>
- "some.op"() : () -> !llvm2.struct<packed (float, i32)>
- // CHECK: !llvm2.struct<packed (float, i32)>
- "some.op"() : () -> !llvm2.struct<packed (float, i32)>
- // CHECK: !llvm2.struct<packed (struct<(i32)>)>
- "some.op"() : () -> !llvm2.struct<packed (struct<(i32)>)>
- // CHECK: !llvm2.struct<packed (i32, struct<(i32, i1)>, float)>
- "some.op"() : () -> !llvm2.struct<packed (i32, struct<(i32, i1)>, float)>
+ // CHECK: !llvm.struct<packed ()>
+ "some.op"() : () -> !llvm.struct<packed ()>
+ // CHECK: !llvm.struct<packed (i32)>
+ "some.op"() : () -> !llvm.struct<packed (i32)>
+ // CHECK: !llvm.struct<packed (float, i32)>
+ "some.op"() : () -> !llvm.struct<packed (float, i32)>
+ // CHECK: !llvm.struct<packed (float, i32)>
+ "some.op"() : () -> !llvm.struct<packed (float, i32)>
+ // CHECK: !llvm.struct<packed (struct<(i32)>)>
+ "some.op"() : () -> !llvm.struct<packed (struct<(i32)>)>
+ // CHECK: !llvm.struct<packed (i32, struct<(i32, i1)>, float)>
+ "some.op"() : () -> !llvm.struct<packed (i32, struct<(i32, i1)>, float)>
- // CHECK: !llvm2.struct<(struct<packed (i32)>)>
- "some.op"() : () -> !llvm2.struct<(struct<packed (i32)>)>
- // CHECK: !llvm2.struct<packed (struct<(i32)>)>
- "some.op"() : () -> !llvm2.struct<packed (struct<(i32)>)>
+ // CHECK: !llvm.struct<(struct<packed (i32)>)>
+ "some.op"() : () -> !llvm.struct<(struct<packed (i32)>)>
+ // CHECK: !llvm.struct<packed (struct<(i32)>)>
+ "some.op"() : () -> !llvm.struct<packed (struct<(i32)>)>
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<func<void ()>>)>
- "some.op"() : () -> !llvm2.struct<"long", (i32, struct<(i32, i1)>, float, ptr<func<void ()>>)>
- // CHECK: !llvm2.struct<"self-recursive", (ptr<struct<"self-recursive">>)>
- "some.op"() : () -> !llvm2.struct<"self-recursive", (ptr<struct<"self-recursive">>)>
- // 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<func<void ()>>)>
+ "some.op"() : () -> !llvm.struct<"long", (i32, struct<(i32, i1)>, float, ptr<func<void ()>>)>
+ // CHECK: !llvm.struct<"self-recursive", (ptr<struct<"self-recursive">>)>
+ "some.op"() : () -> !llvm.struct<"self-recursive", (ptr<struct<"self-recursive">>)>
+ // 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<struct<"mutually-b", (ptr<struct<"mutually-a">, 3>)>>)>
- "some.op"() : () -> !llvm2.struct<"mutually-a", (ptr<struct<"mutually-b", (ptr<struct<"mutually-a">, 3>)>>)>
- // CHECK: !llvm2.struct<"mutually-b", (ptr<struct<"mutually-a", (ptr<struct<"mutually-b">>)>, 3>)>
- "some.op"() : () -> !llvm2.struct<"mutually-b", (ptr<struct<"mutually-a", (ptr<struct<"mutually-b">>)>, 3>)>
- // CHECK: !llvm2.struct<"referring-another", (ptr<struct<"unpacked", (i32)>>)>
- "some.op"() : () -> !llvm2.struct<"referring-another", (ptr<struct<"unpacked", (i32)>>)>
+ // CHECK: !llvm.struct<"mutually-a", (ptr<struct<"mutually-b", (ptr<struct<"mutually-a">, 3>)>>)>
+ "some.op"() : () -> !llvm.struct<"mutually-a", (ptr<struct<"mutually-b", (ptr<struct<"mutually-a">, 3>)>>)>
+ // CHECK: !llvm.struct<"mutually-b", (ptr<struct<"mutually-a", (ptr<struct<"mutually-b">>)>, 3>)>
+ "some.op"() : () -> !llvm.struct<"mutually-b", (ptr<struct<"mutually-a", (ptr<struct<"mutually-b">>)>, 3>)>
+ // CHECK: !llvm.struct<"referring-another", (ptr<struct<"unpacked", (i32)>>)>
+ "some.op"() : () -> !llvm.struct<"referring-another", (ptr<struct<"unpacked", (i32)>>)>
- // 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<struct<"ptr-to-struct", (i8)>>
- "some.op"() : () -> !llvm2.ptr<struct<"ptr-to-struct", (i8)>>
+ // 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<struct<"ptr-to-struct", (i8)>>
+ "some.op"() : () -> !llvm.ptr<struct<"ptr-to-struct", (i8)>>
return
}
diff --git a/mlir/test/Dialect/Linalg/llvm.mlir b/mlir/test/Dialect/Linalg/llvm.mlir
index 9b052fd2fab4..02693e5d1be4 100644
--- a/mlir/test/Dialect/Linalg/llvm.mlir
+++ b/mlir/test/Dialect/Linalg/llvm.mlir
@@ -9,10 +9,10 @@ func @range(%arg0: index) {
// 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<?xf32, offset: ?, strides: [1]>, %arg1: !linalg.range) {
%1 = linalg.slice %arg0[%arg1] : memref<?xf32, offset: ?, strides: [1]>, !linalg.range, memref<?xf32, offset: ?, strides: [1]>
@@ -20,20 +20,20 @@ func @slice(%arg0: memref<?xf32, offset: ?, strides: [1]>, %arg1: !linalg.range)
}
// 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<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+// CHECK-NEXT: llvm.extractvalue %{{.*}}[2] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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 @@ func @slice(%arg0: memref<?xf32, offset: ?, strides: [1]>, %arg1: !linalg.range)
// 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<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+// CHECK-NEXT: llvm.insertvalue %{{.*}}, %{{.*}}[4, 0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
func @slice_with_range_and_index(%arg0: memref<?x?xf64, offset: ?, strides: [?, 1]>) {
%c0 = constant 0 : index
@@ -58,32 +58,32 @@ func @slice_with_range_and_index(%arg0: memref<?x?xf64, offset: ?, strides: [?,
}
// 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<double>, ptr<double>, i64, array<1 x i64>, array<1 x i64>)>
+// CHECK: llvm.extractvalue %{{.*}}[4, 0] : !llvm.struct<(ptr<double>, ptr<double>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK: llvm.extractvalue %{{.*}}[4, 1] : !llvm.struct<(ptr<double>, ptr<double>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK: llvm.extractvalue %{{.*}}[2] : !llvm.struct<(ptr<double>, ptr<double>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm.struct<(ptr<double>, ptr<double>, i64, array<1 x i64>, array<1 x i64>)>
+// CHECK: llvm.insertvalue %{{.*}}[2] : !llvm.struct<(ptr<double>, ptr<double>, 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<double>, ptr<double>, i64, array<1 x i64>, array<1 x i64>)>
+// CHECK: llvm.insertvalue %{{.*}}[4, 0] : !llvm.struct<(ptr<double>, ptr<double>, i64, array<1 x i64>, array<1 x i64>)>
func @transpose(%arg0: memref<?x?x?xf32, offset: ?, strides: [?, ?, 1]>) {
%0 = linalg.transpose %arg0 (i, j, k) -> (k, i, j) : memref<?x?x?xf32, offset: ?, strides: [?, ?, 1]>
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<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK: llvm.insertvalue {{.*}}[0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK: llvm.insertvalue {{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK: llvm.insertvalue {{.*}}[2] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK: llvm.extractvalue {{.*}}[3, 0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK: llvm.insertvalue {{.*}}[3, 2] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK: llvm.extractvalue {{.*}}[3, 1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK: llvm.insertvalue {{.*}}[3, 0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK: llvm.extractvalue {{.*}}[3, 2] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK: llvm.insertvalue {{.*}}[3, 1] : !llvm.struct<(ptr<float>, ptr<float>, 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 @@ func @reshape_static_expand(%arg0: memref<3x4x5xf32>) -> memref<1x3x4x1x5xf32> {
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<float>, ptr<float>, i64, array<5 x i64>, array<5 x i64>)>
+// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<5 x i64>, array<5 x i64>)>
+// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<5 x i64>, array<5 x i64>)>
+// CHECK: llvm.extractvalue %{{.*}}[2] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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 @@ func @reshape_static_collapse(%arg0: memref<1x3x4x1x5xf32>) -> memref<3x4x5xf32>
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<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<5 x i64>, array<5 x i64>)>
+// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<5 x i64>, array<5 x i64>)>
+// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
+// CHECK: llvm.extractvalue %{{.*}}[2] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<5 x i64>, array<5 x i64>)>
+// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, i64, array<3 x i64>, array<3 x i64>)>
func @reshape_fold_zero_dim(%arg0 : memref<1x1xf32>) -> memref<f32> {
%0 = linalg.reshape %arg0 [] : memref<1x1xf32> into memref<f32>
return %0 : memref<f32>
}
// 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<float>, ptr<float>, i64)>
+// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm.struct<(ptr<float>, ptr<float>, i64)>
+// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, i64)>
+// CHECK: llvm.extractvalue %{{.*}}[2] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm.struct<(ptr<float>, ptr<float>, i64)>
func @reshape_expand_zero_dim(%arg0 : memref<f32>) -> memref<1x1xf32> {
%0 = linalg.reshape %arg0 [] : memref<f32> 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK: llvm.extractvalue %{{.*}}[0] : !llvm.struct<(ptr<float>, ptr<float>, i64)>
+// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK: llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, i64)>
+// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
+// CHECK: llvm.extractvalue %{{.*}}[2] : !llvm.struct<(ptr<float>, ptr<float>, i64)>
+// CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[2] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
diff --git a/mlir/test/Target/avx512.mlir b/mlir/test/Target/avx512.mlir
index 5e75a98dc4ef..0cc336d29df0 100644
--- 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
index 24b4a0b392b0..d67bbb029f8a 100644
--- 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<i32> {
+; CHECK-DAG: %[[addr:[0-9]+]] = llvm.mlir.addressof @g4 : !llvm.ptr<i32>
; 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<i32>, !llvm.i32) -> !llvm.ptr<i32>
+; CHECK-NEXT: llvm.return %[[gepinit]] : !llvm.ptr<i32>
; 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> <i32 1, i32 2>
-; 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> <i32 1, i32 2>, <2 x i32> <i32 3, i32 4>]]
;
@@ -84,13 +84,13 @@ declare float @fe(i32)
; 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<i64>
%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<double>
+; %[[addrof2:[0-9]+]] = llvm.mlir.addressof @g2 : !llvm.ptr<double>
+; %{{[0-9]+}} = llvm.inttoptr %arg0 : !llvm.i64 to !llvm.ptr<i64>
+; %{{[0-9]+}} = llvm.ptrtoint %[[addrof2]] : !llvm.ptr<double> to !llvm.i64
+; %{{[0-9]+}} = llvm.getelementptr %[[addrof]][%3] : (!llvm.ptr<double>, !llvm.i32) -> !llvm.ptr<double>
%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 @@ next:
br label %end
}
-; CHECK-LABEL: llvm.func @f3() -> !llvm<"i32*">
+; CHECK-LABEL: llvm.func @f3() -> !llvm.ptr<i32>
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<double>
+; CHECK: %[[b:[0-9]+]] = llvm.bitcast %[[c]] : !llvm.ptr<double> to !llvm.ptr<i32>
+; CHECK: llvm.return %[[b]] : !llvm.ptr<i32>
ret i32* bitcast (double* @g2 to i32*)
}
-; CHECK-LABEL: llvm.func @f4() -> !llvm<"i32*">
+; CHECK-LABEL: llvm.func @f4() -> !llvm.ptr<i32>
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<i32>
+; CHECK: llvm.return %[[b]] : !llvm.ptr<i32>
ret i32* bitcast (double* null to i32*)
}
@@ -198,7 +198,7 @@ define void @f5(i32 %d) {
ret void
}
-; CHECK-LABEL: llvm.func @f6(%arg0: !llvm<"void (i16)*">)
+; CHECK-LABEL: llvm.func @f6(%arg0: !llvm.ptr<func<void (i16)>>)
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 @@ define void @FPArithmetic(float %a, float %b, double %c, double %d) {
; 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<func<i32 ()>>
; CHECK: llvm.store %[[func]], %[[loc:.*]]
store i32 ()* @callee, i32 ()** %1
; CHECK: %[[indir:.*]] = llvm.load %[[loc]]
@@ -261,7 +261,7 @@ define i32 @callee() {
; 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<func<i32 ()>>
; CHECK: llvm.store %[[func]], %[[loc:.*]]
store i32 ()* @callee, i32 ()** %1
; CHECK: %[[indir:.*]] = llvm.load %[[loc]]
@@ -279,16 +279,16 @@ declare i32 @__gxx_personality_v0(...)
; 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<ptr<ptr<i8>>> to !llvm.ptr<i8>
+ ; CHECK: %[[a3:[0-9]+]] = llvm.alloca %{{[0-9]+}} x !llvm.i8 : (!llvm.i32) -> !llvm.ptr<i8>
%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<i8>) -> ()
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<ptr<i8>>) (catch %[[a1]] : !llvm.ptr<i8>) (filter %{{[0-9]+}} : !llvm.array<1 x i8>) : !llvm.struct<(ptr<i8>, 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 @@ define i32 @invokeLandingpad() personality i8* bitcast (i32 (...)* @__gxx_person
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<i8>) -> !llvm.ptr<i8>
%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
index 286d8fbe5f68..fc286599ee95 100644
--- a/mlir/test/Target/llvmir-intrinsics.mlir
+++ b/mlir/test/Target/llvmir-intrinsics.mlir
@@ -1,277 +1,277 @@
// 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<i8>) {
%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<i8>, !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
}
// CHECK-LABEL: @floor_test
-llvm.func @floor_test(%arg0: !llvm.float, %arg1: !llvm<"<8 x float>">) {
+llvm.func @floor_test(%arg0: !llvm.float, %arg1: !llvm.vec<8 x float>) {
// CHECK: call float @llvm.floor.f32
"llvm.intr.floor"(%arg0) : (!llvm.float) -> !llvm.float
// CHECK: call <8 x float> @llvm.floor.v8f32
- "llvm.intr.floor"(%arg1) : (!llvm<"<8 x float>">) -> !llvm<"<8 x float>">
+ "llvm.intr.floor"(%arg1) : (!llvm.vec<8 x float>) -> !llvm.vec<8 x float>
llvm.return
}
// 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
}
// CHECK-LABEL: @maxnum_test
-llvm.func @maxnum_test(%arg0: !llvm.float, %arg1: !llvm.float, %arg2: !llvm<"<8 x float>">, %arg3: !llvm<"<8 x float>">) {
+llvm.func @maxnum_test(%arg0: !llvm.float, %arg1: !llvm.float, %arg2: !llvm.vec<8 x float>, %arg3: !llvm.vec<8 x float>) {
// CHECK: call float @llvm.maxnum.f32
"llvm.intr.maxnum"(%arg0, %arg1) : (!llvm.float, !llvm.float) -> !llvm.float
// CHECK: call <8 x float> @llvm.maxnum.v8f32
- "llvm.intr.maxnum"(%arg2, %arg3) : (!llvm<"<8 x float>">, !llvm<"<8 x float>">) -> !llvm<"<8 x float>">
+ "llvm.intr.maxnum"(%arg2, %arg3) : (!llvm.vec<8 x float>, !llvm.vec<8 x float>) -> !llvm.vec<8 x float>
llvm.return
}
// CHECK-LABEL: @minnum_test
-llvm.func @minnum_test(%arg0: !llvm.float, %arg1: !llvm.float, %arg2: !llvm<"<8 x float>">, %arg3: !llvm<"<8 x float>">) {
+llvm.func @minnum_test(%arg0: !llvm.float, %arg1: !llvm.float, %arg2: !llvm.vec<8 x float>, %arg3: !llvm.vec<8 x float>) {
// CHECK: call float @llvm.minnum.f32
"llvm.intr.minnum"(%arg0, %arg1) : (!llvm.float, !llvm.float) -> !llvm.float
// CHECK: call <8 x float> @llvm.minnum.v8f32
- "llvm.intr.minnum"(%arg2, %arg3) : (!llvm<"<8 x float>">, !llvm<"<8 x float>">) -> !llvm<"<8 x float>">
+ "llvm.intr.minnum"(%arg2, %arg3) : (!llvm.vec<8 x float>, !llvm.vec<8 x float>) -> !llvm.vec<8 x float>
llvm.return
}
// CHECK-LABEL: @smax_test
-llvm.func @smax_test(%arg0: !llvm.i32, %arg1: !llvm.i32, %arg2: !llvm<"<8 x i32>">, %arg3: !llvm<"<8 x i32>">) {
+llvm.func @smax_test(%arg0: !llvm.i32, %arg1: !llvm.i32, %arg2: !llvm.vec<8 x i32>, %arg3: !llvm.vec<8 x i32>) {
// CHECK: call i32 @llvm.smax.i32
"llvm.intr.smax"(%arg0, %arg1) : (!llvm.i32, !llvm.i32) -> !llvm.i32
// CHECK: call <8 x i32> @llvm.smax.v8i32
- "llvm.intr.smax"(%arg2, %arg3) : (!llvm<"<8 x i32>">, !llvm<"<8 x i32>">) -> !llvm<"<8 x i32>">
+ "llvm.intr.smax"(%arg2, %arg3) : (!llvm.vec<8 x i32>, !llvm.vec<8 x i32>) -> !llvm.vec<8 x i32>
llvm.return
}
// CHECK-LABEL: @smin_test
-llvm.func @smin_test(%arg0: !llvm.i32, %arg1: !llvm.i32, %arg2: !llvm<"<8 x i32>">, %arg3: !llvm<"<8 x i32>">) {
+llvm.func @smin_test(%arg0: !llvm.i32, %arg1: !llvm.i32, %arg2: !llvm.vec<8 x i32>, %arg3: !llvm.vec<8 x i32>) {
// CHECK: call i32 @llvm.smin.i32
"llvm.intr.smin"(%arg0, %arg1) : (!llvm.i32, !llvm.i32) -> !llvm.i32
// CHECK: call <8 x i32> @llvm.smin.v8i32
- "llvm.intr.smin"(%arg2, %arg3) : (!llvm<"<8 x i32>">, !llvm<"<8 x i32>">) -> !llvm<"<8 x i32>">
+ "llvm.intr.smin"(%arg2, %arg3) : (!llvm.vec<8 x i32>, !llvm.vec<8 x i32>) -> !llvm.vec<8 x i32>
llvm.return
}
// 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<float>, %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, <stride=%stride>
{ 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<float> 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, <stride=%stride>
{ 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<float> 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<vec<7 x float>>, %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<vec<7 x float>>, !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<vec<7 x float>>, !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<vec<7 x float>>
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<float>>, %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<float>>, !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<float>>, !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<float>>
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<i8>, %arg3: !llvm.ptr<i8>) {
// 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<i8>, !llvm.ptr<i8>, !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<i8>, !llvm.ptr<i8>, !llvm.i64, !llvm.i1) -> ()
llvm.return
}
diff --git a/mlir/test/Target/llvmir-invalid.mlir b/mlir/test/Target/llvmir-invalid.mlir
index 5effcdc60d37..14117594e2f8 100644
--- a/mlir/test/Target/llvmir-invalid.mlir
+++ b/mlir/test/Target/llvmir-invalid.mlir
@@ -21,16 +21,16 @@ llvm.func @invalid_align(%arg0 : !llvm.float {llvm.align = 4}) -> !llvm.float {
// -----
-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
index d6180cbf1849..5e57f1c7c698 100644
--- a/mlir/test/Target/llvmir.mlir
+++ b/mlir/test/Target/llvmir.mlir
@@ -7,7 +7,7 @@ llvm.mlir.global internal @i32_global(42: i32) : !llvm.i32
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 @i32_global_addr_space(62: i32) {addr_space = 7 : i32}
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<i32> {
+ %addr = llvm.mlir.addressof @i32_global : !llvm.ptr<i32>
%_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<i32>, !llvm.i32) -> !llvm.ptr<i32>
+ llvm.return %gepinit : !llvm.ptr<i32>
}
//
@@ -66,7 +66,7 @@ llvm.mlir.global external @external() : !llvm.i32
//
// CHECK: declare i8* @malloc(i64)
-llvm.func @malloc(!llvm.i64) -> !llvm<"i8*">
+llvm.func @malloc(!llvm.i64) -> !llvm.ptr<i8>
// CHECK: declare void @free(i8*)
@@ -86,15 +86,15 @@ llvm.func @empty() {
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<i32>
+ %1 = llvm.load %0 : !llvm.ptr<i32>
// 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<array<6 x i8>>
%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<array<6 x i8>>, !llvm.i64, !llvm.i64) -> !llvm.ptr<i8>
+ %4 = llvm.load %3 : !llvm.ptr<i8>
llvm.return
}
@@ -414,12 +414,12 @@ llvm.func @memref_alloc() {
%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<float>)>
%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<i8>
+ %7 = llvm.bitcast %6 : !llvm.ptr<i8> to !llvm.ptr<float>
+ %8 = llvm.insertvalue %7, %3[0] : !llvm.struct<(ptr<float>)>
// CHECK-NEXT: ret void
llvm.return
}
@@ -434,12 +434,12 @@ llvm.func @store_load_static() {
// 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<float>)>
%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<i8>
+ %5 = llvm.bitcast %4 : !llvm.ptr<i8> to !llvm.ptr<float>
+ %6 = llvm.insertvalue %5, %1[0] : !llvm.struct<(ptr<float>)>
%7 = llvm.mlir.constant(1.000000e+00 : f32) : !llvm.float
llvm.br ^bb1
^bb1: // pred: ^bb0
@@ -457,9 +457,9 @@ llvm.func @store_load_static() {
// 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<float>)>
+ %14 = llvm.getelementptr %13[%10] : (!llvm.ptr<float>, !llvm.i64) -> !llvm.ptr<float>
+ llvm.store %7, %14 : !llvm.ptr<float>
%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 @@ llvm.func @store_load_static() {
// 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<float>)>
+ %23 = llvm.getelementptr %22[%19] : (!llvm.ptr<float>, !llvm.i64) -> !llvm.ptr<float>
+ %24 = llvm.load %23 : !llvm.ptr<float>
%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 @@ llvm.func @store_load_dynamic(%arg0: !llvm.i64) {
// 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<float>, 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<i8>
+ %4 = llvm.bitcast %3 : !llvm.ptr<i8> to !llvm.ptr<float>
+ %5 = llvm.insertvalue %4, %0[0] : !llvm.struct<(ptr<float>, i64)>
+ %6 = llvm.insertvalue %arg0, %5[1] : !llvm.struct<(ptr<float>, i64)>
%7 = llvm.mlir.constant(1.000000e+00 : f32) : !llvm.float
// CHECK-NEXT: br label %{{[0-9]+}}
llvm.br ^bb1
@@ -526,10 +526,10 @@ llvm.func @store_load_dynamic(%arg0: !llvm.i64) {
// 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<float>, i64)>
+ %12 = llvm.extractvalue %6[0] : !llvm.struct<(ptr<float>, i64)>
+ %13 = llvm.getelementptr %12[%9] : (!llvm.ptr<float>, !llvm.i64) -> !llvm.ptr<float>
+ llvm.store %7, %13 : !llvm.ptr<float>
%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 @@ llvm.func @store_load_dynamic(%arg0: !llvm.i64) {
// 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<float>, i64)>
+ %20 = llvm.extractvalue %6[0] : !llvm.struct<(ptr<float>, i64)>
+ %21 = llvm.getelementptr %20[%17] : (!llvm.ptr<float>, !llvm.i64) -> !llvm.ptr<float>
+ %22 = llvm.load %21 : !llvm.ptr<float>
%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 @@ llvm.func @store_load_mixed(%arg0: !llvm.i64) {
%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<float>, 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<i8>
+ %10 = llvm.bitcast %9 : !llvm.ptr<i8> to !llvm.ptr<float>
+ %11 = llvm.insertvalue %10, %6[0] : !llvm.struct<(ptr<float>, i64, i64)>
+ %12 = llvm.insertvalue %arg0, %11[1] : !llvm.struct<(ptr<float>, i64, i64)>
+ %13 = llvm.insertvalue %0, %12[2] : !llvm.struct<(ptr<float>, i64, i64)>
// CHECK-NEXT: %{{[0-9]+}} = call i64 @get_index()
// CHECK-NEXT: %{{[0-9]+}} = call i64 @get_index()
@@ -610,18 +610,18 @@ llvm.func @store_load_mixed(%arg0: !llvm.i64) {
// 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<float>, 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<float>, 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<float>, i64, i64)>
+ %30 = llvm.getelementptr %29[%28] : (!llvm.ptr<float>, !llvm.i64) -> !llvm.ptr<float>
+ llvm.store %18, %30 : !llvm.ptr<float>
// 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 @@ llvm.func @store_load_mixed(%arg0: !llvm.i64) {
// 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<float>, 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<float>, 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<float>, i64, i64)>
+ %42 = llvm.getelementptr %41[%40] : (!llvm.ptr<float>, !llvm.i64) -> !llvm.ptr<float>
+ %43 = llvm.load %42 : !llvm.ptr<float>
// 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<float>)>, %arg1: !llvm.struct<(ptr<float>, i64)>, %arg2: !llvm.struct<(ptr<float>, i64)>) -> !llvm.struct<(ptr<float>, 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 @@ llvm.func @memref_args_rets(%arg0: !llvm<"{ float* }">, %arg1: !llvm<"{ float*,
// 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<float>)>
+ %5 = llvm.getelementptr %4[%0] : (!llvm.ptr<float>, !llvm.i64) -> !llvm.ptr<float>
+ llvm.store %2, %5 : !llvm.ptr<float>
// 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<float>, i64)>
+ %7 = llvm.extractvalue %arg1[0] : !llvm.struct<(ptr<float>, i64)>
+ %8 = llvm.getelementptr %7[%0] : (!llvm.ptr<float>, !llvm.i64) -> !llvm.ptr<float>
+ llvm.store %2, %8 : !llvm.ptr<float>
// 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 @@ llvm.func @memref_args_rets(%arg0: !llvm<"{ float* }">, %arg1: !llvm<"{ float*,
// 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<float>, 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<float>, i64)>
+ %14 = llvm.getelementptr %13[%12] : (!llvm.ptr<float>, !llvm.i64) -> !llvm.ptr<float>
+ llvm.store %2, %14 : !llvm.ptr<float>
// 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 @@ llvm.func @memref_args_rets(%arg0: !llvm<"{ float* }">, %arg1: !llvm<"{ float*,
// 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<float>, 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<i8>
+ %21 = llvm.bitcast %20 : !llvm.ptr<i8> to !llvm.ptr<float>
+ %22 = llvm.insertvalue %21, %17[0] : !llvm.struct<(ptr<float>, i64)>
+ %23 = llvm.insertvalue %1, %22[1] : !llvm.struct<(ptr<float>, i64)>
// CHECK-NEXT: ret { float*, i64 } %{{[0-9]+}}
- llvm.return %23 : !llvm<"{ float*, i64 }">
+ llvm.return %23 : !llvm.struct<(ptr<float>, 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<float>, 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<float>, 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<float>, 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 @memref_dim(%arg0: !llvm<"{ float*, i64, i64 }">) -> !llvm.i64 {
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<float>, 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<float>, 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<float>, 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<float>, i64, i64)>)>
+ %4 = llvm.insertvalue %0, %3[0] : !llvm.struct<(i64, float, struct<(ptr<float>, i64, i64)>)>
+ %5 = llvm.insertvalue %1, %4[1] : !llvm.struct<(i64, float, struct<(ptr<float>, i64, i64)>)>
+ %6 = llvm.insertvalue %2, %5[2] : !llvm.struct<(i64, float, struct<(ptr<float>, i64, i64)>)>
+ llvm.return %6 : !llvm.struct<(i64, float, struct<(ptr<float>, i64, i64)>)>
}
@@ -753,10 +753,10 @@ llvm.func @multireturn_caller() {
// 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<float>, i64, i64)>)>
+ %1 = llvm.extractvalue %0[0] : !llvm.struct<(i64, float, struct<(ptr<float>, i64, i64)>)>
+ %2 = llvm.extractvalue %0[1] : !llvm.struct<(i64, float, struct<(ptr<float>, i64, i64)>)>
+ %3 = llvm.extractvalue %0[2] : !llvm.struct<(i64, float, struct<(ptr<float>, 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 @@ llvm.func @multireturn_caller() {
%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<float>, 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<float>, 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<float>, i64, i64)>
+ %20 = llvm.getelementptr %19[%18] : (!llvm.ptr<float>, !llvm.i64) -> !llvm.ptr<float>
+ %21 = llvm.load %20 : !llvm.ptr<float>
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, <float 4.200000e+01, float 4.200000e+01, float 4.200000e+01, float 4.200000e+01>
- %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, <float 4.200000e+01, float 4.200000e+01, float 4.200000e+01, float 4.200000e+01>
- %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, <float 4.200000e+01, float 4.200000e+01, float 4.200000e+01, float 4.200000e+01>
- %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> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>
- %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 @@ llvm.func @ops(%arg0: !llvm.float, %arg1: !llvm.float, %arg2: !llvm.i32, %arg3:
// 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 @@ llvm.func @ops(%arg0: !llvm.float, %arg1: !llvm.float, %arg2: !llvm.i32, %arg3:
// 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 @@ llvm.func @ops(%arg0: !llvm.float, %arg1: !llvm.float, %arg2: !llvm.i32, %arg3:
// 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<func<void (i64)>>
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<func<i32 (float)>>, %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 @@ llvm.func @cond_br_arguments(%arg0: !llvm.i1, %arg1: !llvm.i1) {
}
// 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<float> {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<float> {llvm.align = 4}) {
llvm.return
}
@@ -950,8 +950,8 @@ llvm.func @llvm_varargs(...)
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<i32>
+ %2 = llvm.ptrtoint %1 : !llvm.ptr<i32> to !llvm.i32
llvm.return %2 : !llvm.i32
}
@@ -968,16 +968,16 @@ llvm.func @fpconversion(%arg0 : !llvm.i32) -> !llvm.i32 {
}
// CHECK-LABEL: @addrspace
-llvm.func @addrspace(%arg0 : !llvm<"i32*">) -> !llvm<"i32 addrspace(2)*"> {
+llvm.func @addrspace(%arg0 : !llvm.ptr<i32>) -> !llvm.ptr<i32, 2> {
// 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<i32> to !llvm.ptr<i32, 2>
+ llvm.return %1 : !llvm.ptr<i32, 2>
}
-llvm.func @stringconstant() -> !llvm<"i8*"> {
- %1 = llvm.mlir.constant("Hello world!") : !llvm<"i8*">
+llvm.func @stringconstant() -> !llvm.ptr<i8> {
+ %1 = llvm.mlir.constant("Hello world!") : !llvm.ptr<i8>
// CHECK: ret [12 x i8] c"Hello world!"
- llvm.return %1 : !llvm<"i8*">
+ llvm.return %1 : !llvm.ptr<i8>
}
llvm.func @noreach() {
@@ -1019,22 +1019,22 @@ llvm.func @fcmp(%arg0: !llvm.float, %arg1: !llvm.float) {
}
// 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> <i32 0, i32 0, i32 0, i32 0, i32 7>
- %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 @@ llvm.func @alloca(%size : !llvm.i64) {
// 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<i32>)
// 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<i32>)
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> <float 4.2{{0*}}e+01, float 0.{{0*}}e+00, float 0.{{0*}}e+00, float 0.{{0*}}e+00>
- %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 @@ llvm.func @integer_extension_and_truncation(%a : !llvm.i32) {
// 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<i32> {
+ %0 = llvm.mlir.null : !llvm.ptr<i32>
// CHECK: ret i32* null
- llvm.return %0 : !llvm<"i32*">
+ llvm.return %0 : !llvm.ptr<i32>
}
// 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> <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]]]> : 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<float>, %f32 : !llvm.float,
+ %i32_ptr : !llvm.ptr<i32>, %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 @@ llvm.func @atomicrmw(
}
// CHECK-LABEL: @cmpxchg
-llvm.func @cmpxchg(%ptr : !llvm<"float*">, %cmp : !llvm.float, %val: !llvm.float) {
+llvm.func @cmpxchg(%ptr : !llvm.ptr<float>, %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<i8>
+llvm.func @foo(!llvm.ptr<i8>)
+llvm.func @bar(!llvm.ptr<i8>) -> !llvm.ptr<i8>
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<ptr<i8>>
+ %3 = llvm.bitcast %2 : !llvm.ptr<ptr<i8>> to !llvm.ptr<i8>
+ %4 = llvm.mlir.null : !llvm.ptr<ptr<i8>>
%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<i8>
// 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<i8>) -> ()
// CHECK: [[unwind]]:
^bb1:
@@ -1174,7 +1174,7 @@ llvm.func @invokeLandingpad() -> !llvm.i32 attributes { personality = @__gxx_per
// 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<ptr<i8>>) (catch %3 : !llvm.ptr<i8>) (filter %1 : !llvm.array<1 x i8>) : !llvm.struct<(ptr<i8>, i32)>
// CHECK: br label %[[final:[0-9]+]]
llvm.br ^bb3
@@ -1187,7 +1187,7 @@ llvm.func @invokeLandingpad() -> !llvm.i32 attributes { personality = @__gxx_per
// 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<i8>) -> !llvm.ptr<i8>
}
// CHECK-LABEL: @callFreezeOp
@@ -1235,9 +1235,9 @@ llvm.func @passthrough() attributes {passthrough = ["noinline", ["alignstack", "
// -----
// 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.func @address_taken() {
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<func<void ()>> {
+ %0 = llvm.mlir.addressof @address_taken : !llvm.ptr<func<void ()>>
+ llvm.return %0 : !llvm.ptr<func<void ()>>
}
// -----
@@ -1272,11 +1272,11 @@ llvm.func @cond_br_weights(%cond : !llvm.i1, %arg0 : !llvm.i32, %arg1 : !llvm.i
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<i32>)
// CHECK: store volatile i32 5, i32* %{{.*}}
- llvm.store volatile %val, %0 : !llvm<"i32*">
+ llvm.store volatile %val, %0 : !llvm.ptr<i32>
// CHECK: %{{.*}} = load volatile i32, i32* %{{.*}}
- %1 = llvm.load volatile %0: !llvm<"i32*">
+ %1 = llvm.load volatile %0: !llvm.ptr<i32>
llvm.return
}
@@ -1286,11 +1286,11 @@ llvm.func @volatile_store_and_load() {
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<i32>)
// CHECK: !nontemporal ![[NODE:[0-9]+]]
- llvm.store %val, %0 {nontemporal} : !llvm<"i32*">
+ llvm.store %val, %0 {nontemporal} : !llvm.ptr<i32>
// CHECK: !nontemporal ![[NODE]]
- %1 = llvm.load %0 {nontemporal} : !llvm<"i32*">
+ %1 = llvm.load %0 {nontemporal} : !llvm.ptr<i32>
llvm.return
}
diff --git a/mlir/test/Target/nvvmir.mlir b/mlir/test/Target/nvvmir.mlir
index 7e8cfb6c0a38..fdb438b4e6a9 100644
--- a/mlir/test/Target/nvvmir.mlir
+++ b/mlir/test/Target/nvvmir.mlir
@@ -50,12 +50,12 @@ llvm.func @nvvm_shfl(
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.func @nvvm_vote(%0 : !llvm.i32, %1 : !llvm.i1) -> !llvm.i32 {
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
index 127f65489351..949b1e74ae29 100644
--- a/mlir/test/Target/rocdl.mlir
+++ b/mlir/test/Target/rocdl.mlir
@@ -43,133 +43,133 @@ llvm.func @rocdl.barrier() {
}
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
index 8ac1ef0a8c17..873ed1616909 100644
--- a/mlir/test/lib/Dialect/LLVMIR/LLVMTypeTestDialect.cpp
+++ b/mlir/test/lib/Dialect/LLVMIR/LLVMTypeTestDialect.cpp
@@ -11,25 +11,25 @@ class LLVMDialectNewTypes : public Dialect {
public:
LLVMDialectNewTypes(MLIRContext *ctx) : Dialect(getDialectNamespace(), ctx) {
// clang-format off
- addTypes<LLVMVoidType,
- LLVMHalfType,
- LLVMBFloatType,
- LLVMFloatType,
- LLVMDoubleType,
- LLVMFP128Type,
- LLVMX86FP80Type,
- LLVMPPCFP128Type,
- LLVMX86MMXType,
- LLVMTokenType,
- LLVMLabelType,
- LLVMMetadataType,
- LLVMFunctionType,
- LLVMIntegerType,
- LLVMPointerType,
- LLVMFixedVectorType,
- LLVMScalableVectorType,
- LLVMArrayType,
- LLVMStructType>();
+ // addTypes<LLVMVoidType,
+ // LLVMHalfType,
+ // LLVMBFloatType,
+ // LLVMFloatType,
+ // LLVMDoubleType,
+ // LLVMFP128Type,
+ // LLVMX86FP80Type,
+ // LLVMPPCFP128Type,
+ // LLVMX86MMXType,
+ // LLVMTokenType,
+ // LLVMLabelType,
+ // LLVMMetadataType,
+ // LLVMFunctionType,
+ // LLVMIntegerType,
+ // LLVMPointerType,
+ // LLVMFixedVectorType,
+ // LLVMScalableVectorType,
+ // LLVMArrayType,
+ // LLVMStructType>();
// clang-format on
}
static StringRef getDialectNamespace() { return "llvm2"; }
@@ -38,7 +38,7 @@ class LLVMDialectNewTypes : public Dialect {
return detail::parseType(parser);
}
void printType(Type type, DialectAsmPrinter &printer) const override {
- detail::printType(type.cast<LLVMTypeNew>(), printer);
+ detail::printType(type.cast<LLVMType>(), printer);
}
};
} // namespace
diff --git a/mlir/test/lib/Target/TestLLVMTypeTranslation.cpp b/mlir/test/lib/Target/TestLLVMTypeTranslation.cpp
index b76ac2a13344..e51734308aa6 100644
--- a/mlir/test/lib/Target/TestLLVMTypeTranslation.cpp
+++ b/mlir/test/lib/Target/TestLLVMTypeTranslation.cpp
@@ -34,7 +34,7 @@ class TestLLVMTypeTranslation : public LLVM::ModuleTranslation {
if (op.getName().getStringRef() == "llvm.test_introduce_func") {
auto attr = op.getAttrOfType<TypeAttr>("type");
assert(attr && "expected 'type' attribute");
- auto type = attr.getValue().cast<LLVM::LLVMTypeNew>();
+ auto type = attr.getValue().cast<LLVM::LLVMType>();
auto nameAttr = op.getAttrOfType<StringAttr>("name");
assert(nameAttr && "expected 'name' attributes");
@@ -49,7 +49,7 @@ class TestLLVMTypeTranslation : public LLVM::ModuleTranslation {
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
index b48b523165bd..5f5ff6f1fbb9 100644
--- 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 @@ func @simple_add1_add2_test(%arg0: memref<2xf32>, %arg1: memref<2xf32>) {
}
// External declarations.
-llvm.func @malloc(!llvm.i64) -> !llvm<"i8*">
-llvm.func @free(!llvm<"i8*">)
+llvm.func @malloc(!llvm.i64) -> !llvm.ptr<i8>
+llvm.func @free(!llvm.ptr<i8>)
func @print_f32(%arg0: f32)
func @print_comma()
func @print_newline()
@@ -79,105 +79,105 @@ llvm.func @main() {
%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<float>
%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<float>, !llvm.i64) -> !llvm.ptr<float>
+ %9 = llvm.ptrtoint %8 : !llvm.ptr<float> 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<i8>
+ %12 = llvm.bitcast %11 : !llvm.ptr<i8> to !llvm.ptr<float>
+ %13 = llvm.mlir.undef : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %14 = llvm.insertvalue %12, %13[0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %15 = llvm.insertvalue %12, %14[1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %20 = llvm.insertvalue %18, %19[4, 0] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>
%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<float>, !llvm.i64) -> !llvm.ptr<float>
+ %25 = llvm.ptrtoint %24 : !llvm.ptr<float> 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<i8>
+ %28 = llvm.bitcast %27 : !llvm.ptr<i8> to !llvm.ptr<float>
+ %29 = llvm.mlir.undef : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %30 = llvm.insertvalue %28, %29[0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %31 = llvm.insertvalue %28, %30[1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %36 = llvm.insertvalue %34, %35[4, 0] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, 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<float>, !llvm.i64) -> !llvm.ptr<float>
+ llvm.store %3, %44 : !llvm.ptr<float>
+ %45 = llvm.extractvalue %36[1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, !llvm.i64) -> !llvm.ptr<float>
+ llvm.store %3, %50 : !llvm.ptr<float>
%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<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %55 = llvm.extractvalue %36[1] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ llvm.call @simple_add1_add2_test(%54, %55) : (!llvm.ptr<float>, !llvm.ptr<float>) -> ()
+ %56 = llvm.extractvalue %20[1] : !llvm.struct<(ptr<float>, ptr<float>, 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<float>, !llvm.i64) -> !llvm.ptr<float>
+ %62 = llvm.load %61 : !llvm.ptr<float>
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<float>, ptr<float>, 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<float>, !llvm.i64) -> !llvm.ptr<float>
+ %69 = llvm.load %68 : !llvm.ptr<float>
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<float>, ptr<float>, 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<float>, !llvm.i64) -> !llvm.ptr<float>
+ %76 = llvm.load %75 : !llvm.ptr<float>
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<float>, ptr<float>, 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<float>, !llvm.i64) -> !llvm.ptr<float>
+ %83 = llvm.load %82 : !llvm.ptr<float>
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<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %85 = llvm.bitcast %84 : !llvm.ptr<float> to !llvm.ptr<i8>
+ llvm.call @free(%85) : (!llvm.ptr<i8>) -> ()
+ %86 = llvm.extractvalue %36[0] : !llvm.struct<(ptr<float>, ptr<float>, i64, array<1 x i64>, array<1 x i64>)>
+ %87 = llvm.bitcast %86 : !llvm.ptr<float> to !llvm.ptr<i8>
+ llvm.call @free(%87) : (!llvm.ptr<i8>) -> ()
llvm.return
}
diff --git a/mlir/test/mlir-cpu-runner/simple.mlir b/mlir/test/mlir-cpu-runner/simple.mlir
index a1b6cf62dab6..e75d98aa8bd3 100644
--- 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<i8>
+llvm.func @free(!llvm.ptr<i8>)
// Check that a simple function with a nested call works.
llvm.func @main() -> !llvm.float {
@@ -27,29 +27,29 @@ llvm.func @main() -> !llvm.float {
// CHECK: 4.200000e+02
// Helper typed functions wrapping calls to "malloc" and "free".
-llvm.func @allocation() -> !llvm<"float*"> {
+llvm.func @allocation() -> !llvm.ptr<float> {
%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<i8>
+ %2 = llvm.bitcast %1 : !llvm.ptr<i8> to !llvm.ptr<float>
+ llvm.return %2 : !llvm.ptr<float>
}
-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<float>) {
+ %0 = llvm.bitcast %arg0 : !llvm.ptr<float> to !llvm.ptr<i8>
+ llvm.call @free(%0) : (!llvm.ptr<i8>) -> ()
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<float>
%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<float>, !llvm.i64) -> !llvm.ptr<float>
+ llvm.store %2, %3 : !llvm.ptr<float>
+ %4 = llvm.getelementptr %0[%1] : (!llvm.ptr<float>, !llvm.i64) -> !llvm.ptr<float>
+ %5 = llvm.load %4 : !llvm.ptr<float>
+ llvm.call @deallocation(%0) : (!llvm.ptr<float>) -> ()
llvm.return %5 : !llvm.float
}
// NOMAIN: 1.234000e+03
More information about the Mlir-commits
mailing list