mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-03 09:32:42 +00:00
Add unstable loop unrolling hint attributes Tracking issue: https://github.com/rust-lang/rust/issues/156874 This adds as new attribute `#[unroll]`/`#[unroll(full)]`/`#[unroll(never)]`/`#[unroll(16)]` (or any u32). `#[unroll]` is behind a new feature gate `#![feature(loop_hints)]` because I intend to add an attribute for loop vectorization as well. If a user wants to turn off loop unrolling to locally minimize code size, LLVM may vectorize the loop even though it isn't unrolled which can produce a similar code size explosion.