Integrate llvm-project at c84b8be516bcc4d021ff804169d58a7b3104e050 (#8119)
* Reset third_party/llvm-project: c84b8be516bcc4d021ff804169d58a7b3104e050 (2022-01-15 19:52:30 +0000): [AArch64] clang support for Armv8.8/9.3 MOPS
* Replace Identifer -> StringAttr.
* Pin third_party/mlir-hlo to patched-mlir-hlo-20220118
* Update submodule url to https://github.com/google/iree-llvm-fork.git
* Add pinned state
* Integrates ShapedType::isDynamic() -> isDynamicDim() rename.
* Rename FuncOpTypeConversionPattern -> FunctionLikeTypeConversionPattern<T>
* Adapt tests for vector.extract_strided_slice -> vector.extract.
* Make buildkit do a submodule sync before update.
* Bump to remove mhlo_mark_shape_calc.cc
diff --git a/.gitmodules b/.gitmodules
index 7b053e2..771ef9d 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -37,7 +37,7 @@
url = https://github.com/axboe/liburing.git
[submodule "third_party/mlir-hlo"]
path = third_party/mlir-hlo
- url = https://github.com/tensorflow/mlir-hlo.git
+ url = https://github.com/google/iree-llvm-fork.git
[submodule "third_party/stblib"]
path = third_party/stblib
url = https://github.com/nothings/stb
diff --git a/build_tools/buildkite/cmake/android/arm64-v8a/pipeline.yml b/build_tools/buildkite/cmake/android/arm64-v8a/pipeline.yml
index 73a6973..211d4f3 100644
--- a/build_tools/buildkite/cmake/android/arm64-v8a/pipeline.yml
+++ b/build_tools/buildkite/cmake/android/arm64-v8a/pipeline.yml
@@ -7,7 +7,7 @@
steps:
- label: "build"
commands:
- - "git submodule update --init --jobs 8 --depth 1"
+ - "git submodule sync && git submodule update --init --jobs 8 --depth 1"
- "docker run --user=$(id -u):$(id -g) --volume=\\$PWD:\\$IREE_DOCKER_WORKDIR --workdir=\\$IREE_DOCKER_WORKDIR --rm gcr.io/iree-oss/android@sha256:ffb02ab2a7c5ee7bb1bcae9fb08d0de70cdb3c42466a4951e48d9142cc9b8ca2 build_tools/cmake/build_android.sh arm64-v8a"
- "tar --exclude='*.o' --exclude='*.a' -czvf build-artifacts.tgz build-android"
agents:
diff --git a/build_tools/buildkite/cmake/build_configurations.yml b/build_tools/buildkite/cmake/build_configurations.yml
index 947bdfe..1e24b23 100644
--- a/build_tools/buildkite/cmake/build_configurations.yml
+++ b/build_tools/buildkite/cmake/build_configurations.yml
@@ -7,7 +7,7 @@
steps:
- label: ":zap: Build with tracing enabled"
commands:
- - "git submodule update --init --jobs 8 --depth 1"
+ - "git submodule sync && git submodule update --init --jobs 8 --depth 1"
- "docker run --user=$(id -u):$(id -g) --volume=\\$PWD:\\$IREE_DOCKER_WORKDIR --workdir=\\$IREE_DOCKER_WORKDIR --rm gcr.io/iree-oss/base@sha256:61f948eb15c90596b9faabbca168de2c7d5008e5d2c0b9c5c26a0efe572198d6 ./build_tools/cmake/build_tracing.sh"
env:
IREE_DOCKER_WORKDIR: "/usr/src/github/iree"
@@ -16,7 +16,7 @@
- label: ":hammer_and_wrench: Build the runtime only"
commands:
- - "git submodule update --init --jobs 8 --depth 1"
+ - "git submodule sync && git submodule update --init --jobs 8 --depth 1"
- "docker run --user=$(id -u):$(id -g) --volume=\\$PWD:\\$IREE_DOCKER_WORKDIR --workdir=\\$IREE_DOCKER_WORKDIR --rm gcr.io/iree-oss/base@sha256:61f948eb15c90596b9faabbca168de2c7d5008e5d2c0b9c5c26a0efe572198d6 ./build_tools/cmake/build_runtime.sh"
env:
IREE_DOCKER_WORKDIR: "/usr/src/github/iree"
@@ -25,7 +25,7 @@
- label: ":pinching_hand: Build the size-optimized runtime only"
commands:
- - "git submodule update --init --jobs 8 --depth 1"
+ - "git submodule sync && git submodule update --init --jobs 8 --depth 1"
- "docker run --user=$(id -u):$(id -g) --volume=\\$PWD:\\$IREE_DOCKER_WORKDIR --workdir=\\$IREE_DOCKER_WORKDIR --rm gcr.io/iree-oss/base@sha256:61f948eb15c90596b9faabbca168de2c7d5008e5d2c0b9c5c26a0efe572198d6 ./build_tools/cmake/build_runtime_small.sh"
env:
IREE_DOCKER_WORKDIR: "/usr/src/github/iree"
@@ -35,7 +35,7 @@
- label: ":gnu: Build with GCC"
key: "build-gcc"
commands:
- - "git submodule update --init --jobs 8 --depth 1"
+ - "git submodule sync && git submodule update --init --jobs 8 --depth 1"
- "docker run --env CC=/usr/bin/gcc-9 --env CXX=/usr/bin/g++-9 --user=$(id -u):$(id -g) --volume=\\$PWD:\\$IREE_DOCKER_WORKDIR --workdir=\\$IREE_DOCKER_WORKDIR --rm gcr.io/iree-oss/base@sha256:61f948eb15c90596b9faabbca168de2c7d5008e5d2c0b9c5c26a0efe572198d6 ./build_tools/cmake/clean_build.sh"
env:
IREE_DOCKER_WORKDIR: "/usr/src/github/iree"
@@ -45,7 +45,7 @@
- label: ":linux: Build host install"
key: "build-host-install"
commands:
- - "git submodule update --init --jobs 8 --depth 1"
+ - "git submodule sync && git submodule update --init --jobs 8 --depth 1"
- "docker run --user=$(id -u):$(id -g) --volume=\\$PWD:\\$IREE_DOCKER_WORKDIR --workdir=\\$IREE_DOCKER_WORKDIR --rm gcr.io/iree-oss/base@sha256:61f948eb15c90596b9faabbca168de2c7d5008e5d2c0b9c5c26a0efe572198d6 ./build_tools/cmake/build_host_install.sh"
- "tar -czvf build-artifacts.tgz build-host/install"
artifact_paths: "build-artifacts.tgz"
diff --git a/iree/compiler/Bindings/TFLite/Transforms/WrapEntryPoints.cpp b/iree/compiler/Bindings/TFLite/Transforms/WrapEntryPoints.cpp
index a74fa5c..e73966e 100644
--- a/iree/compiler/Bindings/TFLite/Transforms/WrapEntryPoints.cpp
+++ b/iree/compiler/Bindings/TFLite/Transforms/WrapEntryPoints.cpp
@@ -641,7 +641,7 @@
}
}
return NamedAttribute{
- Identifier::get("tfl.io.names", &getContext()),
+ StringAttr::get(&getContext(), "tfl.io.names"),
StringAttr::get(&getContext(), llvm::join(pieces, ";"))};
}
};
diff --git a/iree/compiler/Codegen/Common/DemoteF32ToF16.cpp b/iree/compiler/Codegen/Common/DemoteF32ToF16.cpp
index c96e44d..143daf8 100644
--- a/iree/compiler/Codegen/Common/DemoteF32ToF16.cpp
+++ b/iree/compiler/Codegen/Common/DemoteF32ToF16.cpp
@@ -133,7 +133,7 @@
FloatTypeConverter converter;
OwningRewritePatternList patterns(&getContext());
patterns.insert<GenericTypeConvert>(context, converter);
- populateFuncOpTypeConversionPattern(patterns, converter);
+ populateFunctionLikeTypeConversionPattern<FuncOp>(patterns, converter);
ConversionTarget target(*context);
// Operations are legal if they don't contain any illegal type.
target.markUnknownOpDynamicallyLegal([](Operation *op) {
diff --git a/iree/compiler/Codegen/LLVMCPU/LLVMCPUTileAndVectorizeLinalgTensorOps.cpp b/iree/compiler/Codegen/LLVMCPU/LLVMCPUTileAndVectorizeLinalgTensorOps.cpp
index 73804b9..5e5aa11 100644
--- a/iree/compiler/Codegen/LLVMCPU/LLVMCPUTileAndVectorizeLinalgTensorOps.cpp
+++ b/iree/compiler/Codegen/LLVMCPU/LLVMCPUTileAndVectorizeLinalgTensorOps.cpp
@@ -85,8 +85,8 @@
static_cast<unsigned>(TilingLevel::L1Tiles));
}),
linalg::LinalgTransformationFilter(
- ArrayRef<Identifier>{},
- Identifier::get(getWorkgroupL1TileMarker(), context)));
+ ArrayRef<StringAttr>{},
+ StringAttr::get(context, getWorkgroupL1TileMarker())));
if (failed(applyPatternsAndFoldGreedily(funcOp, std::move(l1patterns)))) {
return signalPassFailure();
@@ -130,8 +130,8 @@
builder, op, static_cast<unsigned>(TilingLevel::VectorTiles));
}),
linalg::LinalgTransformationFilter(
- Identifier::get(getWorkgroupL1TileMarker(), context),
- Identifier::get(getVectorizeMarker(), context)));
+ StringAttr::get(context, getWorkgroupL1TileMarker()),
+ StringAttr::get(context, getVectorizeMarker())));
if (failed(applyPatternsAndFoldGreedily(funcOp, std::move(l2patterns)))) {
return signalPassFailure();
@@ -183,7 +183,7 @@
OwningRewritePatternList vectorizationPatterns(&getContext());
linalg::LinalgVectorizationOptions opt;
linalg::LinalgTransformationFilter f(
- Identifier::get(getVectorizeMarker(), context));
+ StringAttr::get(context, getVectorizeMarker()));
linalg::VectorizationPatterns<linalg::CopyOp, linalg::FillOp>::insert(
vectorizationPatterns, opt, f);
vectorizationPatterns.add<linalg::LinalgVectorizationPattern>(
diff --git a/iree/compiler/Codegen/LLVMCPU/LLVMCPUTileFuseAndVectorizeLinalgTensorOps.cpp b/iree/compiler/Codegen/LLVMCPU/LLVMCPUTileFuseAndVectorizeLinalgTensorOps.cpp
index bd3db13..35c989d 100644
--- a/iree/compiler/Codegen/LLVMCPU/LLVMCPUTileFuseAndVectorizeLinalgTensorOps.cpp
+++ b/iree/compiler/Codegen/LLVMCPU/LLVMCPUTileFuseAndVectorizeLinalgTensorOps.cpp
@@ -189,8 +189,8 @@
return std::move(reductionTiles);
}),
linalg::LinalgTransformationFilter(
- ArrayRef<Identifier>{},
- Identifier::get(getVectorizeMarker(), context)));
+ ArrayRef<StringAttr>{},
+ StringAttr::get(context, getVectorizeMarker())));
if (failed(applyPatternsAndFoldGreedily(
funcOp, std::move(tileReductionPatterns)))) {
@@ -231,8 +231,8 @@
static_cast<unsigned>(TilingLevel::VectorTiles));
}),
linalg::LinalgTransformationFilter(
- Identifier::get(getWorkgroupL1TileMarker(), context),
- Identifier::get(getVectorizeMarker(), context)));
+ StringAttr::get(context, getWorkgroupL1TileMarker()),
+ StringAttr::get(context, getVectorizeMarker())));
if (failed(applyPatternsAndFoldGreedily(funcOp, std::move(l2patterns)))) {
return signalPassFailure();
@@ -259,7 +259,7 @@
OwningRewritePatternList vectorizationPatterns(&getContext());
linalg::LinalgVectorizationOptions opt;
linalg::LinalgTransformationFilter f(
- Identifier::get(getVectorizeMarker(), context));
+ StringAttr::get(context, getVectorizeMarker()));
linalg::VectorizationPatterns<linalg::GenericOp, linalg::CopyOp,
linalg::FillOp>::insert(vectorizationPatterns,
opt, f);
diff --git a/iree/compiler/Codegen/LLVMGPU/LLVMGPUDistributeSharedMemoryCopy.cpp b/iree/compiler/Codegen/LLVMGPU/LLVMGPUDistributeSharedMemoryCopy.cpp
index 1bfc229..2b6bf47 100644
--- a/iree/compiler/Codegen/LLVMGPU/LLVMGPUDistributeSharedMemoryCopy.cpp
+++ b/iree/compiler/Codegen/LLVMGPU/LLVMGPUDistributeSharedMemoryCopy.cpp
@@ -72,16 +72,16 @@
patterns.insert<linalg::LinalgTilingPattern>(
linalg::CopyOp::getOperationName(), patterns.getContext(), tilingOptions,
linalg::LinalgTransformationFilter(
- {Identifier::get(getCopyToWorkgroupMemoryMarker(),
- patterns.getContext())},
- Identifier::get(getVectorizeMarker(), patterns.getContext())));
+ {StringAttr::get(patterns.getContext(),
+ getCopyToWorkgroupMemoryMarker())},
+ StringAttr::get(patterns.getContext(), getVectorizeMarker())));
}
static void populateVectorizationPatterns(RewritePatternSet &patterns) {
linalg::VectorizationPatterns<linalg::CopyOp>::insert(
patterns, linalg::LinalgVectorizationOptions(),
- linalg::LinalgTransformationFilter(Identifier::get(
- getCopyToWorkgroupMemoryMarker(), patterns.getContext())));
+ linalg::LinalgTransformationFilter(StringAttr::get(
+ patterns.getContext(), getCopyToWorkgroupMemoryMarker())));
}
// TODO(thomasraoux): Extend this to support smaller vector size as well.
diff --git a/iree/compiler/Codegen/LLVMGPU/LLVMGPUTensorCoreVectorization.cpp b/iree/compiler/Codegen/LLVMGPU/LLVMGPUTensorCoreVectorization.cpp
index c7c57f0..2aec72d 100644
--- a/iree/compiler/Codegen/LLVMGPU/LLVMGPUTensorCoreVectorization.cpp
+++ b/iree/compiler/Codegen/LLVMGPU/LLVMGPUTensorCoreVectorization.cpp
@@ -24,7 +24,7 @@
static void populateVectorizationPatterns(RewritePatternSet &patterns) {
linalg::LinalgVectorizationOptions opt;
linalg::LinalgTransformationFilter f(
- Identifier::get(getVectorizeMarker(), patterns.getContext()));
+ StringAttr::get(patterns.getContext(), getVectorizeMarker()));
linalg::VectorizationPatterns<linalg::FillOp, linalg::CopyOp,
linalg::GenericOp>::insert(patterns, opt, f);
patterns.add<linalg::LinalgVectorizationPattern>(
diff --git a/iree/compiler/Codegen/LLVMGPU/LLVMGPUTileAndDistribute.cpp b/iree/compiler/Codegen/LLVMGPU/LLVMGPUTileAndDistribute.cpp
index f526c62..051447c 100644
--- a/iree/compiler/Codegen/LLVMGPU/LLVMGPUTileAndDistribute.cpp
+++ b/iree/compiler/Codegen/LLVMGPU/LLVMGPUTileAndDistribute.cpp
@@ -53,8 +53,8 @@
MLIRContext *context = patterns.getContext();
linalg::LinalgTransformationFilter filter(
- ArrayRef<Identifier>{},
- Identifier::get(getWorkgroupKTiledMarker(), context));
+ ArrayRef<StringAttr>{},
+ StringAttr::get(context, getWorkgroupKTiledMarker()));
linalg::TilingPatterns<linalg::MatmulOp, linalg::BatchMatmulOp,
linalg::GenericOp>::insert(patterns, tilingOptions,
filter);
@@ -109,9 +109,9 @@
.setDistributionOptions(warpDistributionOptions);
MLIRContext *context = patterns.getContext();
linalg::LinalgTransformationFilter filter(
- {Identifier::get(getWorkgroupKTiledMarker(), context),
- Identifier::get(getWorkgroupMemoryMarker(), context)},
- Identifier::get(getVectorizeMarker(), context));
+ {StringAttr::get(context, getWorkgroupKTiledMarker()),
+ StringAttr::get(context, getWorkgroupMemoryMarker())},
+ StringAttr::get(context, getVectorizeMarker()));
filter.setMatchByDefault();
linalg::TilingPatterns<linalg::MatmulOp, linalg::FillOp, linalg::CopyOp,
linalg::BatchMatmulOp,
@@ -167,9 +167,9 @@
MLIRContext *context = patterns.getContext();
linalg::LinalgTransformationFilter f(
- {Identifier::get(getWorkgroupKTiledMarker(), context),
- Identifier::get(getWorkgroupMemoryMarker(), context)},
- Identifier::get(getVectorizeMarker(), context));
+ {StringAttr::get(context, getWorkgroupKTiledMarker()),
+ StringAttr::get(context, getWorkgroupMemoryMarker())},
+ StringAttr::get(context, getVectorizeMarker()));
f.addFilter([](Operation *op) {
// FFT doesn't support second level of tiling yet.
return success(!isa<IREE::LinalgExt::FftOp>(op));
@@ -249,8 +249,8 @@
.setOperandsToPromote({0, 1})
.setUseFullTileBuffers({false, false}),
linalg::LinalgTransformationFilter(
- {Identifier::get(getWorkgroupKTiledMarker(), context)},
- Identifier::get(getWorkgroupMemoryMarker(), context)));
+ {StringAttr::get(context, getWorkgroupKTiledMarker())},
+ StringAttr::get(context, getWorkgroupMemoryMarker())));
}
namespace {
diff --git a/iree/compiler/Codegen/LLVMGPU/LLVMGPUVectorization.cpp b/iree/compiler/Codegen/LLVMGPU/LLVMGPUVectorization.cpp
index ddbeb14..9900f17 100644
--- a/iree/compiler/Codegen/LLVMGPU/LLVMGPUVectorization.cpp
+++ b/iree/compiler/Codegen/LLVMGPU/LLVMGPUVectorization.cpp
@@ -30,7 +30,7 @@
MLIRContext *ctx = patterns.getContext();
linalg::LinalgVectorizationOptions opt;
linalg::LinalgTransformationFilter f(
- Identifier::get(getVectorizeMarker(), ctx));
+ StringAttr::get(ctx, getVectorizeMarker()));
linalg::VectorizationPatterns<linalg::FillOp, linalg::CopyOp,
linalg::GenericOp>::insert(patterns, opt, f);
patterns.add<linalg::LinalgVectorizationPattern>(
diff --git a/iree/compiler/Codegen/SPIRV/SPIRVCopyToWorkgroupMemory.cpp b/iree/compiler/Codegen/SPIRV/SPIRVCopyToWorkgroupMemory.cpp
index 142193b..427b148 100644
--- a/iree/compiler/Codegen/SPIRV/SPIRVCopyToWorkgroupMemory.cpp
+++ b/iree/compiler/Codegen/SPIRV/SPIRVCopyToWorkgroupMemory.cpp
@@ -300,7 +300,7 @@
linalg::VectorizationPatterns<linalg::CopyOp>::insert(
vectorizationPatterns, linalg::LinalgVectorizationOptions(),
linalg::LinalgTransformationFilter(
- Identifier::get(getVectorizeMarker(), context), {}));
+ StringAttr::get(context, getVectorizeMarker()), {}));
if (failed(applyPatternsAndFoldGreedily(funcOp,
std::move(vectorizationPatterns)))) {
return signalPassFailure();
diff --git a/iree/compiler/Codegen/SPIRV/SPIRVTile.cpp b/iree/compiler/Codegen/SPIRV/SPIRVTile.cpp
index 356862e..c53ad55 100644
--- a/iree/compiler/Codegen/SPIRV/SPIRVTile.cpp
+++ b/iree/compiler/Codegen/SPIRV/SPIRVTile.cpp
@@ -40,7 +40,7 @@
auto tilingOptions = linalg::LinalgTilingOptions()
.setLoopType(linalg::LinalgTilingLoopType::Loops)
.setTileSizeComputationFunction(getTileSizeFn);
- auto marker = Identifier::get(getTileReductionMarker(), context);
+ auto marker = StringAttr::get(context, getTileReductionMarker());
auto filter = linalg::LinalgTransformationFilter({marker}, llvm::None);
linalg::TilingPatterns<linalg::BatchMatmulOp, linalg::Conv2DNhwcHwcfOp,
diff --git a/iree/compiler/Codegen/SPIRV/SPIRVTileAndDistribute.cpp b/iree/compiler/Codegen/SPIRV/SPIRVTileAndDistribute.cpp
index acb853c..1e39e89 100644
--- a/iree/compiler/Codegen/SPIRV/SPIRVTileAndDistribute.cpp
+++ b/iree/compiler/Codegen/SPIRV/SPIRVTileAndDistribute.cpp
@@ -53,14 +53,14 @@
static linalg::LinalgTransformationFilter getLinalgMatchAndReplaceMarker(
ArrayRef<StringRef> matchMarkers, Optional<StringRef> replaceMarker,
MLIRContext *context) {
- SmallVector<Identifier, 2> matchIds;
+ SmallVector<StringAttr, 2> matchIds;
matchIds.reserve(matchMarkers.size());
for (StringRef marker : matchMarkers) {
- matchIds.emplace_back(Identifier::get(marker, context));
+ matchIds.emplace_back(StringAttr::get(context, marker));
}
- Optional<Identifier> replaceId;
- if (replaceMarker) replaceId = Identifier::get(*replaceMarker, context);
+ Optional<StringAttr> replaceId;
+ if (replaceMarker) replaceId = StringAttr::get(context, *replaceMarker);
return linalg::LinalgTransformationFilter(matchIds, replaceId);
}
diff --git a/iree/compiler/Codegen/SPIRV/SPIRVTileAndVectorizeToCooperativeOps.cpp b/iree/compiler/Codegen/SPIRV/SPIRVTileAndVectorizeToCooperativeOps.cpp
index af8066c..d9fac5a 100644
--- a/iree/compiler/Codegen/SPIRV/SPIRVTileAndVectorizeToCooperativeOps.cpp
+++ b/iree/compiler/Codegen/SPIRV/SPIRVTileAndVectorizeToCooperativeOps.cpp
@@ -133,7 +133,7 @@
.setDistributionOptions(distributionOptions);
auto filter = linalg::LinalgTransformationFilter(
- ArrayRef<Identifier>{}, Identifier::get(getVectorizeMarker(), context));
+ ArrayRef<StringAttr>{}, StringAttr::get(context, getVectorizeMarker()));
linalg::TilingPatterns<linalg::FillOp, linalg::MatmulOp,
linalg::GenericOp>::insert(patterns, tilingOptions,
filter);
@@ -148,7 +148,7 @@
RewritePatternSet &patterns) {
linalg::LinalgVectorizationOptions opt;
linalg::LinalgTransformationFilter f(
- Identifier::get(getVectorizeMarker(), context));
+ StringAttr::get(context, getVectorizeMarker()));
linalg::VectorizationPatterns<linalg::FillOp, linalg::GenericOp>::insert(
patterns, opt, f);
patterns.add<linalg::LinalgVectorizationPattern>(
diff --git a/iree/compiler/Codegen/SPIRV/test/vectorize_elementwise_ops.mlir b/iree/compiler/Codegen/SPIRV/test/vectorize_elementwise_ops.mlir
index cb6832e..07c5898 100644
--- a/iree/compiler/Codegen/SPIRV/test/vectorize_elementwise_ops.mlir
+++ b/iree/compiler/Codegen/SPIRV/test/vectorize_elementwise_ops.mlir
@@ -66,15 +66,11 @@
// CHECK: %[[INSERT2:.+]] = vector.insert %[[READ]], %[[INSERT1]] [2] : vector<2xf32> into vector<4x2xf32>
// CHECK: %[[INSERT3:.+]] = vector.insert %[[READ]], %[[INSERT2]] [3] : vector<2xf32> into vector<4x2xf32>
// CHECK: %[[RT:.+]] = vector.transpose %[[INSERT3]], [1, 0] : vector<4x2xf32> to vector<2x4xf32>
-// CHECK: %[[SLICE0:.+]] = vector.extract_strided_slice %[[LT]] {offsets = [0, 0]
-// CHECK: %[[SLICE1:.+]] = vector.extract_strided_slice %[[RT]] {offsets = [0, 0]
-// CHECK: %[[EXTRACT0:.+]] = vector.extract %[[SLICE0]][0]
-// CHECK: %[[EXTRACT1:.+]] = vector.extract %[[SLICE1]][0]
+// CHECK: %[[EXTRACT0:.+]] = vector.extract %[[LT]][0]
+// CHECK: %[[EXTRACT1:.+]] = vector.extract %[[RT]][0]
// CHECK: %[[ADD0:.+]] = arith.addf %[[EXTRACT0]], %[[EXTRACT1]] : vector<4xf32>
-// CHECK: %[[SLICE0:.+]] = vector.extract_strided_slice %[[LT]] {offsets = [1, 0]
-// CHECK: %[[SLICE1:.+]] = vector.extract_strided_slice %[[RT]] {offsets = [1, 0]
-// CHECK: %[[EXTRACT0:.+]] = vector.extract %[[SLICE0]][0]
-// CHECK: %[[EXTRACT1:.+]] = vector.extract %[[SLICE1]][0]
+// CHECK: %[[EXTRACT0:.+]] = vector.extract %[[LT]][1]
+// CHECK: %[[EXTRACT1:.+]] = vector.extract %[[RT]][1]
// CHECK: %[[ADD1:.+]] = arith.addf %[[EXTRACT0]], %[[EXTRACT1]] : vector<4xf32>
// CHECK: %[[WRITE0:.+]] = vector.transfer_write %[[ADD0]], %[[OINIT]][%[[C0]], %[[C0]]]
// CHECK: %[[WRITE1:.+]] = vector.transfer_write %[[ADD1]], %[[WRITE0]][%[[C1]], %[[C0]]]
diff --git a/iree/compiler/Codegen/SPIRV/test/vectorize_matmul.mlir b/iree/compiler/Codegen/SPIRV/test/vectorize_matmul.mlir
index f2b2dcd..ea63bc7 100644
--- a/iree/compiler/Codegen/SPIRV/test/vectorize_matmul.mlir
+++ b/iree/compiler/Codegen/SPIRV/test/vectorize_matmul.mlir
@@ -63,21 +63,17 @@
// CHECK: %[[RHS_1_VECTOR:.+]] = vector.transfer_read %[[RHS_TILE]][%[[C1]], %[[C0]]], %[[PAD]]
// CHECK: %[[RHS_2_VECTOR:.+]] = vector.transfer_read %[[RHS_TILE]][%[[C2]], %[[C0]]], %[[PAD]]
// CHECK: %[[RHS_3_VECTOR:.+]] = vector.transfer_read %[[RHS_TILE]][%[[C3]], %[[C0]]], %[[PAD]]
-// CHECK: %[[LHS_0:.+]] = vector.extract_strided_slice %[[LHS_VECTOR]] {offsets = [0], sizes = [1], strides = [1]}
-// CHECK: %[[LHS_0_SCALAR:.+]] = vector.extract %[[LHS_0]][0] : vector<1xf32>
+// CHECK: %[[LHS_0_SCALAR:.+]] = vector.extract %[[LHS_VECTOR]][0]
// CHECK: %[[LHS_0_VECTOR:.+]] = splat %[[LHS_0_SCALAR]] : vector<4xf32>
// CHECK: %[[ACC_0_VECTOR:.+]] = vector.extract %[[ZERO]][0] : vector<1x4xf32>
// CHECK: %[[FMA_0:.+]] = vector.fma %[[LHS_0_VECTOR]], %[[RHS_0_VECTOR]], %[[ACC_0_VECTOR]] : vector<4xf32>
-// CHECK: %[[LHS_1:.+]] = vector.extract_strided_slice %[[LHS_VECTOR]] {offsets = [1], sizes = [1], strides = [1]}
-// CHECK: %[[LHS_1_SCALAR:.+]] = vector.extract %[[LHS_1]][0] : vector<1xf32>
+// CHECK: %[[LHS_1_SCALAR:.+]] = vector.extract %[[LHS_VECTOR]][1]
// CHECK: %[[LHS_1_VECTOR:.+]] = splat %[[LHS_1_SCALAR]] : vector<4xf32>
// CHECK: %[[FMA_1:.+]] = vector.fma %[[LHS_1_VECTOR]], %[[RHS_1_VECTOR]], %[[FMA_0]] : vector<4xf32>
-// CHECK: %[[LHS_2:.+]] = vector.extract_strided_slice %[[LHS_VECTOR]] {offsets = [2], sizes = [1], strides = [1]}
-// CHECK: %[[LHS_2_SCALAR:.+]] = vector.extract %[[LHS_2]][0] : vector<1xf32>
+// CHECK: %[[LHS_2_SCALAR:.+]] = vector.extract %[[LHS_VECTOR]][2]
// CHECK: %[[LHS_2_VECTOR:.+]] = splat %[[LHS_2_SCALAR]] : vector<4xf32>
// CHECK: %[[FMA_2:.+]] = vector.fma %[[LHS_2_VECTOR]], %[[RHS_2_VECTOR]], %[[FMA_1]] : vector<4xf32>
-// CHECK: %[[LHS_3:.+]] = vector.extract_strided_slice %[[LHS_VECTOR]] {offsets = [3], sizes = [1], strides = [1]}
-// CHECK: %[[LHS_3_SCALAR:.+]] = vector.extract %[[LHS_3]][0] : vector<1xf32>
+// CHECK: %[[LHS_3_SCALAR:.+]] = vector.extract %[[LHS_VECTOR]][3]
// CHECK: %[[LHS_3_VECTOR:.+]] = splat %[[LHS_3_SCALAR]] : vector<4xf32>
// CHECK: %[[FMA_3:.+]] = vector.fma %[[LHS_3_VECTOR]], %[[RHS_3_VECTOR]], %[[FMA_2]] : vector<4xf32>
// CHECK: vector.transfer_write %[[FMA_3]], %[[ACC_TILE]][%[[IV_Y]], %[[IV_X]]]
diff --git a/iree/compiler/Dialect/Flow/Transforms/StripSignednessPass.cpp b/iree/compiler/Dialect/Flow/Transforms/StripSignednessPass.cpp
index 1586766..95d767e 100644
--- a/iree/compiler/Dialect/Flow/Transforms/StripSignednessPass.cpp
+++ b/iree/compiler/Dialect/Flow/Transforms/StripSignednessPass.cpp
@@ -115,7 +115,7 @@
RewritePatternSet patterns(&getContext());
patterns.insert<GenericTypeConvert>(ctx, converter);
- populateFuncOpTypeConversionPattern(patterns, converter);
+ populateFunctionLikeTypeConversionPattern<FuncOp>(patterns, converter);
if (failed(applyFullConversion(func, target, std::move(patterns)))) {
signalPassFailure();
diff --git a/iree/compiler/Dialect/HAL/Target/LLVM/LLVMAOTTarget.cpp b/iree/compiler/Dialect/HAL/Target/LLVM/LLVMAOTTarget.cpp
index 6e5bb5f..6257157 100644
--- a/iree/compiler/Dialect/HAL/Target/LLVM/LLVMAOTTarget.cpp
+++ b/iree/compiler/Dialect/HAL/Target/LLVM/LLVMAOTTarget.cpp
@@ -151,7 +151,7 @@
Builder b(context);
SmallVector<NamedAttribute> configItems;
- configItems.emplace_back(b.getIdentifier("executable_targets"),
+ configItems.emplace_back(b.getStringAttr("executable_targets"),
getExecutableTargets(context));
auto configAttr = b.getDictionaryAttr(configItems);
diff --git a/iree/compiler/Dialect/HAL/Target/MetalSPIRV/MetalSPIRVTarget.cpp b/iree/compiler/Dialect/HAL/Target/MetalSPIRV/MetalSPIRVTarget.cpp
index 4ce238d..6919875 100644
--- a/iree/compiler/Dialect/HAL/Target/MetalSPIRV/MetalSPIRVTarget.cpp
+++ b/iree/compiler/Dialect/HAL/Target/MetalSPIRV/MetalSPIRVTarget.cpp
@@ -54,7 +54,7 @@
Builder b(context);
SmallVector<NamedAttribute> configItems;
- configItems.emplace_back(b.getIdentifier("executable_targets"),
+ configItems.emplace_back(b.getStringAttr("executable_targets"),
getExecutableTargets(context));
auto configAttr = b.getDictionaryAttr(configItems);
@@ -154,7 +154,7 @@
Builder b(context);
SmallVector<NamedAttribute> configItems;
- configItems.emplace_back(b.getIdentifier(spirv::getTargetEnvAttrName()),
+ configItems.emplace_back(b.getStringAttr(spirv::getTargetEnvAttrName()),
targetEnv);
auto configAttr = b.getDictionaryAttr(configItems);
diff --git a/iree/compiler/Dialect/HAL/Target/ROCM/ROCMTarget.cpp b/iree/compiler/Dialect/HAL/Target/ROCM/ROCMTarget.cpp
index 279ed1b..5033d18 100644
--- a/iree/compiler/Dialect/HAL/Target/ROCM/ROCMTarget.cpp
+++ b/iree/compiler/Dialect/HAL/Target/ROCM/ROCMTarget.cpp
@@ -72,7 +72,7 @@
MLIRContext *context) const override {
Builder b(context);
SmallVector<NamedAttribute> configItems;
- configItems.emplace_back(b.getIdentifier("executable_targets"),
+ configItems.emplace_back(b.getStringAttr("executable_targets"),
getExecutableTargets(context));
auto configAttr = b.getDictionaryAttr(configItems);
diff --git a/iree/compiler/Dialect/HAL/Target/VMVX/VMVXTarget.cpp b/iree/compiler/Dialect/HAL/Target/VMVX/VMVXTarget.cpp
index ee9870b..6acad1e 100644
--- a/iree/compiler/Dialect/HAL/Target/VMVX/VMVXTarget.cpp
+++ b/iree/compiler/Dialect/HAL/Target/VMVX/VMVXTarget.cpp
@@ -45,7 +45,7 @@
Builder b(context);
SmallVector<NamedAttribute> configItems;
- configItems.emplace_back(b.getIdentifier("executable_targets"),
+ configItems.emplace_back(b.getStringAttr("executable_targets"),
getExecutableTargets(context));
auto configAttr = b.getDictionaryAttr(configItems);
diff --git a/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/VulkanSPIRVTarget.cpp b/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/VulkanSPIRVTarget.cpp
index dffa3c9..4eaa840 100644
--- a/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/VulkanSPIRVTarget.cpp
+++ b/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/VulkanSPIRVTarget.cpp
@@ -141,13 +141,13 @@
uint64_t maxBufferRange = 128 * 1024 * 1024ull;
uint64_t minBufferRangeAlignment = 16ull;
configItems.emplace_back(
- b.getIdentifier("buffer_constraints"),
+ b.getStringAttr("buffer_constraints"),
BufferConstraintsAttr::get(b.getIndexAttr(maxAllocationSize),
b.getIndexAttr(minBufferOffsetAlignment),
b.getIndexAttr(maxBufferRange),
b.getIndexAttr(minBufferRangeAlignment)));
- configItems.emplace_back(b.getIdentifier("executable_targets"),
+ configItems.emplace_back(b.getStringAttr("executable_targets"),
getExecutableTargets(context));
auto configAttr = b.getDictionaryAttr(configItems);
@@ -334,7 +334,7 @@
Builder b(context);
SmallVector<NamedAttribute> configItems;
- configItems.emplace_back(b.getIdentifier(spirv::getTargetEnvAttrName()),
+ configItems.emplace_back(b.getStringAttr(spirv::getTargetEnvAttrName()),
targetEnv);
auto configAttr = b.getDictionaryAttr(configItems);
diff --git a/iree/compiler/Dialect/HAL/Target/WebGPU/WebGPUTarget.cpp b/iree/compiler/Dialect/HAL/Target/WebGPU/WebGPUTarget.cpp
index 8fd908d..606d19e 100644
--- a/iree/compiler/Dialect/HAL/Target/WebGPU/WebGPUTarget.cpp
+++ b/iree/compiler/Dialect/HAL/Target/WebGPU/WebGPUTarget.cpp
@@ -76,7 +76,7 @@
Builder b(context);
SmallVector<NamedAttribute> configItems;
- configItems.emplace_back(b.getIdentifier("executable_targets"),
+ configItems.emplace_back(b.getStringAttr("executable_targets"),
getExecutableTargets(context));
auto configAttr = b.getDictionaryAttr(configItems);
@@ -223,7 +223,7 @@
Builder b(context);
SmallVector<NamedAttribute> configItems;
- configItems.emplace_back(b.getIdentifier(spirv::getTargetEnvAttrName()),
+ configItems.emplace_back(b.getStringAttr(spirv::getTargetEnvAttrName()),
targetEnv);
auto configAttr = b.getDictionaryAttr(configItems);
diff --git a/iree/compiler/Dialect/Stream/IR/StreamTypes.cpp b/iree/compiler/Dialect/Stream/IR/StreamTypes.cpp
index 38135cf..40fc793 100644
--- a/iree/compiler/Dialect/Stream/IR/StreamTypes.cpp
+++ b/iree/compiler/Dialect/Stream/IR/StreamTypes.cpp
@@ -125,7 +125,7 @@
// static
ResourceConfigAttr ResourceConfigAttr::lookup(Operation *op) {
auto *context = op->getContext();
- auto attrId = Identifier::get("stream.resources", context);
+ auto attrId = StringAttr::get(context, "stream.resources");
while (op) {
if (auto affinityOp = llvm::dyn_cast<AffinityOpInterface>(op)) {
auto affinityAttr = affinityOp.getAffinity();
@@ -172,7 +172,7 @@
//===----------------------------------------------------------------------===//
AffinityAttr AffinityAttr::lookup(Operation *op) {
- auto attrId = Identifier::get("stream.affinity", op->getContext());
+ auto attrId = StringAttr::get(op->getContext(), "stream.affinity");
while (op) {
if (auto affinityOp = llvm::dyn_cast<AffinityOpInterface>(op)) {
auto affinity = affinityOp.getAffinity();
@@ -228,7 +228,7 @@
}
PartitioningConfigAttr PartitioningConfigAttr::lookup(Operation *op) {
- auto attrId = Identifier::get("stream.partitioning", op->getContext());
+ auto attrId = StringAttr::get(op->getContext(), "stream.partitioning");
while (op) {
auto attr = op->getAttrOfType<PartitioningConfigAttr>(attrId);
if (attr) return attr;
diff --git a/iree/compiler/Dialect/Util/Transforms/FixedPointIterator.cpp b/iree/compiler/Dialect/Util/Transforms/FixedPointIterator.cpp
index dd9fbd8..508822c 100644
--- a/iree/compiler/Dialect/Util/Transforms/FixedPointIterator.cpp
+++ b/iree/compiler/Dialect/Util/Transforms/FixedPointIterator.cpp
@@ -87,9 +87,9 @@
void FixedPointIteratorPass::runOnOperation() {
MLIRContext *context = &getContext();
- StringAttr markerName = StringAttr::get("iree.fixedpoint.iteration", context);
+ StringAttr markerName = StringAttr::get(context, "iree.fixedpoint.iteration");
StringAttr modifiedName =
- StringAttr::get("iree.fixedpoint.modified", context);
+ StringAttr::get(context, "iree.fixedpoint.modified");
if (getOperation()->hasAttr(markerName)) {
emitError(getOperation()->getLoc())
diff --git a/iree/compiler/Dialect/Util/Transforms/TestFloatRangeAnalysis.cpp b/iree/compiler/Dialect/Util/Transforms/TestFloatRangeAnalysis.cpp
index 6eb3921..bb06ca5 100644
--- a/iree/compiler/Dialect/Util/Transforms/TestFloatRangeAnalysis.cpp
+++ b/iree/compiler/Dialect/Util/Transforms/TestFloatRangeAnalysis.cpp
@@ -57,7 +57,7 @@
// Update.
for (auto &it : queryOps) {
it.first->setAttr("analysis",
- StringAttr::get(it.second->getAsStr(), &getContext()));
+ StringAttr::get(&getContext(), it.second->getAsStr()));
}
}
};
diff --git a/iree/compiler/Dialect/VM/IR/VMOps.cpp b/iree/compiler/Dialect/VM/IR/VMOps.cpp
index ee5e558..864dc61 100644
--- a/iree/compiler/Dialect/VM/IR/VMOps.cpp
+++ b/iree/compiler/Dialect/VM/IR/VMOps.cpp
@@ -109,7 +109,7 @@
}
}
if (!didFind) {
- attrs.push_back(NamedAttribute(Identifier::get(name, getContext()), value));
+ attrs.push_back(NamedAttribute(StringAttr::get(getContext(), name), value));
DictionaryAttr::sortInPlace(attrs);
}
getOperation()->setAttr("iree.reflection",
diff --git a/llvm-external-projects/iree-dialects/lib/Dialect/LinalgExt/Transforms/Tiling.cpp b/llvm-external-projects/iree-dialects/lib/Dialect/LinalgExt/Transforms/Tiling.cpp
index 96201c5..2a624ab 100644
--- a/llvm-external-projects/iree-dialects/lib/Dialect/LinalgExt/Transforms/Tiling.cpp
+++ b/llvm-external-projects/iree-dialects/lib/Dialect/LinalgExt/Transforms/Tiling.cpp
@@ -282,24 +282,24 @@
patterns.add<TiledOpInterfaceTilingPattern>(
context, linalg::LinalgTilingOptions().setTileSizes({10, 20}),
linalg::LinalgTransformationFilter(
- Identifier::get("tiling_input", context),
- Identifier::get("tiling_output", context)));
+ StringAttr::get(context, "tiling_input"),
+ StringAttr::get(context, "tiling_output")));
patterns.add<TiledOpInterfaceTilingPattern>(
context, linalg::LinalgTilingOptions().setTileSizes(ArrayRef<int64_t>{0}),
linalg::LinalgTransformationFilter(
- Identifier::get("no_tiling_input", context),
- Identifier::get("no_tiling_output", context)));
+ StringAttr::get(context, "no_tiling_input"),
+ StringAttr::get(context, "no_tiling_output")));
patterns.add<TiledOpInterfaceTilingPattern>(
context, linalg::LinalgTilingOptions().setTileSizes({0, 20}),
linalg::LinalgTransformationFilter(
- Identifier::get("outer_reduce_input", context),
- Identifier::get("outer_reduce_output", context)));
+ StringAttr::get(context, "outer_reduce_input"),
+ StringAttr::get(context, "outer_reduce_output")));
patterns.add<TiledOpInterfaceTilingPattern>(
context, linalg::LinalgTilingOptions().setTileSizes({10, 0, 0}),
linalg::LinalgTransformationFilter(
- Identifier::get("inner_reduce_input", context),
- Identifier::get("inner_reduce_output", context)));
+ StringAttr::get(context, "inner_reduce_input"),
+ StringAttr::get(context, "inner_reduce_output")));
static linalg::LinalgLoopDistributionOptions workgroupDistributionOptions = {
[](OpBuilder &builder, Location loc, ArrayRef<Range> parallelLoopRanges) {
@@ -326,22 +326,22 @@
.setTileSizes(ArrayRef<int64_t>{10, 0, 30})
.setDistributionOptions(workgroupDistributionOptions),
linalg::LinalgTransformationFilter(
- Identifier::get("distribute_input", context),
- Identifier::get("distribute_output", context)));
+ StringAttr::get(context, "distribute_input"),
+ StringAttr::get(context, "distribute_output")));
patterns.add<TiledOpInterfaceTilingPattern>(
context,
linalg::LinalgTilingOptions().setTileSizes(ArrayRef<int64_t>{32}),
linalg::LinalgTransformationFilter(
- Identifier::get("tiling_1d_stage5_fft_input", context),
- Identifier::get("tiling_1d_stage5_fft_output", context)));
+ StringAttr::get(context, "tiling_1d_stage5_fft_input"),
+ StringAttr::get(context, "tiling_1d_stage5_fft_output")));
patterns.add<TiledOpInterfaceTilingPattern>(
context,
linalg::LinalgTilingOptions().setTileSizes(ArrayRef<int64_t>{10, 32}),
linalg::LinalgTransformationFilter(
- Identifier::get("tiling_2d_stage5_fft_input", context),
- Identifier::get("tiling_2d_stage5_fft_output", context)));
+ StringAttr::get(context, "tiling_2d_stage5_fft_input"),
+ StringAttr::get(context, "tiling_2d_stage5_fft_output")));
if (failed(applyPatternsAndFoldGreedily(funcOp, std::move(patterns)))) {
return signalPassFailure();
diff --git a/third_party/llvm-project b/third_party/llvm-project
index c490f8f..c84b8be 160000
--- a/third_party/llvm-project
+++ b/third_party/llvm-project
@@ -1 +1 @@
-Subproject commit c490f8feb71e837dd7011e7a7d8a7928507c9c76
+Subproject commit c84b8be516bcc4d021ff804169d58a7b3104e050
diff --git a/third_party/mlir-hlo b/third_party/mlir-hlo
index f9f6968..ec0760e 160000
--- a/third_party/mlir-hlo
+++ b/third_party/mlir-hlo
@@ -1 +1 @@
-Subproject commit f9f696890acbe198b6164a7ca43523e2bddd630a
+Subproject commit ec0760eb3c4d7c75ff26ab8b18e7f465d6d89aba
diff --git a/third_party/mlir-hlo.branch-pin b/third_party/mlir-hlo.branch-pin
new file mode 100644
index 0000000..47edf9d
--- /dev/null
+++ b/third_party/mlir-hlo.branch-pin
@@ -0,0 +1 @@
+patched-mlir-hlo-20220118