An aggregate literal of N droppable elements whose initializers can diverge could emit O(N^2) drop terminators. Which chokes LLVM's CVP pass and cost substantial time in optimized build.
For example, the following code will take over 60s to build with -O:
pub fn build(s: u64) -> Result<Big, ()> {
Ok(Big { f0: make_one(s ^ 0)?, /* … N fields … */ f127: make_one(s ^ 127)? })
}
See https://github.com/ashi009/cvp-llvm-repro for a runnable example.
Reproducible on 1.96.0 stable (LLVM 22.1.2) and 1.98.0-nightly e7815e5 (LLVM 22.1.6).
An aggregate literal of
Ndroppable elements whose initializers can diverge could emitO(N^2)dropterminators. Which chokes LLVM's CVP pass and cost substantial time in optimized build.For example, the following code will take over 60s to build with
-O:See https://github.com/ashi009/cvp-llvm-repro for a runnable example.
Reproducible on 1.96.0 stable (LLVM 22.1.2) and 1.98.0-nightly e7815e5 (LLVM 22.1.6).