[llvm] [bazel] Port 3aa20c266c97a638c63b5368d89fe25757885178 (PR #132774)

Jordan Rupprecht via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 24 09:38:43 PDT 2025


https://github.com/rupprecht created https://github.com/llvm/llvm-project/pull/132774

None

>From 68935d93a055df7b591be3d325d0615cc4f50295 Mon Sep 17 00:00:00 2001
From: Jordan Rupprecht <rupprecht at google.com>
Date: Mon, 24 Mar 2025 09:36:14 -0700
Subject: [PATCH] [bazel] Port 3aa20c266c97a638c63b5368d89fe25757885178

---
 .../llvm-project-overlay/mlir/BUILD.bazel     | 31 +++++++++++++++++--
 1 file changed, 28 insertions(+), 3 deletions(-)

diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
index 7b12b5d43cc22..64e8fba9168c0 100644
--- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
@@ -7241,8 +7241,8 @@ td_library(
         "include/mlir/Dialect/Ptr/IR/MemorySpaceInterfaces.td",
         "include/mlir/Dialect/Ptr/IR/PtrAttrDefs.td",
         "include/mlir/Dialect/Ptr/IR/PtrDialect.td",
-        "include/mlir/Dialect/Ptr/IR/PtrOps.td",
         "include/mlir/Dialect/Ptr/IR/PtrEnums.td",
+        "include/mlir/Dialect/Ptr/IR/PtrOps.td",
     ],
     includes = ["include"],
     deps = [
@@ -7391,7 +7391,12 @@ cc_library(
 
 td_library(
     name = "SPIRVOpsTdFiles",
-    srcs = glob(["include/mlir/Dialect/SPIRV/IR/*.td"]),
+    srcs = glob(["include/mlir/Dialect/SPIRV/IR/*.td"]) + [
+        # TODO: resolve circular dep, e.g.
+        # * SPIRVImageInterfaces.td uses SPIRVBase.td
+        # * SPIRVOps.h uses SPIRVImageInterfaces.h
+        "include/mlir/Dialect/SPIRV/Interfaces/SPIRVImageInterfaces.td",
+    ],
     includes = ["include"],
     deps = [
         ":BuiltinDialectTdFiles",
@@ -7531,14 +7536,33 @@ gentbl_cc_library(
     deps = [":SPIRVOpsTdFiles"],
 )
 
+gentbl_cc_library(
+    name = "SPIRVImageInterfacesIncGen",
+    tbl_outs = [
+        (
+            ["-gen-op-interface-decls"],
+            "include/mlir/Dialect/SPIRV/Interfaces/SPIRVImageInterfaces.h.inc",
+        ),
+        (
+            ["-gen-op-interface-defs"],
+            "include/mlir/Dialect/SPIRV/Interfaces/SPIRVImageInterfaces.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/SPIRV/Interfaces/SPIRVImageInterfaces.td",
+    deps = [":SPIRVOpsTdFiles"],
+)
+
 cc_library(
     name = "SPIRVDialect",
     srcs = glob([
         "lib/Dialect/SPIRV/IR/*.cpp",
         "lib/Dialect/SPIRV/IR/*.h",
+        "lib/Dialect/SPIRV/Interfaces/*.cpp",
     ]),
     hdrs = glob([
         "include/mlir/Dialect/SPIRV/IR/*.h",
+        "include/mlir/Dialect/SPIRV/Interfaces/*.h",
     ]),
     includes = ["include"],
     deps = [
@@ -7556,6 +7580,7 @@ cc_library(
         ":SPIRVAttributesIncGen",
         ":SPIRVAvailabilityIncGen",
         ":SPIRVCanonicalizationIncGen",
+        ":SPIRVImageInterfacesIncGen",
         ":SPIRVOpsIncGen",
         ":SideEffectInterfaces",
         ":Support",
@@ -11088,8 +11113,8 @@ gentbl_cc_library(
     tblgen = ":mlir-tblgen",
     td_file = "include/mlir/Dialect/Quant/IR/QuantDialectBytecode.td",
     deps = [
-        ":BytecodeTdFiles",
         ":BuiltinDialectBytecodeTdFiles",
+        ":BytecodeTdFiles",
     ],
 )
 



More information about the llvm-commits mailing list