Skip to content

Commit

Permalink
Merge pull request #115 from frasercrmck/rename-base
Browse files Browse the repository at this point in the history
[compiler] Rename 'base_pass*'  -> 'base_module_pass*'
  • Loading branch information
frasercrmck authored Aug 31, 2023
2 parents 5d3b3ed + 7b518b4 commit 461abfa
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 26 deletions.
6 changes: 3 additions & 3 deletions doc/developer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -1130,9 +1130,9 @@ comprehension or to inspect a compiler bug narrowed down to a specific pass.

The name of the pass can typically be found in any of the _pass registry
files_. The main ComputeMux pass registry is found at
`modules/compiler/source/base/source/base_pass_registry.def`, but targets may
define their own. LLVM also defines its own, found (through access to the LLVM
source code) at `llvm/lib/Passes/PassRegistry.def`.
`modules/compiler/source/base/source/base_module_pass_registry.def`, but
targets may define their own. LLVM also defines its own, found (through access
to the LLVM source code) at `llvm/lib/Passes/PassRegistry.def`.

Since LLVM ComputeMux use the same style of pass registration, both contain
lines such as:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef {{cookiecutter.target_name_capitals}}_PASS_MACHINERY_H_INCLUDED
#define {{cookiecutter.target_name_capitals}}_PASS_MACHINERY_H_INCLUDED

#include <base/base_pass_machinery.h>
#include <base/base_module_pass_machinery.h>
#include <{{cookiecutter.target_name}}/target.h>

namespace {{cookiecutter.target_name}} {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#ifndef RISCV_PASS_MACHINERY_H_INCLUDED
#define RISCV_PASS_MACHINERY_H_INCLUDED

#include <base/base_pass_machinery.h>
#include <base/base_module_pass_machinery.h>
#include <riscv/target.h>
#include <vecz/pass.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
/// @brief Base module pass machinery to be used for BaseModule's PassManager
/// state

#ifndef BASE_PASS_MACHINERY_H_INCLUDED
#define BASE_PASS_MACHINERY_H_INCLUDED
#ifndef BASE_MODULE_PASS_MACHINERY_H_INCLUDED
#define BASE_MODULE_PASS_MACHINERY_H_INCLUDED

#include <compiler/module.h>
#include <compiler/utils/builtin_info.h>
Expand Down Expand Up @@ -93,4 +93,4 @@ compiler::utils::DeviceInfo initDeviceInfoFromMux(

/// @}
} // namespace compiler
#endif // BASE_PASS_MACHINERY_H_INCLUDED
#endif // BASE_MODULE_PASS_MACHINERY_H_INCLUDED
22 changes: 11 additions & 11 deletions modules/compiler/source/base/source/base_module_pass_machinery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <base/base_pass_machinery.h>
#include <base/base_module_pass_machinery.h>
#include <base/bit_shift_fixup_pass.h>
#include <base/builtin_simplification_pass.h>
#include <base/check_for_doubles_pass.h>
Expand Down Expand Up @@ -103,7 +103,7 @@ void BaseModulePassMachinery::addClassToPassNames() {
#define CGSCC_PASS(NAME, CREATE_PASS) \
PIC.addClassToPassName(decltype(CREATE_PASS)::name(), NAME);

#include "base_pass_registry.def"
#include "base_module_pass_registry.def"
}

Expected<compiler::utils::AddKernelWrapperPassOptions>
Expand Down Expand Up @@ -428,7 +428,7 @@ void BaseModulePassMachinery::registerPasses() {
#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
getFAM().registerPass([&] { return CREATE_PASS; });

#include "base_pass_registry.def"
#include "base_module_pass_registry.def"
}

void BaseModulePassMachinery::registerPassCallbacks() {
Expand Down Expand Up @@ -545,7 +545,7 @@ void BaseModulePassMachinery::registerPassCallbacks() {
return true; \
}

#include "base_pass_registry.def"
#include "base_module_pass_registry.def"
return false;
});
TimePasses.registerCallbacks(PIC);
Expand All @@ -555,36 +555,36 @@ void BaseModulePassMachinery::printPassNames(raw_ostream &OS) {
OS << "Utility passes:\n\n";
OS << "Module passes:\n";
#define MODULE_PASS(NAME, CREATE_PASS) compiler::utils::printPassName(NAME, OS);
#include "base_pass_registry.def"
#include "base_module_pass_registry.def"

OS << "Module passes with params:\n";
#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
compiler::utils::printPassName(NAME, PARAMS, OS);
#include "base_pass_registry.def"
#include "base_module_pass_registry.def"

OS << "Module analyses:\n";
#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
compiler::utils::printPassName(NAME, OS);
#include "base_pass_registry.def"
#include "base_module_pass_registry.def"

OS << "Function analyses:\n";
#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
compiler::utils::printPassName(NAME, OS);
#include "base_pass_registry.def"
#include "base_module_pass_registry.def"

OS << "Function passes:\n";
#define FUNCTION_PASS(NAME, CREATE_PASS) \
compiler::utils::printPassName(NAME, OS);
#include "base_pass_registry.def"
#include "base_module_pass_registry.def"

OS << "Function passes with params:\n";
#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
compiler::utils::printPassName(NAME, PARAMS, OS);
#include "base_pass_registry.def"
#include "base_module_pass_registry.def"

OS << "CGSCC passes:\n";
#define CGSCC_PASS(NAME, CREATE_PASS) compiler::utils::printPassName(NAME, OS);
#include "base_pass_registry.def"
#include "base_module_pass_registry.def"
}

