Skip to content

Commit

Permalink
[xla:cpu] rename LowerTrivialPass to LowerToLLVMPass
Browse files Browse the repository at this point in the history
Trivial or not, LowerToLLVM is more descriptive.

PiperOrigin-RevId: 719470301
  • Loading branch information
cota authored and Google-ML-Automation committed Jan 27, 2025
1 parent 8591928 commit 996ab5f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion xla/backends/cpu/codegen/emitters/transforms/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ gentbl_cc_library(

cc_library(
name = "passes",
srcs = ["lower_trivial.cc"],
srcs = ["lower_to_llvm.cc"],
hdrs = ["passes.h"],
deps = [
":passes_inc_gen",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ limitations under the License.

namespace xla::cpu {

#define GEN_PASS_DECL_LOWERTRIVIALPASS
#define GEN_PASS_DEF_LOWERTRIVIALPASS
#define GEN_PASS_DECL_LOWERTOLLVMPASS
#define GEN_PASS_DEF_LOWERTOLLVMPASS
#include "xla/backends/cpu/codegen/emitters/transforms/passes.h.inc"

namespace {
class LowerTrivialPass : public impl::LowerTrivialPassBase<LowerTrivialPass> {
class LowerToLLVMPass : public impl::LowerToLLVMPassBase<LowerToLLVMPass> {
void runOnOperation() override {
mlir::MLIRContext* mlir_context = &getContext();
mlir::RewritePatternSet patterns(mlir_context);
Expand All @@ -51,8 +51,8 @@ class LowerTrivialPass : public impl::LowerTrivialPassBase<LowerTrivialPass> {
};
} // namespace

std::unique_ptr<mlir::Pass> CreateLowerTrivialPass() {
return std::make_unique<LowerTrivialPass>();
std::unique_ptr<mlir::Pass> CreateLowerToLLVMPass() {
return std::make_unique<LowerToLLVMPass>();
}

} // namespace xla::cpu
2 changes: 1 addition & 1 deletion xla/backends/cpu/codegen/emitters/transforms/passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace xla::cpu {
#define GEN_PASS_DECL
#include "xla/backends/cpu/codegen/emitters/transforms/passes.h.inc"

std::unique_ptr<mlir::Pass> CreateLowerTrivialPass();
std::unique_ptr<mlir::Pass> CreateLowerToLLVMPass();

#define GEN_PASS_REGISTRATION
#include "xla/backends/cpu/codegen/emitters/transforms/passes.h.inc"
Expand Down
10 changes: 5 additions & 5 deletions xla/backends/cpu/codegen/emitters/transforms/passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ limitations under the License.

include "mlir/Pass/PassBase.td"

def LowerTrivialPass : Pass<"xla-cpu-lower-trivial", "mlir::ModuleOp"> {
let summary = "Trivial one shot lowering from tensors + xla_cpu to LLVM";
def LowerToLLVMPass : Pass<"xla-cpu-lower-to-llvm", "mlir::ModuleOp"> {
let summary = "Lowering from tensors + xla_cpu to LLVM";

let description = [{
This is a trivial pass for lowering tensors and xla_cpu operations to LLVM
This is a pass for lowering tensors and xla_cpu operations to LLVM
dialect and pointers.
}];

Expand All @@ -30,5 +30,5 @@ def LowerTrivialPass : Pass<"xla-cpu-lower-trivial", "mlir::ModuleOp"> {
"xla::cpu::XlaCpuDialect",
];

let constructor = "::xla::cpu::CreateLowerTrivialPass()";
}
let constructor = "::xla::cpu::CreateLowerToLLVMPass()";
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: emitters_opt %s --xla-cpu-lower-trivial -split-input-file | FileCheck %s
// RUN: emitters_opt %s --xla-cpu-lower-to-llvm -split-input-file | FileCheck %s

func.func @fn(%arg0: index, %arg1: tensor<2xi32>) -> tensor<2xi32> {
return %arg1 : tensor<2xi32>
Expand Down

0 comments on commit 996ab5f

Please sign in to comment.