Skip to content

Commit 1a9a858

Browse files
author
The rustc-josh-sync Cronjob Bot
committed
Merge ref '4068bafedd8b' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 4068bafedd8ba724e332a5221c06a6fa531a30d2 Filtered ref: da574cb Upstream diff: rust-lang/rust@4fa824b...4068baf This merge was created using https://github.com/rust-lang/josh-sync.
2 parents a32194b + da574cb commit 1a9a858

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

src/autodiff/debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The actual numbers will depend on your code.
2525

2626
## 2) Check your llvm-ir reproducer
2727

28-
To confirm that your previous step worked, we will use llvm's `opt` tool. find your path to the opt binary, with a path similar to `<some_dir>/rust/build/<x86/arm/...-target-triple>/build/bin/opt`. also find `llvmenzyme-19.<so/dll/dylib>` path, similar to `/rust/build/target-triple/enzyme/build/enzyme/llvmenzyme-19`. Please keep in mind that llvm frequently updates it's llvm backend, so the version number might be higher (20, 21, ...). Once you have both, run the following command:
28+
To confirm that your previous step worked, we will use llvm's `opt` tool. Find your path to the opt binary, with a path similar to `<some_dir>/rust/build/<x86/arm/...-target-triple>/ci-llvm/bin/opt`. If you build LLVM from source, you'll likely need to replace `ci-llvm` with `build`. Also find `llvmenzyme-21.<so/dll/dylib>` path, similar to `/rust/build/target-triple/enzyme/build/enzyme/llvmenzyme-21`. Please keep in mind that llvm frequently updates it's llvm backend, so the version number might be higher (20, 21, ...). Once you have both, run the following command:
2929

3030
```sh
3131
<path/to/opt> out.ll -load-pass-plugin=/path/to/build/<target-triple>/stage1/lib/libEnzyme-21.so -passes="enzyme" -enzyme-strict-aliasing=0 -s

src/autodiff/installation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ First you need to clone and configure the Rust repository:
88
```bash
99
git clone [email protected]:rust-lang/rust
1010
cd rust
11-
./configure --enable-llvm-link-shared --enable-llvm-plugins --enable-llvm-enzyme --release-channel=nightly --enable-llvm-assertions --enable-clang --enable-lld --enable-option-checking --enable-ninja --disable-docs
11+
./configure --release-channel=nightly --enable-llvm-enzyme --enable-llvm-assertions --enable-option-checking --disable-docs --set llvm.download-ci-llvm=true
1212
```
1313

1414
Afterwards you can build rustc using:
@@ -47,7 +47,7 @@ Then build rustc in a slightly altered way:
4747
```bash
4848
git clone https://github.com/rust-lang/rust
4949
cd rust
50-
./configure --enable-llvm-link-shared --enable-llvm-plugins --enable-llvm-enzyme --release-channel=nightly --enable-llvm-assertions --enable-clang --enable-lld --enable-option-checking --enable-ninja --disable-docs
50+
./configure --release-channel=nightly --enable-llvm-enzyme --enable-llvm-assertions --enable-option-checking --disable-docs --set llvm.download-ci-llvm=true
5151
./x dist
5252
```
5353
We then copy the tarball to our host. The dockerid is the newest entry under `docker ps -a`.
@@ -84,5 +84,5 @@ cd build
8484
cmake .. -G Ninja -DLLVM_DIR=<YourLocalPath>/llvm-project/build/lib/cmake/llvm/ -DLLVM_EXTERNAL_LIT=<YourLocalPath>/llvm-project/llvm/utils/lit/lit.py -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=YES -DBUILD_SHARED_LIBS=ON
8585
ninja
8686
```
87-
This will build Enzyme, and you can find it in `Enzyme/enzyme/build/lib/<LLD/Clang/LLVM>Enzyme.so`. (Endings might differ based on your OS).
87+
This will build Enzyme, and you can find it in `Enzyme/enzyme/build/lib/<LLD/Clang/LLVM/lib>Enzyme.so`. (Endings might differ based on your OS).
8888

src/borrow_check/moves_and_initialization/move_paths.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ We don't actually create a move-path for **every** [`Place`] that gets
6767
used. In particular, if it is illegal to move from a [`Place`], then
6868
there is no need for a [`MovePathIndex`]. Some examples:
6969

70-
- You cannot move from a static variable, so we do not create a [`MovePathIndex`]
71-
for static variables.
7270
- You cannot move an individual element of an array, so if we have e.g. `foo: [String; 3]`,
7371
there would be no move-path for `foo[1]`.
7472
- You cannot move from inside of a borrowed reference, so if we have e.g. `foo: &String`,
@@ -82,6 +80,18 @@ initialized (which lowers overhead).
8280

8381
[`move_path_for`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_dataflow/move_paths/builder/struct.MoveDataBuilder.html#method.move_path_for
8482

83+
## Projections
84+
85+
Instead of using [`PlaceElem`], projections in move paths are stored as [`MoveSubPath`]s.
86+
Projections that can't be moved out of and projections that can be skipped are not represented.
87+
88+
Subslice projections of arrays (produced by slice patterns) are special; they're turned into
89+
multiple [`ConstantIndex`] subpaths, one for each element in the subslice.
90+
91+
[`PlaceElem`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/type.PlaceElem.html
92+
[`MoveSubPath`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_dataflow/move_paths/enum.MoveSubPath.html
93+
[`ConstantIndex`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_dataflow/move_paths/enum.MoveSubPath.html#variant.ConstantIndex
94+
8595
## Looking up a move-path
8696

8797
If you have a [`Place`] and you would like to convert it to a [`MovePathIndex`], you

0 commit comments

Comments
 (0)