compiler::utils::DeviceInfo initDeviceInfoFromMux(
Expand Down
2 changes: 1 addition & 1 deletion modules/compiler/source/base/source/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <base/base_pass_machinery.h>
#include <base/base_module_pass_machinery.h>
#include <base/bit_shift_fixup_pass.h>
#include <base/builtin_simplification_pass.h>
#include <base/check_for_doubles_pass.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#ifndef HOST_PASSES_MACHINERY_H_INCLUDED
#define HOST_PASSES_MACHINERY_H_INCLUDED

#include <base/base_pass_machinery.h>
#include <base/base_module_pass_machinery.h>

#include <optional>

Expand Down
2 changes: 1 addition & 1 deletion modules/compiler/targets/host/source/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <base/base_pass_machinery.h>
#include <base/base_module_pass_machinery.h>
#include <compiler/utils/attributes.h>
#include <compiler/utils/cl_builtin_info.h>
#include <compiler/utils/encode_kernel_metadata_pass.h>
Expand Down
2 changes: 1 addition & 1 deletion modules/compiler/targets/host/source/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#ifndef NDEBUG
#include <llvm/IR/Verifier.h>
#endif
#include <base/base_pass_machinery.h>
#include <base/base_module_pass_machinery.h>
#include <cargo/argument_parser.h>
#include <cargo/small_vector.h>
#include <cargo/string_view.h>
Expand Down
2 changes: 1 addition & 1 deletion modules/compiler/test/group_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <base/base_pass_machinery.h>
#include <base/base_module_pass_machinery.h>
#include <compiler/utils/builtin_info.h>
#include <compiler/utils/cl_builtin_info.h>
#include <compiler/utils/lower_to_mux_builtins_pass.h>
Expand Down
2 changes: 1 addition & 1 deletion modules/compiler/tools/muxc/muxc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "muxc.h"

#include <base/base_pass_machinery.h>
#include <base/base_module_pass_machinery.h>
#include <base/module.h>
#include <clang/Frontend/CompilerInstance.h>
#include <compiler/library.h>
Expand Down
2 changes: 1 addition & 1 deletion modules/compiler/tools/muxc/muxc.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#ifndef COMPILER_TOOLS_MUXC_H_INCLUDED
#define COMPILER_TOOLS_MUXC_H_INCLUDED

#include <base/base_pass_machinery.h>
#include <base/base_module_pass_machinery.h>
#include <base/context.h>
#include <compiler/target.h>
#include <mux/mux.hpp>
Expand Down

0 comments on commit 461abfa

Please sign in to comment.