forked from OSchip/llvm-project
09e3697f44
This patch allows invariant loads to be used in the SCoP description, e.g., as loop bounds, conditions or in memory access functions. First we collect "required invariant loads" during SCoP detection that would otherwise make an expression we care about non-affine. To this end a new level of abstraction was introduced before SCEVValidator::isAffineExpr() namely ScopDetection::isAffine() and ScopDetection::onlyValidRequiredInvariantLoads(). Here we can decide if we want a load inside the region to be optimistically assumed invariant or not. If we do, it will be marked as required and in the SCoP generation we bail if it is actually not invariant. If we don't it will be a non-affine expression as before. At the moment we optimistically assume all "hoistable" (namely non-loop-carried) loads to be invariant. This causes us to expand some SCoPs and dismiss them later but it also allows us to detect a lot we would dismiss directly if we would ask e.g., AliasAnalysis::canBasicBlockModify(). We also allow potential aliases between optimistically assumed invariant loads and other pointers as our runtime alias checks are sound in case the loads are actually invariant. Together with the invariant checks this combination allows to handle a lot more than LICM can. The code generation of the invariant loads had to be extended as we can now have dependences between parameters and invariant (hoisted) loads as well as the other way around, e.g., test/Isl/CodeGen/invariant_load_parameters_cyclic_dependence.ll First, it is important to note that we cannot have real cycles but only dependences from a hoisted load to a parameter and from another parameter to that hoisted load (and so on). To handle such cases we materialize llvm::Values for parameters that are referred by a hoisted load on demand and then materialize the remaining parameters. Second, there are new kinds of dependences between hoisted loads caused by the constraints on their execution. If a hoisted load is conditionally executed it might depend on the value of another hoisted load. To deal with such situations we sort them already in the ScopInfo such that they can be generated in the order they are listed in the Scop::InvariantAccesses list (see compareInvariantAccesses). The dependences between hoisted loads caused by indirect accesses are handled the same way as before. llvm-svn: 249607 |
||
---|---|---|
.. | ||
aliasing_parametric_simple_1.ll | ||
aliasing_parametric_simple_2.ll | ||
aliasing_simple_1.ll | ||
aliasing_simple_2.ll | ||
base_pointer.ll | ||
cross_loop_non_single_exit.ll | ||
cross_loop_non_single_exit_2.ll | ||
dependency_to_phi_node_outside_of_region.ll | ||
indvars.ll | ||
intrinsics_1.ll | ||
intrinsics_2.ll | ||
intrinsics_3.ll | ||
invalid-latch-conditions.ll | ||
invalidate_scalar_evolution.ll | ||
keep_going_expansion.ll | ||
more-than-one-loop.ll | ||
multidim_indirect_access.ll | ||
multidim_two_accesses_different_delinearization.ll | ||
nested_loop_single_exit.ll | ||
non-affine-conditional.ll | ||
non-affine-float-compare.ll | ||
non-affine-loop-condition-dependent-access.ll | ||
non-affine-loop-condition-dependent-access_2.ll | ||
non-affine-loop-condition-dependent-access_3.ll | ||
non-affine-loop.ll | ||
non-beneficial-loops-small-trip-count.ll | ||
non_affine_loop_condition.ll | ||
only-one-affine-loop.ll | ||
parametric-multiply-in-scev-2.ll | ||
parametric-multiply-in-scev.ll | ||
phi_with_multi_exiting_edges.ll | ||
remove_all_children.ll | ||
report-scop-location.ll | ||
restrict-undef-size-scopdetect.ll | ||
run_time_alias_check.ll | ||
sequential_loops.ll | ||
simple_loop.ll | ||
simple_loop_non_single_entry.ll | ||
simple_loop_non_single_exit.ll | ||
simple_loop_non_single_exit_2.ll | ||
simple_loop_two_phi_nodes.ll | ||
simple_loop_with_param.ll | ||
simple_loop_with_param_2.ll | ||
simple_non_single_entry.ll | ||
skip_function_attribute.ll | ||
srem_with_parametric_divisor.ll |