Skip to content

Commit 496bb09

Browse files
committed
chore: llvm old
2 parents ea38d2a + 0cb2374 commit 496bb09

File tree

771 files changed

+42367
-14874
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

771 files changed

+42367
-14874
lines changed

.github/bin/uploadReleaseArtifacts.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,12 @@ mapfile -t OPT_OS < <(echo "${OPT_OS[@]}" | tr ' ' '\n' | sort -u)
134134
# For non-full installs, install the following tools.
135135
binaries=(
136136
circt-opt
137+
circt-reduce
137138
circt-synth
138139
circt-test
140+
circt-translate
141+
circt-verilog
142+
domaintool
139143
firtool
140144
om-linker
141145
)
@@ -173,7 +177,7 @@ EOF
173177
configMacOsRunner=$(cat <<EOF
174178
[
175179
{
176-
"runner": "macos-13",
180+
"runner": "macos-15-intel",
177181
"cmake_c_compiler": "clang",
178182
"cmake_cxx_compiler": "clang++"
179183
}

.github/copilot-instructions.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copilot build & test guidance
2+
3+
- Default to the integration docker image in `CIRCT_INTEGRATION_IMAGE` (set by the Copilot setup workflow and the `utils/run-docker.sh` default; currently `ghcr.io/circt/images/circt-integration-test:v19.2`) when compiling or testing.
4+
- Run inside that image via `./utils/run-docker.sh ./utils/run-tests-docker.sh "$CIRCT_INTEGRATION_IMAGE"` or `docker run` with the repo root bind-mounted.
5+
- When cloning or checking out, ensure submodules are present (`git submodule update --init --recursive` if needed).
6+
- Configure builds from the repo root with Ninja, matching the README:
7+
```
8+
cmake -G Ninja llvm/llvm -B build \
9+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
10+
-DLLVM_ENABLE_ASSERTIONS=ON \
11+
-DLLVM_TARGETS_TO_BUILD=host \
12+
-DLLVM_ENABLE_PROJECTS=mlir \
13+
-DLLVM_EXTERNAL_PROJECTS=circt \
14+
-DLLVM_EXTERNAL_CIRCT_SOURCE_DIR=$PWD \
15+
-DLLVM_ENABLE_LLD=ON
16+
```
17+
- Build everything with `ninja -C build check-circt`; use `ninja -C build bin/circt-opt` or `ninja -C build bin/firtool` for tool-only builds.
18+
- Keep Python bindings enabled when needed via `-DMLIR_ENABLE_BINDINGS_PYTHON=ON -DCIRCT_BINDINGS_PYTHON_ENABLED=ON`.
19+
- For PyCDE and the ESI runtime, add `-DCIRCT_ENABLE_FRONTENDS=PyCDE -DESI_RUNTIME=ON` (keep Python bindings on). Test with `ninja -C build check-pycde` (PyCDE only) and `ninja -C build check-pycde-integration` (these integration tests exercise both PyCDE and the ESI runtime and are the only ESIRuntime tests).
20+
- Prefer the integration image and the setup steps workflow for reliable dependencies; only fall back to host builds when explicitly requested.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Copilot setup steps
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- .github/workflows/copilot-setup-steps.yml
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
copilot-setup-steps:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Pre-pull integration docker image
17+
env:
18+
CIRCT_INTEGRATION_IMAGE: ghcr.io/circt/images/circt-integration-test:v19.2
19+
run: |
20+
echo "CIRCT_INTEGRATION_IMAGE=$CIRCT_INTEGRATION_IMAGE" >> $GITHUB_ENV
21+
docker pull "$CIRCT_INTEGRATION_IMAGE"
22+
- name: Summarize defaults
23+
run: |
24+
{
25+
echo "### CIRCT Copilot setup"
26+
echo "- Integration image: $CIRCT_INTEGRATION_IMAGE"
27+
echo "- Default build directory: build"
28+
} >> "$GITHUB_STEP_SUMMARY"

.github/workflows/esiRuntimePublish.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
config:
20-
- os: ubuntu-24.04
21-
cibw_build: cp38-manylinux_x86_64
2220
- os: ubuntu-24.04
2321
cibw_build: cp39-manylinux_x86_64
2422
- os: ubuntu-24.04
@@ -29,8 +27,8 @@ jobs:
2927
cibw_build: cp312-manylinux_x86_64
3028
- os: ubuntu-24.04
3129
cibw_build: cp313-manylinux_x86_64
32-
- os: windows-2022
33-
cibw_build: cp38-win_amd64
30+
- os: ubuntu-24.04
31+
cibw_build: cp314-manylinux_x86_64
3432
- os: windows-2022
3533
cibw_build: cp39-win_amd64
3634
- os: windows-2022
@@ -41,6 +39,8 @@ jobs:
4139
cibw_build: cp312-win_amd64
4240
- os: windows-2022
4341
cibw_build: cp313-win_amd64
42+
- os: windows-2022
43+
cibw_build: cp314-win_amd64
4444

4545
steps:
4646
- name: Get CIRCT
@@ -68,7 +68,7 @@ jobs:
6868
& "${env:VCPKG_INSTALLATION_ROOT}/vcpkg" --triplet x64-windows install zlib grpc
6969
7070
- name: Install cibuildwheel
71-
run: python -m pip install cibuildwheel==2.23.3
71+
run: python -m pip install cibuildwheel==3.3.0
7272

7373
- name: Build wheels
7474
if: runner.os != 'Windows'

.github/workflows/nightlyIntegrationTests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
# John and re-run the job.
2020
runs-on: ["self-hosted", "1ES.Pool=1ES-CIRCT-builds", "linux"]
2121
container:
22-
image: ghcr.io/circt/images/circt-integration-test:v19
22+
image: ghcr.io/circt/images/circt-integration-test:v19.2
2323
volumes:
2424
- /mnt:/__w/circt
2525
strategy:

.github/workflows/shortIntegrationTests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
outputs:
3232
cache-key-pattern: ${{ steps.cache-key.outputs.pattern }}
3333
container:
34-
image: ghcr.io/circt/images/circt-integration-test:v19
34+
image: ghcr.io/circt/images/circt-integration-test:v19.2
3535
volumes:
3636
- /mnt:/__w/circt
3737
strategy:

.github/workflows/unifiedBuildTestAndInstall.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ jobs:
208208
${{ steps.setup-windows.outputs.setup }}
209209
mkdir build
210210
cd build
211-
cmake -G Ninja -S "$(pwd)/../llvm/llvm" $EXTRA_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${{ inputs.cmake_build_type }} -DBUILD_SHARED_LIBS=${{ inputs.build_shared_libs }} -DLLVM_BUILD_TOOLS=ON -DLLVM_BUILD_EXAMPLES=OFF -DLLVM_ENABLE_ASSERTIONS=${{ inputs.llvm_enable_assertions }} -DLLVM_ENABLE_PROJECTS=mlir -DLLVM_EXTERNAL_PROJECTS=circt -DLLVM_EXTERNAL_CIRCT_SOURCE_DIR=".." -DLLVM_STATIC_LINK_CXX_STDLIB=ON -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_TARGETS_TO_BUILD="host" -DLLVM_FORCE_ENABLE_STATS=${{ inputs.llvm_force_enable_stats }} -DLLVM_ENABLE_ZSTD=OFF -DVERILATOR_DISABLE=ON -DCIRCT_RELEASE_TAG_ENABLED=ON -DCIRCT_RELEASE_TAG=firtool -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF -DCMAKE_C_COMPILER=${{ inputs.cmake_c_compiler }} -DCMAKE_CXX_COMPILER=${{ inputs.cmake_cxx_compiler }} ${{ steps.configure-sccache.outputs.enable_sccache }} -DCMAKE_INSTALL_PREFIX="$(pwd)/../install" -DLLVM_INSTALL_UTILS=ON
211+
cmake -G Ninja -S "$(pwd)/../llvm/llvm" $EXTRA_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${{ inputs.cmake_build_type }} -DBUILD_SHARED_LIBS=${{ inputs.build_shared_libs }} -DLLVM_BUILD_TOOLS=ON -DLLVM_BUILD_EXAMPLES=OFF -DLLVM_ENABLE_ASSERTIONS=${{ inputs.llvm_enable_assertions }} -DLLVM_ENABLE_PROJECTS=mlir -DLLVM_EXTERNAL_PROJECTS=circt -DLLVM_EXTERNAL_CIRCT_SOURCE_DIR=".." -DLLVM_STATIC_LINK_CXX_STDLIB=ON -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_TARGETS_TO_BUILD="host" -DLLVM_FORCE_ENABLE_STATS=${{ inputs.llvm_force_enable_stats }} -DLLVM_ENABLE_ZSTD=OFF -DVERILATOR_DISABLE=ON -DCIRCT_RELEASE_TAG_ENABLED=ON -DCIRCT_RELEASE_TAG=firtool -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF -DCMAKE_C_COMPILER=${{ inputs.cmake_c_compiler }} -DCMAKE_CXX_COMPILER=${{ inputs.cmake_cxx_compiler }} ${{ steps.configure-sccache.outputs.enable_sccache }} -DCMAKE_INSTALL_PREFIX="$(pwd)/../install" -DLLVM_INSTALL_UTILS=ON -DCIRCT_SLANG_FRONTEND_ENABLED=ON
212212
# Optionally test
213213
- name: Test CIRCT
214214
if: inputs.run_tests

.github/workflows/unifiedBuildTestAndInstallStatic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ jobs:
129129
run: |
130130
mkdir -p build
131131
cd build
132-
cmake -G Ninja -S "$(pwd)/../llvm/llvm" $EXTRA_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${{ inputs.cmake_build_type }} -DLLVM_BUILD_TOOLS=ON -DLLVM_BUILD_EXAMPLES=OFF -DLLVM_ENABLE_ASSERTIONS=${{ inputs.llvm_enable_assertions }} -DLLVM_ENABLE_PROJECTS=mlir -DLLVM_EXTERNAL_PROJECTS=circt -DLLVM_EXTERNAL_CIRCT_SOURCE_DIR=".." -DLLVM_STATIC_LINK_CXX_STDLIB=ON -DLLVM_BUILD_STATIC=ON -DLLVM_LINK_LLVM_DYLIB=OFF -DLLVM_ENABLE_PIC=OFF -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_TARGETS_TO_BUILD="host" -DLLVM_FORCE_ENABLE_STATS=${{ inputs.llvm_force_enable_stats }} -DLLVM_ENABLE_ZSTD=OFF -DVERILATOR_DISABLE=ON -DCIRCT_RELEASE_TAG_ENABLED=ON -DCIRCT_RELEASE_TAG=firtool -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF -DCMAKE_C_COMPILER=clang-19 -DCMAKE_CXX_COMPILER=clang++-19 ${{ steps.configure-sccache.outputs.enable_sccache }} -DCMAKE_INSTALL_PREFIX="$(pwd)/../install" -DLLVM_INSTALL_UTILS=ON -DCMAKE_EXE_LINKER_FLAGS_INIT="-Wl,-z,stack-size=8388608 -Wl,--whole-archive $(pwd)/../build/mimalloc/build/libmimalloc.a -Wl,--no-whole-archive"
132+
cmake -G Ninja -S "$(pwd)/../llvm/llvm" $EXTRA_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${{ inputs.cmake_build_type }} -DLLVM_BUILD_TOOLS=ON -DLLVM_BUILD_EXAMPLES=OFF -DLLVM_ENABLE_ASSERTIONS=${{ inputs.llvm_enable_assertions }} -DLLVM_ENABLE_PROJECTS=mlir -DLLVM_EXTERNAL_PROJECTS=circt -DLLVM_EXTERNAL_CIRCT_SOURCE_DIR=".." -DLLVM_STATIC_LINK_CXX_STDLIB=ON -DLLVM_BUILD_STATIC=ON -DLLVM_LINK_LLVM_DYLIB=OFF -DLLVM_ENABLE_PIC=OFF -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_TARGETS_TO_BUILD="host" -DLLVM_FORCE_ENABLE_STATS=${{ inputs.llvm_force_enable_stats }} -DLLVM_ENABLE_ZSTD=OFF -DVERILATOR_DISABLE=ON -DCIRCT_RELEASE_TAG_ENABLED=ON -DCIRCT_RELEASE_TAG=firtool -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF -DCMAKE_C_COMPILER=clang-19 -DCMAKE_CXX_COMPILER=clang++-19 ${{ steps.configure-sccache.outputs.enable_sccache }} -DCMAKE_INSTALL_PREFIX="$(pwd)/../install" -DLLVM_INSTALL_UTILS=ON -DCIRCT_SLANG_FRONTEND_ENABLED=ON -DCMAKE_EXE_LINKER_FLAGS_INIT="-Wl,-z,stack-size=8388608 -Wl,--whole-archive $(pwd)/../build/mimalloc/build/libmimalloc.a -Wl,--no-whole-archive"
133133
# Optionally test
134134
- name: Test CIRCT
135135
if: inputs.run_tests

CMakeLists.txt

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
3838
# MSVC-specific compiler configuration
3939
if (MSVC)
4040
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHs-c- /GR-")
41-
# Enable UTF-8 support for source files and string literals. This is
42-
# required by dependencies like fmt library.
43-
string(APPEND CMAKE_CXX_FLAGS " /utf-8")
44-
string(APPEND CMAKE_C_FLAGS " /utf-8")
4541
else ()
4642
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
4743
endif ()
@@ -569,9 +565,8 @@ if(CIRCT_SLANG_FRONTEND_ENABLED)
569565
FetchContent_Declare(
570566
slang
571567
GIT_REPOSITORY https://github.com/MikePopoloski/slang.git
572-
GIT_TAG dd16a7947e0586d0541477f1b4b60eda7c986e35
573-
# Shallow check-out doesn't work if the tag is ref spec is far from HEAD.
574-
# GIT_SHALLOW ON
568+
GIT_TAG v9.1
569+
GIT_SHALLOW ON
575570
)
576571
set(FETCHCONTENT_TRY_FIND_PACKAGE_MODE "NEVER")
577572

@@ -604,18 +599,19 @@ if(CIRCT_SLANG_FRONTEND_ENABLED)
604599
get_target_property(dep_target ${dep_alias} ALIASED_TARGET)
605600
message(STATUS "Installing slang dependency ${dep_target}")
606601
set_property(GLOBAL APPEND PROPERTY CIRCT_EXPORTS ${dep_target})
607-
install(TARGETS ${dep_target} EXPORT CIRCTTargets)
608602

609603
# Disable the installation of headers coming from third-party libraries.
610604
# We won't use those APIs directly. Just make them static libraries for
611605
# the sake of running slang normally.
612606
set_target_properties(${dep_target} PROPERTIES PUBLIC_HEADER "")
607+
608+
install(TARGETS ${dep_target} EXPORT CIRCTTargets)
613609
endif()
614610
endforeach()
615611
set_property(GLOBAL APPEND PROPERTY CIRCT_EXPORTS slang_slang)
616612
install(TARGETS slang_slang EXPORT CIRCTTargets)
617613
else()
618-
find_package(slang 9.0 REQUIRED)
614+
find_package(slang 9.1 REQUIRED)
619615
endif()
620616
endif()
621617

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ For more information, please see our longer [charter document](docs/Charter.md).
5454

5555
## Getting Started
5656

57-
To get started hacking on CIRCT quickly, run the following commands:
57+
To get started hacking on CIRCT quickly, run the following commands. If you want to include `circt-verilog` in the build, add `-DCIRCT_SLANG_FRONTEND_ENABLED=ON` to the cmake call:
5858

5959
```sh
6060
# Clone the repository and its submodules
@@ -69,14 +69,24 @@ cmake -G Ninja llvm/llvm -B build \
6969
-DLLVM_ENABLE_PROJECTS=mlir \
7070
-DLLVM_EXTERNAL_PROJECTS=circt \
7171
-DLLVM_EXTERNAL_CIRCT_SOURCE_DIR=$PWD
72+
-DLLVM_ENABLE_LLD=ON
73+
```
7274

73-
# Run the build
75+
If you want to build everything about the CIRCT tools and libraries, run below command(also runs all tests):
76+
```
7477
ninja -C build check-circt
7578
```
7679

77-
The above builds the CIRCT tools and libraries and runs all regression tests.
78-
If you want to include `circt-verilog` in the build, add `-DCIRCT_SLANG_FRONTEND_ENABLED=ON` to the cmake call.
79-
You can ask ninja to only build a specific library or tool, such as `ninja -C build circt-opt`.
80+
If you want to only build a specific part, for example the `circt-opt` tool:
81+
```sh
82+
ninja -C build bin/circt-opt
83+
```
84+
85+
or the `firtool` tool:
86+
```sh
87+
ninja -C build bin/firtool
88+
```
89+
8090
This will only build the necessary parts of LLVM, MLIR, and CIRCT, which can be a lot quicker than building everything.
8191

8292
### Dependencies

0 commit comments

Comments
 (0)