Repository: rust
Issue: Tracking Issue for batching
Labels: C-tracking-issue,F-batching

<!--
NOTE: For library features, please use the "Library Tracking Issue" template instead.

Thank you for creating a tracking issue! 📜 Tracking issues are for tracking a
feature from implementation to stabilisation. Make sure to include the relevant
RFC for the feature if it has one. Otherwise provide a short summary of the
feature and link any relevant PRs or issues, and remove any sections that are
not relevant to the feature.

Remember to add team labels to the tracking issue.
For a language team feature, this would e.g., be `T-lang`.
Such a feature should also be labeled with e.g., `F-my_feature`.
This label is used to associate issues (e.g., bugs and design questions) to the feature.
-->

This is a tracking issue for the batching feature of llvm/enzyme.
The feature gate for the issue is `#![feature(batching)]`.

This is the second out of three features that were approved as experiments in [a project goal](https://rust-lang.github.io/rust-project-goals/2024h2/Rust-for-SciComp.html). It allows merging N function calls (e.g. from looping over a call) into a single call, with N being a compile-time constant. This allows better vectorization and other optimizations.

We reuse almost all of the infrastructure from the autodiff macro, with a slightly different syntax both in the user facing macro, as well as the llvm-ir we generate. We intend to later extend the autodiff macro to optionally include the batching feature, however some users might want to use batching without automatic differentiation, which is the motivation for this independent batch macro. It also seems wise to experiment with both independently before trying to merge them.


### About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however *not* meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.

### Steps
<!--
Include each step required to complete the feature. Typically this is a PR
implementing a feature, followed by a PR that stabilises the feature. However
for larger features an implementation could be broken up into multiple PRs.
-->
 

- [x] Get compiler MCP approved.
    - https://github.com/rust-lang/compiler-team/issues/611

- [x] Get lang experiment approved.
    - We approved this in the lang triage meeting on 2024-05-01.

- [ ] Land the experimental implementation in nightly.
    - Combined change for reference (wip link): https://github.com/EnzymeAD/rust/pull/192

- [ ] Accept an RFC.
   
 - [ ] Add documentation to the [dev guide](https://github.com/rust-lang/rustc-dev-guide).
    - See the [instructions](https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#documentation-prs).

- [ ] Add documentation to the [reference](https://github.com/rust-lang/reference).
    - See the [instructions](https://github.com/rust-lang/reference/blob/master/CONTRIBUTING.md).

- [ ] Add formatting for new syntax to the [style guide](https://github.com/rust-lang/rust/tree/master/src/doc/style-guide).
    - See the [nightly style procedure](https://github.com/rust-lang/style-team/blob/master/nightly-style-procedure.md).

[stabilization-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#stabilization-pr
[doc-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#documentation-prs
[nightly-style-procedure]: https://github.com/rust-lang/style-team/blob/main/nightly-style-procedure.md 
[Style Guide]: https://github.com/rust-lang/rust/tree/master/src/doc/style-guide

### Unresolved Questions
<!--
Include any open questions that need to be answered before the feature can be
stabilised.
-->

XXX --- list all the "unresolved questions" found in the RFC to ensure they are
not forgotten

### Implementation history

<!--
Include a list of all the PRs that were involved in implementing the feature.
-->