search for: len_1

Displaying 1 result from an estimated 1 matches for "len_1".

Did you mean: len1
2017 Dec 21
2
Pass ordering - GVN vs. loop optimizations
...at if a loop index only appears behind a pointer, LLVM will not be able to optimize out bounds checks depending on it. The "canonical" example is this Rust function (or the similar C code): #![crate_type="rlib"] pub fn f(length: &usize) -> u64 { let mut sum = 0; let len_1 = *length; let mut i = 0; while i < len_1 { let len_2 = *length; assert!(i < len_2); i += 1; } sum } One would expect the assertion (which in a real example is a bounds check) to be optimized out. However, IndVarSimplify is the optimization that is supposed to do that, an...