On Jun 22, 2014, at 9:35 PM, Daniel Micay <danielmi...@gmail.com> wrote:

> An operation that can unwind isn't pure. It impedes code motion such as
> hoisting operations out of a loop, which is very important for easing
> the performance issues caused by indexing bounds checks. LLVM doesn't
> model the `nounwind` effect on functions simply for fun.

It gets easier to optimize if you adopt a less precise model of exceptions. For 
example, you could pick a model where you preserve control dependence and 
externally visible side effects, but allow reordering in other cases. This does 
get tricky if destructors themselves have externally visible side effects that 
are dependent on intervening stores that can be elided.

This probably requires whole-program compilation with some knowledge of 
externally visible side effects, or more restrictions placed on destructors 
than there are currently. It also is hard to make work with unsafe code, since 
unsafe code might require exact placement of unwinding for memory safety in 
destructors.

Cameron
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to