-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #77975 - bjorn3:cg_clif_subtree3, r=Mark-Simulacrum
Add cg_clif as optional codegen backend Rustc_codegen_cranelift is an alternative codegen backend for rustc based on Cranelift. It has the potential to improve compilation times in debug mode. In my experience the compile time improvements over debug mode LLVM for a clean build are about 20-30% in most cases. This PR adds cg_clif as optional codegen backend. By default it is only enabled for `./x.py check`. It can be enabled for `./x.py build` too by adding `cranelift` to the `rust.codegen-backends` array in `config.toml`. MCP: rust-lang/compiler-team#270 r? `@Mark-Simulacrum`
- Loading branch information
Showing
98 changed files
with
17,049 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
54 changes: 54 additions & 0 deletions
54
compiler/rustc_codegen_cranelift/.github/workflows/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: CI | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache cargo installed crates | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cargo/bin | ||
key: ${{ runner.os }}-cargo-installed-crates | ||
|
||
- name: Cache cargo registry and index | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: ${{ runner.os }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Cache cargo target dir | ||
uses: actions/cache@v2 | ||
with: | ||
path: target | ||
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }} | ||
|
||
- name: Prepare dependencies | ||
run: | | ||
git config --global user.email "user@example.com" | ||
git config --global user.name "User" | ||
./prepare.sh | ||
- name: Test | ||
run: | | ||
# Enable backtraces for easier debugging | ||
export RUST_BACKTRACE=1 | ||
# Reduce amount of benchmark runs as they are slow | ||
export COMPILE_RUNS=2 | ||
export RUN_RUNS=2 | ||
./test.sh --release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
target | ||
**/*.rs.bk | ||
*.rlib | ||
*.o | ||
perf.data | ||
perf.data.old | ||
*.events | ||
*.string* | ||
/build_sysroot/sysroot | ||
/build_sysroot/sysroot_src | ||
/rust | ||
/rand | ||
/regex | ||
/simple-raytracer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
// source for rustc_* is not included in the rust-src component; disable the errors about this | ||
"rust-analyzer.diagnostics.disabled": ["unresolved-extern-crate"], | ||
"rust-analyzer.cargo.loadOutDirsFromCheck": true, | ||
"rust-analyzer.linkedProjects": [ | ||
"./Cargo.toml", | ||
//"./build_sysroot/sysroot_src/src/libstd/Cargo.toml", | ||
{ | ||
"roots": [ | ||
"./example/mini_core.rs", | ||
"./example/mini_core_hello_world.rs", | ||
"./example/mod_bench.rs" | ||
], | ||
"crates": [ | ||
{ | ||
"root_module": "./example/mini_core.rs", | ||
"edition": "2018", | ||
"deps": [], | ||
"cfg": [], | ||
}, | ||
{ | ||
"root_module": "./example/mini_core_hello_world.rs", | ||
"edition": "2018", | ||
"deps": [{ "crate": 0, "name": "mini_core" }], | ||
"cfg": [], | ||
}, | ||
{ | ||
"root_module": "./example/mod_bench.rs", | ||
"edition": "2018", | ||
"deps": [], | ||
"cfg": [], | ||
}, | ||
] | ||
}, | ||
{ | ||
"roots": ["./scripts/filter_profile.rs"], | ||
"crates": [ | ||
{ | ||
"root_module": "./scripts/filter_profile.rs", | ||
"edition": "2018", | ||
"deps": [{ "crate": 1, "name": "std" }], | ||
"cfg": [], | ||
}, | ||
{ | ||
"root_module": "./build_sysroot/sysroot_src/library/std/src/lib.rs", | ||
"edition": "2018", | ||
"deps": [], | ||
"cfg": [], | ||
}, | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.