Skip to content

Commit

Permalink
Automate cherry-picked LLVM patches for HEIR
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 694586238
  • Loading branch information
j2kun authored and copybara-github committed Nov 8, 2024
1 parent 648e4b4 commit 8250cd2
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 1 deletion.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
Expand Down
9 changes: 9 additions & 0 deletions bazel/import_llvm.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ def import_llvm(name):
# this BUILD file is intentionally empty, because the LLVM project
# internally contains a set of bazel BUILD files overlaying the project.
build_file_content = "# empty",
patches = [
# This patch file contains changes that are fixed in upstream LLVM
# that are (usually) required to build HEIR, but are not included
# as of the LLVM_COMMIT hash above (the fixes are still progressing
# through the automated integration process). The patch file is
# automatically generated, and should not be removed even if empty.
"@heir//patches:llvm.patch",
],
patch_args = ["-p1"],
commit = LLVM_COMMIT,
init_submodules = False,
remote = "https://github.com/llvm/llvm-project.git",
Expand Down
4 changes: 4 additions & 0 deletions patches/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package(
default_applicable_licenses = ["@heir//:license"],
default_visibility = ["//visibility:public"],
)
65 changes: 65 additions & 0 deletions patches/llvm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
Auto generated patch. Do not edit or delete it, even if empty.
diff -ruN --strip-trailing-cr a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
--- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
@@ -2337,6 +2337,7 @@
srcs = ["include/mlir/Dialect/AMX/AMX.td"],
includes = ["include"],
deps = [
+ ":BuiltinDialectTdFiles",
":LLVMOpsTdFiles",
":SideEffectInterfacesTdFiles",
],
@@ -2360,6 +2361,20 @@
"include/mlir/Dialect/AMX/AMXDialect.cpp.inc",
),
(
+ [
+ "-gen-typedef-decls",
+ "-typedefs-dialect=amx",
+ ],
+ "include/mlir/Dialect/AMX/AMXTypes.h.inc",
+ ),
+ (
+ [
+ "-gen-typedef-defs",
+ "-typedefs-dialect=amx",
+ ],
+ "include/mlir/Dialect/AMX/AMXTypes.cpp.inc",
+ ),
+ (
["-gen-op-decls"],
"include/mlir/Dialect/AMX/AMX.h.inc",
),
@@ -2388,6 +2403,7 @@
":IR",
":LLVMDialect",
":SideEffectInterfaces",
+ "//llvm:Support",
],
)

@@ -2398,6 +2414,7 @@
includes = ["include"],
deps = [
":AMXDialect",
+ ":ConvertToLLVMInterface",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
@@ -4858,6 +4875,7 @@
deps = [
":AffineTransformOps",
":ArithToLLVM",
+ ":AMXTransforms",
":BufferizationTransformOps",
":BuiltinToLLVMIRTranslation",
":ComplexToLLVM",
@@ -5965,6 +5983,7 @@
deps = [
":ArithDialect",
":ConversionPassIncGen",
+ ":DialectUtils",
":IR",
":Pass",
":SPIRVConversion",

0 comments on commit 8250cd2

Please sign in to comment.