Skip to content

Commit eb475e2

Browse files
skatrakyuxuanchen1997
authored andcommitted
[MLIR][OpenMP] Keep -verify-openmp-ops output as dependency (#99638)
Summary: Currently, the `mlir-tblgen -verify-openmp-ops` pseudo-backend, which only performs an OpenMP dialect-specific set of checks and produces no output, is prevented from being added as a dependency to the `MLIROpenMPOpsIncGen` tablegen target. However, a consequence of this is that it is not triggered with every modification of the OpenMPOps.td file it's intended to check, although it should. This patch fixes the issue by letting the empty output file to be added to the `TABLEGEN_OUTPUT` CMake variable used by the `add_public_tablegen_target` command below to set up dependencies. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250680
1 parent 1fb7815 commit eb475e2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

mlir/include/mlir/Dialect/OpenMP/CMakeLists.txt

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ add_public_tablegen_target(omp_common_td)
44

55
set(LLVM_TARGET_DEFINITIONS OpenMPOps.td)
66

7-
# Run the OpenMP verifier tablegen pseudo-backend while preventing the produced
8-
# dummy output from being added as a dependency to any tablegen targets defined
9-
# below.
10-
set(TABLEGEN_OUTPUT_TMP ${TABLEGEN_OUTPUT})
7+
# The OpenMP verifier tablegen pseudo-backend does not produce any output, but
8+
# mlir_tablegen expects an output file name to be passed. An empty "no-output"
9+
# file is created by the statement below.
10+
#
11+
# This output will be added to the list of dependencies of the
12+
# MLIROpenMPOpsIncGen target below, which results in triggering this
13+
# verification pass every time OpenMPOps.td is modified and recompiled.
1114
mlir_tablegen(no-output -verify-openmp-ops)
12-
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/no-output ${CMAKE_CURRENT_BINARY_DIR}/no-output.d)
13-
set(TABLEGEN_OUTPUT ${TABLEGEN_OUTPUT_TMP})
14-
unset(TABLEGEN_OUTPUT_TMP)
1515

1616
mlir_tablegen(OpenMPOpsDialect.h.inc -gen-dialect-decls -dialect=omp)
1717
mlir_tablegen(OpenMPOpsDialect.cpp.inc -gen-dialect-defs -dialect=omp)

0 commit comments

Comments
 (0)