forked from OSchip/llvm-project
7b50beebe4
In case a GEP instruction references into a fixed size array e.g., an access A[i][j] into an array A[100x100], LLVM-IR does not guarantee that the subscripts always compute values that are within array bounds. We now derive the set of parameter values for which all accesses are within bounds and add the assumption that the scop is only every executed with this set of parameter values. Example: void foo(float A[][20], long n, long m { for (long i = 0; i < n; i++) for (long j = 0; j < m; j++) A[i][j] = ... This loop yields out-of-bound accesses if m is at least 20 and at the same time at least one iteration of the outer loop is executed. Hence, we assume: n <= 0 or m <= 20. Doing so simplifies the dependence analysis problem, allows us to perform more optimizations and generate better code. TODO: The location where the GEP instruction is executed is not necessarily the location where the memory is actually accessed. As a result scanning for GEP[s] is imprecise. Even though this is not a correctness problem, this imprecision may result in missed optimizations or non-optimal run-time checks. In polybench where this mismatch between parametric loop bounds and fixed size arrays is common, we see with this patch significant reductions in compile time (up to 50%) and execution time (up to 70%). We see two significant compile time regressions (fdtd-2d, jacobi-2d-imper), and one execution time regression (trmm). Both regressions arise due to additional optimizations that have been enabled by this patch. They can be addressed in subsequent commits. http://reviews.llvm.org/D6369 llvm-svn: 222754 |
||
---|---|---|
.. | ||
2012-03-16-Crash-because-of-unsigned-in-scev.ll | ||
20111108-Parameter-not-detected.ll | ||
Alias-0.ll | ||
Alias-1.ll | ||
Alias-2.ll | ||
Alias-3.ll | ||
Alias-4.ll | ||
aliasing_conditional_alias_groups_1.ll | ||
aliasing_conditional_alias_groups_2.ll | ||
aliasing_dead_access.ll | ||
aliasing_many_parameters_not_all_involved.ll | ||
aliasing_multiple_alias_groups.ll | ||
assume_gep_bounds.ll | ||
assume_gep_bounds_2.ll | ||
bug_2010_10_22.ll | ||
bug_2011_1_5.ll | ||
bug_scev_not_fully_eval.ll | ||
cond_constant_in_loop.ll | ||
cond_in_loop.ll | ||
constant_start_integer.ll | ||
delinearize-together-all-data-refs.ll | ||
independent-blocks-never-stop-on-big-scop.ll | ||
integers.ll | ||
isl_aff_out_of_bounds.ll | ||
loop_affine_bound_0.ll | ||
loop_affine_bound_1.ll | ||
loop_affine_bound_2.ll | ||
loop_carry.ll | ||
multi-scop.ll | ||
multidim_2d-diagonal-matrix.ll | ||
multidim_2d_outer_parametric_offset.ll | ||
multidim_2d_parametric_array_static_loop_bounds.ll | ||
multidim_3d_parametric_array_static_loop_bounds.ll | ||
multidim_ivs_and_integer_offsets_3d.ll | ||
multidim_ivs_and_parameteric_offsets_3d.ll | ||
multidim_nested_start_integer.ll | ||
multidim_nested_start_share_parameter.ll | ||
multidim_only_ivs_2d.ll | ||
multidim_only_ivs_3d.ll | ||
multidim_only_ivs_3d_cast.ll | ||
multidim_only_ivs_3d_reverse.ll | ||
multidim_single_and_multidim_array.ll | ||
non_affine_access.ll | ||
non_affine_parametric_loop.ll | ||
parameter_product.ll | ||
phi_not_grouped_at_top.ll | ||
phi_with_invoke_edge.ll | ||
reduction_alternating_base.ll | ||
reduction_chain_partially_outside_the_scop.ll | ||
reduction_disabled_multiplicative.ll | ||
reduction_escaping_intermediate.ll | ||
reduction_escaping_intermediate_2.ll | ||
reduction_invalid_different_operators.ll | ||
reduction_invalid_overlapping_accesses.ll | ||
reduction_multiple_loops_array_sum.ll | ||
reduction_multiple_loops_array_sum_1.ll | ||
reduction_multiple_simple_binary.ll | ||
reduction_non_overlapping_chains.ll | ||
reduction_only_reduction_like_access.ll | ||
reduction_simple_fp.ll | ||
reduction_simple_w_constant.ll | ||
reduction_simple_w_iv.ll | ||
reduction_two_identical_reads.ll | ||
run-time-check-many-parameters.ll | ||
run-time-check-read-only-arrays.ll | ||
scalar.ll | ||
simple_loop_1.ll | ||
simple_nonaffine_loop_not.ll | ||
smax.ll | ||
undef_in_cond.ll |