diff --git a/xla/service/gpu/fusions/mlir/BUILD b/xla/service/gpu/fusions/mlir/BUILD index 21b1787438c4b..5c236eb070cb6 100644 --- a/xla/service/gpu/fusions/mlir/BUILD +++ b/xla/service/gpu/fusions/mlir/BUILD @@ -21,6 +21,7 @@ cc_library( ":type_util", "//xla:shape_util", "//xla:union_find", + "//xla:util", "//xla/hlo/ir:hlo", "//xla/service/gpu:hlo_fusion_analysis", "//xla/service/gpu/fusions:fusion_emitter", @@ -39,6 +40,7 @@ cc_library( "@llvm-project//mlir:FuncDialect", "@llvm-project//mlir:IR", "@llvm-project//mlir:LLVMDialect", + "@llvm-project//mlir:Support", ], ) @@ -68,6 +70,7 @@ cc_library( "//xla:comparison_util", "//xla:shape_util", "//xla:status_macros", + "//xla:xla_data_proto_cc", "//xla/hlo/ir:hlo", "//xla/mlir/utils:type_util", "//xla/mlir_hlo", @@ -130,6 +133,7 @@ xla_cc_test( "@com_google_googletest//:gtest", "@llvm-project//llvm:Support", "@llvm-project//mlir:AffineDialect", + "@llvm-project//mlir:ArithDialect", "@llvm-project//mlir:AsmParser", "@llvm-project//mlir:DLTIDialect", "@llvm-project//mlir:FuncDialect", @@ -240,6 +244,7 @@ xla_cc_test( "//xla/tests:hlo_test_base", "//xla/tests:xla_internal_test_main", "@com_google_absl//absl/status", + "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:string_view", "@com_google_googletest//:gtest", "@llvm-project//llvm:Support", diff --git a/xla/service/gpu/fusions/mlir/computation_partitioner.cc b/xla/service/gpu/fusions/mlir/computation_partitioner.cc index 53d8678e95307..9d3b772b7f2ba 100644 --- a/xla/service/gpu/fusions/mlir/computation_partitioner.cc +++ b/xla/service/gpu/fusions/mlir/computation_partitioner.cc @@ -32,9 +32,10 @@ limitations under the License. #include "absl/strings/str_join.h" #include "absl/types/span.h" #include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" #include "mlir/Dialect/Func/IR/FuncOps.h" -#include "mlir/Dialect/LLVMIR/LLVMDialect.h" +#include "mlir/Dialect/LLVMIR/LLVMAttrs.h" #include "mlir/IR/Attributes.h" #include "mlir/IR/Builders.h" #include "mlir/IR/BuiltinAttributes.h" @@ -43,15 +44,18 @@ limitations under the License. #include "mlir/IR/Types.h" #include "mlir/IR/Value.h" #include "mlir/Interfaces/DataLayoutInterfaces.h" +#include "mlir/Support/LLVM.h" #include "xla/hlo/ir/hlo_computation.h" #include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/ir/hlo_opcode.h" +#include "xla/service/gpu/fusions/fusion_emitter.h" #include "xla/service/gpu/fusions/mlir/type_util.h" #include "xla/service/gpu/hlo_fusion_analysis.h" #include "xla/service/gpu/model/indexing_analysis.h" #include "xla/service/gpu/model/indexing_map.h" #include "xla/service/llvm_ir/llvm_util.h" #include "xla/shape.h" +#include "xla/shape_util.h" namespace xla { namespace gpu { diff --git a/xla/service/gpu/fusions/mlir/computation_partitioner.h b/xla/service/gpu/fusions/mlir/computation_partitioner.h index 5d5c78c4cd64a..5271cd1afa175 100644 --- a/xla/service/gpu/fusions/mlir/computation_partitioner.h +++ b/xla/service/gpu/fusions/mlir/computation_partitioner.h @@ -20,6 +20,7 @@ limitations under the License. #include #include "absl/container/flat_hash_map.h" +#include "absl/container/flat_hash_set.h" #include "absl/types/span.h" #include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/IR/Builders.h" @@ -31,6 +32,7 @@ limitations under the License. #include "xla/service/gpu/fusions/fusion_emitter.h" #include "xla/service/gpu/hlo_fusion_analysis.h" #include "xla/service/gpu/model/indexing_map.h" +#include "xla/util.h" namespace xla { namespace gpu { diff --git a/xla/service/gpu/fusions/mlir/elemental_hlo_to_mlir.cc b/xla/service/gpu/fusions/mlir/elemental_hlo_to_mlir.cc index d94c6d5a03846..68b3ab2935921 100644 --- a/xla/service/gpu/fusions/mlir/elemental_hlo_to_mlir.cc +++ b/xla/service/gpu/fusions/mlir/elemental_hlo_to_mlir.cc @@ -78,6 +78,7 @@ limitations under the License. #include "xla/shape_util.h" #include "xla/status_macros.h" #include "xla/translate/hlo_to_mhlo/hlo_utils.h" +#include "xla/xla_data.pb.h" #include "tsl/platform/statusor.h" namespace xla { diff --git a/xla/service/gpu/fusions/mlir/elemental_hlo_to_mlir.h b/xla/service/gpu/fusions/mlir/elemental_hlo_to_mlir.h index 8f109aa3f452f..c92f2445709e8 100644 --- a/xla/service/gpu/fusions/mlir/elemental_hlo_to_mlir.h +++ b/xla/service/gpu/fusions/mlir/elemental_hlo_to_mlir.h @@ -22,8 +22,10 @@ limitations under the License. #include "llvm/ADT/SmallVector.h" #include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/IR/AffineExpr.h" +#include "mlir/IR/Builders.h" #include "mlir/IR/ImplicitLocOpBuilder.h" #include "mlir/IR/TypeRange.h" +#include "mlir/IR/Types.h" #include "mlir/IR/Value.h" #include "mlir/IR/ValueRange.h" #include "mlir/Support/LLVM.h" diff --git a/xla/service/gpu/fusions/mlir/elemental_hlo_to_mlir_test.cc b/xla/service/gpu/fusions/mlir/elemental_hlo_to_mlir_test.cc index 33046ea54085a..e683e199ed03c 100644 --- a/xla/service/gpu/fusions/mlir/elemental_hlo_to_mlir_test.cc +++ b/xla/service/gpu/fusions/mlir/elemental_hlo_to_mlir_test.cc @@ -23,6 +23,7 @@ limitations under the License. #include "llvm/Support/raw_ostream.h" #include "mlir/AsmParser/AsmParser.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" +#include "mlir/Dialect/Arith/IR/Arith.h" #include "mlir/Dialect/DLTI/DLTI.h" #include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/Dialect/LLVMIR/LLVMDialect.h" @@ -31,6 +32,7 @@ limitations under the License. #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/IR/AffineExpr.h" #include "mlir/IR/ImplicitLocOpBuilder.h" +#include "mlir/IR/Location.h" #include "mlir/IR/MLIRContext.h" #include "mlir/Pass/PassManager.h" #include "mlir/Transforms/Passes.h" @@ -38,13 +40,10 @@ limitations under the License. #include "xla/mlir_hlo/mhlo/IR/hlo_ops.h" #include "xla/service/gpu/fusions/ir/xla_gpu_ops.h" #include "xla/service/gpu/fusions/mlir/computation_partitioner.h" -#include "xla/service/gpu/launch_dimensions.h" -#include "xla/service/gpu/model/indexing_analysis.h" #include "xla/service/gpu/model/indexing_map.h" #include "xla/service/hlo_parser.h" #include "xla/service/llvm_ir/llvm_util.h" #include "xla/status_macros.h" -#include "xla/stream_executor/launch_dim.h" #include "xla/tests/filecheck.h" #include "xla/tests/hlo_test_base.h" #include "xla/tsl/lib/core/status_test_util.h" diff --git a/xla/service/gpu/fusions/mlir/mlir_fusion_emitter.cc b/xla/service/gpu/fusions/mlir/mlir_fusion_emitter.cc index 45d66ebca0108..448d3050c30bd 100644 --- a/xla/service/gpu/fusions/mlir/mlir_fusion_emitter.cc +++ b/xla/service/gpu/fusions/mlir/mlir_fusion_emitter.cc @@ -96,7 +96,6 @@ limitations under the License. #include "xla/service/gpu/kernel_arguments.h" #include "xla/service/gpu/kernel_reuse_cache.h" #include "xla/service/gpu/launch_dimensions.h" -#include "xla/service/gpu/model/indexing_map.h" #include "xla/service/gpu/runtime/kernel_thunk.h" #include "xla/service/gpu/target_util.h" #include "xla/service/llvm_ir/llvm_util.h" diff --git a/xla/service/gpu/fusions/mlir/mlir_fusion_emitter_test.cc b/xla/service/gpu/fusions/mlir/mlir_fusion_emitter_test.cc index f896d5e6b3747..35e14a98200c6 100644 --- a/xla/service/gpu/fusions/mlir/mlir_fusion_emitter_test.cc +++ b/xla/service/gpu/fusions/mlir/mlir_fusion_emitter_test.cc @@ -20,6 +20,7 @@ limitations under the License. #include #include "absl/status/status.h" +#include "absl/strings/str_replace.h" #include "absl/strings/string_view.h" #include "llvm/IR/LLVMContext.h" #include "llvm/Support/raw_ostream.h"