Rename xla_chlo dialect into chlo
Following on the plan of isolating the compiler/mlir/hlo directory.
PiperOrigin-RevId: 320212018
diff --git a/iree/compiler/Dialect/Flow/Transforms/HLOToHLOPreprocessing.cpp b/iree/compiler/Dialect/Flow/Transforms/HLOToHLOPreprocessing.cpp
index e591f84..2d04cb4 100644
--- a/iree/compiler/Dialect/Flow/Transforms/HLOToHLOPreprocessing.cpp
+++ b/iree/compiler/Dialect/Flow/Transforms/HLOToHLOPreprocessing.cpp
@@ -194,7 +194,7 @@
// Note that various input modalities may do their own legalization of
// CHLO. Converting here allows IREE to accept CHLO dialect regardless of
// whether it was legalized away at a higher level.
- xla_chlo::PopulateLegalizeChloToHloPatterns(context, &patterns);
+ chlo::PopulateLegalizeChloToHloPatterns(context, &patterns);
patterns.insert<ExtractReduceWindowOpPaddingAttributes,
AdjustDepthwiseFilterShape>(context);
if (extractPadFromConv) {
diff --git a/iree/test/e2e/models/mnist_fake_weights.mlir b/iree/test/e2e/models/mnist_fake_weights.mlir
index e0dfd64..79e0a24 100644
--- a/iree/test/e2e/models/mnist_fake_weights.mlir
+++ b/iree/test/e2e/models/mnist_fake_weights.mlir
@@ -23,10 +23,10 @@
%9 = flow.variable.load.indirect %0 : !iree.ptr<tensor<784x128xf32>> -> tensor<784x128xf32>
%10 = "mhlo.reshape"(%arg0) : (tensor<1x28x28x1xf32>) -> tensor<1x784xf32>
%11 = "mhlo.dot"(%10, %9) : (tensor<1x784xf32>, tensor<784x128xf32>) -> tensor<1x128xf32>
- %12 = xla_chlo.broadcast_add %11, %8 {broadcast_dimensions = dense<1> : tensor<1xi64>} : (tensor<1x128xf32>, tensor<128xf32>) -> tensor<1x128xf32>
- %13 = xla_chlo.broadcast_maximum %12, %5 {broadcast_dimensions = dense<[]> : tensor<0xi64>} : (tensor<1x128xf32>, tensor<f32>) -> tensor<1x128xf32>
+ %12 = chlo.broadcast_add %11, %8 {broadcast_dimensions = dense<1> : tensor<1xi64>} : (tensor<1x128xf32>, tensor<128xf32>) -> tensor<1x128xf32>
+ %13 = chlo.broadcast_maximum %12, %5 {broadcast_dimensions = dense<[]> : tensor<0xi64>} : (tensor<1x128xf32>, tensor<f32>) -> tensor<1x128xf32>
%14 = "mhlo.dot"(%13, %7) : (tensor<1x128xf32>, tensor<128x10xf32>) -> tensor<1x10xf32>
- %15 = xla_chlo.broadcast_add %14, %6 {broadcast_dimensions = dense<1> : tensor<1xi64>} : (tensor<1x10xf32>, tensor<10xf32>) -> tensor<1x10xf32>
+ %15 = chlo.broadcast_add %14, %6 {broadcast_dimensions = dense<1> : tensor<1xi64>} : (tensor<1x10xf32>, tensor<10xf32>) -> tensor<1x10xf32>
%16 = "mhlo.reduce"(%15, %4) ( {
^bb0(%arg1: tensor<f32>, %arg2: tensor<f32>): // no predecessors
%23 = mhlo.maximum %arg1, %arg2 : tensor<f32>
diff --git a/iree/test/e2e/structural/fused_dispatch_region.mlir b/iree/test/e2e/structural/fused_dispatch_region.mlir
index fa49e2e..3de451d 100644
--- a/iree/test/e2e/structural/fused_dispatch_region.mlir
+++ b/iree/test/e2e/structural/fused_dispatch_region.mlir
@@ -7,7 +7,7 @@
]> : tensor<3x4xf32>
%workload = constant 9 : index
%dr0 = flow.dispatch.region[%workload: index](%arg0 = %term0 : tensor<4xf32>, %arg1 = %term1 : tensor<3x4xf32>) -> tensor<3x3xf32> {
- %0 = xla_chlo.broadcast_add %arg0, %arg1 : (tensor<4xf32>, tensor<3x4xf32>) -> tensor<3x4xf32>
+ %0 = chlo.broadcast_add %arg0, %arg1 : (tensor<4xf32>, tensor<3x4xf32>) -> tensor<3x4xf32>
%1 = "mhlo.transpose"(%0) {permutation = dense<[1, 0]> : tensor<2xi64>} : (tensor<3x4xf32>) -> tensor<4x3xf32>
%2 = "mhlo.dot"(%arg1, %1) {precision_config = ["DEFAULT", "DEFAULT"]} : (tensor<3x4xf32>, tensor<4x3xf32>) -> tensor<3x3xf32>
%3 = "mhlo.tanh"(%2) : (tensor<3x3xf32>) -> (tensor<3x3xf32>)
diff --git a/iree/test/e2e/xla_ops/broadcast_add.mlir b/iree/test/e2e/xla_ops/broadcast_add.mlir
index baa11e6..2bff0c3 100644
--- a/iree/test/e2e/xla_ops/broadcast_add.mlir
+++ b/iree/test/e2e/xla_ops/broadcast_add.mlir
@@ -1,7 +1,7 @@
func @tensor() attributes { iree.module.export } {
%0 = iree.unfoldable_constant dense<[1.0, 2.0, 3.0, 4.0]> : tensor<4xf32>
%1 = iree.unfoldable_constant dense<2.0> : tensor<3x4xf32>
- %result = "xla_chlo.broadcast_add"(%0, %1) : (tensor<4xf32>, tensor<3x4xf32>) -> tensor<3x4xf32>
+ %result = "chlo.broadcast_add"(%0, %1) : (tensor<4xf32>, tensor<3x4xf32>) -> tensor<3x4xf32>
check.expect_almost_eq_const(%result,
dense<[[3.0, 4.0, 5.0, 6.0],
[3.0, 4.0, 5.0, 6.0],
diff --git a/iree/tools/init_xla_dialects.h b/iree/tools/init_xla_dialects.h
index bdca529..e1b8f91 100644
--- a/iree/tools/init_xla_dialects.h
+++ b/iree/tools/init_xla_dialects.h
@@ -29,9 +29,9 @@
// all the possible dialects to be made available to the context automatically.
inline void registerXLADialects() {
static bool init_once = []() {
- registerDialect<mlir::mhlo::XlaHloDialect>();
- registerDialect<mlir::xla_chlo::XlaHloClientDialect>();
+ registerDialect<mlir::chlo::HloClientDialect>();
registerDialect<mlir::lmhlo::LmhloDialect>();
+ registerDialect<mlir::mhlo::XlaHloDialect>();
return true;
}();
(void)init_once;