Skip to content

Commit b3cc380

Browse files
[mlir][opt] Expose MLIR_ENABLE_DEPRECATED_GPU_SER... in mlir-config.h.
This is another follow-up of llvm#83004, which made the same change for `MLIR_CUDA_CONVERSIONS_ENABLED`. As the previous PR, this PR commit exposes mentioned CMake variable through `mlir-config.h` and uses the macro that is introduced with the same name. This replaces the macro `MLIR_ENABLE_DEPRECATED_GPU_SERIALIZATION`, which the CMake files previously defined manually.
1 parent ff66e9b commit b3cc380

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

mlir/include/mlir/Config/mlir-config.h.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,7 @@
3333
and targets. */
3434
#cmakedefine01 MLIR_ENABLE_CUDA_CONVERSIONS
3535

36+
/* If set, enable deprecated serialization passes. */
37+
#cmakedefine01 MLIR_DEPRECATED_GPU_SERIALIZATION_ENABLE
38+
3639
#endif

mlir/tools/mlir-opt/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,3 @@ llvm_update_compile_flags(mlir-opt)
106106

107107
mlir_check_all_link_libraries(mlir-opt)
108108
export_executable_symbols_for_plugins(mlir-opt)
109-
110-
if(MLIR_ENABLE_DEPRECATED_GPU_SERIALIZATION)
111-
# Enable deprecated serialization passes.
112-
target_compile_definitions(mlir-opt
113-
PRIVATE
114-
MLIR_DEPRECATED_GPU_SERIALIZATION_ENABLE=1
115-
)
116-
endif()

mlir/tools/mlir-opt/mlir-opt.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
#include "mlir/Config/mlir-config.h"
1314
#include "mlir/IR/AsmState.h"
1415
#include "mlir/IR/Dialect.h"
1516
#include "mlir/IR/MLIRContext.h"
@@ -277,7 +278,7 @@ void registerTestPasses() {
277278

278279
int main(int argc, char **argv) {
279280
registerAllPasses();
280-
#if MLIR_DEPRECATED_GPU_SERIALIZATION_ENABLE == 1
281+
#if MLIR_DEPRECATED_GPU_SERIALIZATION_ENABLE
281282
registerGpuSerializeToCubinPass();
282283
registerGpuSerializeToHsacoPass();
283284
#endif

utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ expand_template(
3535
"#cmakedefine01 MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS": "#define MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS 0",
3636
"#cmakedefine MLIR_GREEDY_REWRITE_RANDOMIZER_SEED ${MLIR_GREEDY_REWRITE_RANDOMIZER_SEED}": "/* #undef MLIR_GREEDY_REWRITE_RANDOMIZER_SEED */",
3737
"#cmakedefine01 MLIR_ENABLE_PDL_IN_PATTERNMATCH": "#define MLIR_ENABLE_PDL_IN_PATTERNMATCH 1",
38+
"#cmakedefine01 MLIR_DEPRECATED_GPU_SERIALIZATION_ENABLE": "#define MLIR_DEPRECATED_GPU_SERIALIZATION_ENABLE 0",
3839
} | if_cuda_available(
3940
{"#cmakedefine01 MLIR_ENABLE_CUDA_CONVERSIONS": "#define MLIR_ENABLE_CUDA_CONVERSIONS 1"},
4041
{"#cmakedefine01 MLIR_ENABLE_CUDA_CONVERSIONS": "#define MLIR_ENABLE_CUDA_CONVERSIONS 0"},
@@ -9170,6 +9171,7 @@ cc_binary(
91709171
":SCFToGPU",
91719172
":Support",
91729173
":Transforms",
9174+
":config",
91739175
"//llvm:AllTargetsCodeGens",
91749176
"//llvm:Support",
91759177
"//mlir/test:TestAffine",

0 commit comments

Comments
 (0)