Skip to content

Commit

Permalink
🚀 Bump ROCm LLVM and LLVM (#230)
Browse files Browse the repository at this point in the history
This brings us into the range of ~last month. It turned out that the
regular ROCm 6.1.0 release wasn't properly compatible with recent LLVM,
so we're now using the upstream development branch. This brings comgr
and the device libs into a state after 6.1.0.
  • Loading branch information
aaronmondal authored Apr 29, 2024
1 parent c5e503f commit ccab78c
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 85 deletions.
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ llvm_project_overlay = use_extension(
"llvm_project_overlay",
)
llvm_project_overlay.configure(
commit = "7378fb30645ad5398491acea3960a8115d1b171c",
commit = "630289f77d67703673928ae38d3e5ba900e9ff62",
patches = [
"@rules_ll//patches:mallinfo2_patch.diff",
"@rules_ll//patches:rules_ll_overlay_patch.diff",
"@rules_ll//patches:llvm-project-fix-zlib-includes.diff",
],
sha256 = "8b6a6edc4d651e280ac2e52cb693df1ab13739e2ba38076fb7cd5be1d5623b50",
sha256 = "7b45e1fddb1afd47afec170b481c9a12e0008d232863243cce9421b80b5ade00",
targets = [
"AMDGPU",
"NVPTX",
Expand Down
2 changes: 0 additions & 2 deletions ll/args.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,6 @@ def link_executable_args(ctx, in_files, out_file, mode):
args.add("--host-triple=x86_64-pc-linux-gnu")
args.add("--linker-path={}".format(toolchain.linker.path))

args.add("--")

args.add("--color-diagnostics")

# Encapsulation.
Expand Down
17 changes: 6 additions & 11 deletions ll/init.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,17 @@ def _initialize_rules_ll_impl(_):
patch_args = ["-p1"],
)

# This commit needs further treatment. It changes the default code object
# version from 4 to 5 which appears to cause segfaults.
# clr_commit = "2eab055436e4ccda8b52ad801bfaa44adfda885c"

http_archive(
name = "clr",
build_file = "@rules_ll//third-party-overlays:clr.BUILD.bazel",
strip_prefix = "clr-8c8c00f64c4fa860f75b713d338edd364229326f",
integrity = "sha256-+7BpjDZqUrjZONoqaesYF6UvOvcj+H7iWMKlH5OIwec=",
strip_prefix = "clr-5914ac3c6e9b3848023a7fa25e19e560b1c38541",
integrity = "sha256-CK28uzu4HwjXWX9moxr+fN9py2dxEcaSyn8O5mKTsQk=",
urls = [
"https://github.com/ROCm/clr/archive/8c8c00f64c4fa860f75b713d338edd364229326f.zip",
"https://github.com/ROCm/clr/archive/5914ac3c6e9b3848023a7fa25e19e560b1c38541.zip",
],
patches = [
"@rules_ll//patches:hipamd_deprecate_fix.diff",
"@rules_ll//patches:hipamd_correct_jit_option.diff",
"@rules_ll//patches:hipamd_inconsistent_overrides.diff",
"@rules_ll//patches:hipamd_fix_extraneous_parentheses.diff",
"@rules_ll//patches:hipamd_enforce_semicolon.diff",
"@rules_ll//patches:hipamd_fix_local_address_space.diff",
Expand All @@ -110,10 +105,10 @@ def _initialize_rules_ll_impl(_):
http_archive(
name = "llvm-project-rocm",
build_file = "@rules_ll//third-party-overlays:llvm-project-rocm.BUILD.bazel",
integrity = "sha256-wPNx2by33XA4kDw2xUADzI9xpTqqGukH7qhZG9BbYUU=",
strip_prefix = "llvm-project-e80d300ecf0c235948345e81264af62adb479f02",
strip_prefix = "llvm-project-91c18ff3482abdf90239e9b482797403f6e7e9bc",
integrity = "sha256-U5bqkNfuXHa0s+bc6cq9caAIFgHoyLFz6i0tBXgmTSw=",
urls = [
"https://github.com/ROCm/llvm-project/archive/e80d300ecf0c235948345e81264af62adb479f02.zip",
"https://github.com/ROCm/llvm-project/archive/91c18ff3482abdf90239e9b482797403f6e7e9bc.zip",
],
patches = [
"@rules_ll//patches:comgr_bc2h.diff",
Expand Down
1 change: 1 addition & 0 deletions ll/llvm_project_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ LLVM_PROJECT_DEPS = [
"@llvm-project//clang:frontend_rewrite",
"@llvm-project//clang:frontend_tool",
"@llvm-project//clang:index",
"@llvm-project//clang:install_api",
"@llvm-project//clang:interpreter",
"@llvm-project//clang:lex",
"@llvm-project//clang:libclang",
Expand Down
10 changes: 0 additions & 10 deletions llvm-project-overlay/libcxx/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,6 @@ expand_template(
template = "modules/std.cppm.in",
)

expand_template(
name = "module_modulemap_gen",
out = "include/module.modulemap",
substitutions = {
"@requires_LIBCXX_ENABLE_LOCALIZATION@": "",
},
template = "include/module.modulemap.in",
)

NO = "/* Undefined by Bazel. */"

expand_template(
Expand Down Expand Up @@ -202,7 +193,6 @@ filegroup(
]) + [
":__assertion_handler_gen",
":__config_site_gen",
":module_modulemap_gen",
],
visibility = ["//visibility:public"],
)
Expand Down
44 changes: 0 additions & 44 deletions patches/hipamd_inconsistent_overrides.diff

This file was deleted.

22 changes: 6 additions & 16 deletions patches/rules_ll_overlay_patch.diff
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel
index 573549781ab7..3025cde923f6 100644
index 9bdd454e1e36..a266477922b0 100644
--- a/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel
@@ -49,3 +49,1209 @@ cc_library(
@@ -50,3 +50,1209 @@ cc_library(
":config",
],
linkstatic = True,
)
+load("@rules_ll//ll:defs.bzl", "ll_library")
+
Expand Down Expand Up @@ -1214,12 +1214,12 @@ index 573549781ab7..3025cde923f6 100644
+)
diff --git a/utils/bazel/llvm-project-overlay/libcxx/BUILD.bazel b/utils/bazel/llvm-project-overlay/libcxx/BUILD.bazel
new file mode 100644
index 000000000000..f68af0f8d0f0
index 000000000000..10e3e555105c
--- /dev/null
+++ b/utils/bazel/llvm-project-overlay/libcxx/BUILD.bazel
@@ -0,0 +1,368 @@
+load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
@@ -0,0 +1,358 @@
+load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
+load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
+load("@rules_ll//ll:defs.bzl", "ll_library")
+
+STD_PARTITIONS = [
Expand Down Expand Up @@ -1363,15 +1363,6 @@ index 000000000000..f68af0f8d0f0
+ template = "modules/std.cppm.in",
+)
+
+expand_template(
+ name = "module_modulemap_gen",
+ out = "include/module.modulemap",
+ substitutions = {
+ "@requires_LIBCXX_ENABLE_LOCALIZATION@": "",
+ },
+ template = "include/module.modulemap.in",
+)
+
+NO = "/* Undefined by Bazel. */"
+
+expand_template(
Expand Down Expand Up @@ -1422,7 +1413,6 @@ index 000000000000..f68af0f8d0f0
+ ]) + [
+ ":__assertion_handler_gen",
+ ":__config_site_gen",
+ ":module_modulemap_gen",
+ ],
+ visibility = ["//visibility:public"],
+)
Expand Down
19 changes: 19 additions & 0 deletions third-party-overlays/llvm-project-rocm.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ cc_binary(
AMD_DEVICE_LIBS_TARGETS = [
"oclc_abi_version_400",
"oclc_abi_version_500",
"oclc_abi_version_600",
"oclc_correctly_rounded_sqrt_off",
"oclc_correctly_rounded_sqrt_on",
"oclc_daz_opt_off",
Expand All @@ -56,6 +57,10 @@ AMD_DEVICE_LIBS_TARGETS = [
"oclc_isa_version_1101",
"oclc_isa_version_1102",
"oclc_isa_version_1103",
"oclc_isa_version_1150",
"oclc_isa_version_1151",
"oclc_isa_version_1200",
"oclc_isa_version_1201",
"oclc_isa_version_600",
"oclc_isa_version_601",
"oclc_isa_version_602",
Expand All @@ -79,10 +84,16 @@ AMD_DEVICE_LIBS_TARGETS = [
"oclc_isa_version_90a",
"oclc_isa_version_90c",
"oclc_isa_version_940",
"oclc_isa_version_941",
"oclc_isa_version_942",
"oclc_unsafe_math_off",
"oclc_unsafe_math_on",
"oclc_wavefrontsize64_off",
"oclc_wavefrontsize64_on",
"oclc_isa_version_10_1_generic",
"oclc_isa_version_10_3_generic",
"oclc_isa_version_11_generic",
"oclc_isa_version_9_generic",
"ocml",
"ockl",
"opencl",
Expand All @@ -101,6 +112,7 @@ for f in $(SRCS)
do
base=$$(basename $$f)
without_extension=$${base%.*}
without_extension=$$(echo $$without_extension | tr '-' '_')
$(location :bc2h) $$f $(RULEDIR)/amd/comgr/internal/$${without_extension}.inc "$${without_extension}_lib"
done
""",
Expand Down Expand Up @@ -277,6 +289,7 @@ ll_binary(
OCLC_NAMES = [
"abi_version_400",
"abi_version_500",
"abi_version_600",
"correctly_rounded_sqrt_off",
"correctly_rounded_sqrt_on",
"daz_opt_off",
Expand All @@ -300,6 +313,8 @@ OCLC_NAMES = [
"isa_version_1103",
"isa_version_1150",
"isa_version_1151",
"isa_version_1200",
"isa_version_1201",
"isa_version_600",
"isa_version_601",
"isa_version_602",
Expand All @@ -325,6 +340,10 @@ OCLC_NAMES = [
"isa_version_940",
"isa_version_941",
"isa_version_942",
"isa_version_10-1-generic",
"isa_version_10-3-generic",
"isa_version_11-generic",
"isa_version_9-generic",
"unsafe_math_off",
"unsafe_math_on",
"wavefrontsize64_off",
Expand Down

0 comments on commit ccab78c

Please sign in to comment.