[llvm] [mlir][bazel] Export headers either from :Transforms or :TransformUtils (PR #86819)

Jordan Rupprecht via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 27 09:37:20 PDT 2024


================
@@ -7510,18 +7541,23 @@ cc_library(
 cc_library(
     name = "TransformUtils",
     srcs = glob(
-        include = [
-            "lib/Transforms/Utils/*.cpp",
-        ],
+        include = ["lib/Transforms/Utils/*.cpp"],
         exclude = ["lib/Transforms/Utils/InliningUtils.cpp"],
-    ),
-    hdrs = glob(
-        include = ["include/mlir/Transforms/*.h"],
-        exclude = [
-            "include/mlir/Transforms/InliningUtils.h",
-            "include/mlir/Transforms/Passes.h",
-        ],
-    ),
+    ) + [
+    ],
+    hdrs = [
+        "include/mlir/Transforms/CFGToSCF.h",
+        "include/mlir/Transforms/CommutativityUtils.h",
+        "include/mlir/Transforms/ControlFlowSinkUtils.h",
+        "include/mlir/Transforms/DialectConversion.h",
+        "include/mlir/Transforms/FoldUtils.h",
+        "include/mlir/Transforms/GreedyPatternRewriteDriver.h",
+        "include/mlir/Transforms/Inliner.h",
+        "include/mlir/Transforms/LoopInvariantCodeMotionUtils.h",
+        "include/mlir/Transforms/OneToNTypeConversion.h",
+        "include/mlir/Transforms/RegionUtils.h",
+        "include/mlir/Transforms/TopologicalSortUtils.h",
+    ],
----------------
rupprecht wrote:

If the .cpp files are in lib/Transforms/Utils, why are the corresponding headers in include/mlir/Transforms, and not include/mlir/Transforms/Utils? Ideally you could have this be `glob(["include/mlir/Transforms/Utils/*.cpp"])` to match the srcs `glob(["lib/Transforms/Utils/*.cpp"])`.

Is it feasible to move those files? How big of a change would that be?

https://github.com/llvm/llvm-project/pull/86819


More information about the llvm-commits mailing list