Skip to content

Commit

Permalink
Deduplicate llvm-hash value and move it under cmake folder
Browse files Browse the repository at this point in the history
In this PR we are deduplicating the llvm-hash value (currently it's
in the llvm-hash.txt file but also under python/setup.py. The new
location is cmake/llvm-hash.txt.

Both changes were suggested by jlebar in
#2570.
  • Loading branch information
karupayun committed Nov 23, 2023
1 parent 0629016 commit c0d530f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/llvm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- llvm-head
paths:
- llvm-hash.txt
- cmake/llvm-hash.txt
workflow_dispatch:

env:
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,12 @@ downloads a prebuilt LLVM, but you can also build LLVM from source and use that.
LLVM does not have a stable API, so the Triton build will not work at an
arbitrary LLVM version.

1. Find the version of LLVM that Triton builds against. Check `python/setup.py`
for a line like

rev = "b1115f8c"
1. Find the version of LLVM that Triton builds against. Check
`cmake/llvm-hash.txt` to see the current version. For example, if it says:
49af6502c6dcb4a7f7520178bd14df396f78240c

This means that the version of Triton you have builds against
[LLVM](https://github.com/llvm/llvm-project) b1115f8c.
[LLVM](https://github.com/llvm/llvm-project) 49af6502.

2. `git checkout` LLVM at this revision. Optionally, make additional
modifications to LLVM.
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ def get_llvm_package_info():
return Package("llvm", "LLVM-C.lib", "", "LLVM_INCLUDE_DIRS", "LLVM_LIBRARY_DIR", "LLVM_SYSPATH")
# use_assert_enabled_llvm = check_env_flag("TRITON_USE_ASSERT_ENABLED_LLVM", "False")
# release_suffix = "assert" if use_assert_enabled_llvm else "release"
rev = "506c47df"
llvm_hash_file = open("../cmake/llvm-hash.txt", "r")
rev = llvm_hash_file.read(8)
name = f"llvm-{rev}-{system_suffix}"
url = f"https://tritonlang.blob.core.windows.net/llvm-builds/{name}.tar.gz"
return Package("llvm", name, url, "LLVM_INCLUDE_DIRS", "LLVM_LIBRARY_DIR", "LLVM_SYSPATH")
Expand Down

0 comments on commit c0d530f

Please sign in to comment.