[PATCH] D13338: [Polly] Consolidate invariant loads
Johannes Doerfert via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 1 04:13:44 PDT 2015
jdoerfert created this revision.
jdoerfert added reviewers: grosser, Meinersbur.
jdoerfert added a subscriber: Polly.
Herald added a subscriber: sanjoy.
If a (assumed) invariant location is loaded multiple times we
generated a parameter for each location. However, this caused compile
time problems for several benchmarks (e.g., 445_gobmk in SPEC2006 and
BT in the NAS benchmarks). Additionally, the code we generate is
suboptimal as we preload the same location multiple times and perform
the same checks on all the parameters that refere to the same value.
With this patch we consolidate the invariant loads in three steps:
1) During the SCoP detection (assumed) invariant loads are kept in
equivalence classes based on their pointer operand. One
representing load is used to generate a parameter for the whole
class, thus we never generate multiple parameters for the same
location.
2) During the SCoP generation we consolidate invariant memory
accesses that are in the same equivalence class. While doing so
we build the union of all execution domains as it is only
important that the location is at least accessed once. However,
we do not drop any invariant access we need to remap the access
instruction later.
3) During the code generation we preload one invariant access for
each equivalence class and map all access instruction in that
equivalence class to the preloaded value.
http://reviews.llvm.org/D13338
Files:
include/polly/CodeGen/IslNodeBuilder.h
include/polly/ScopDetection.h
include/polly/ScopInfo.h
include/polly/Support/SCEVAffinator.h
include/polly/Support/SCEVValidator.h
include/polly/Support/ScopHelper.h
lib/Analysis/ScopDetection.cpp
lib/Analysis/ScopInfo.cpp
lib/CodeGen/BlockGenerators.cpp
lib/CodeGen/CodeGeneration.cpp
lib/CodeGen/IslNodeBuilder.cpp
lib/Support/SCEVAffinator.cpp
lib/Support/SCEVValidator.cpp
lib/Support/ScopHelper.cpp
test/Isl/CodeGen/invariant_load_base_pointer.ll
test/Isl/CodeGen/invariant_load_base_pointer_conditional.ll
test/Isl/CodeGen/invariant_load_condition.ll
test/Isl/CodeGen/invariant_load_escaping_second_scop.ll
test/Isl/CodeGen/invariant_load_loop_ub.ll
test/Isl/CodeGen/invariant_load_outermost.ll
test/Isl/CodeGen/invariant_load_parameters_cyclic_dependence.ll
test/Isl/CodeGen/invariant_load_ptr_ptr_noalias.ll
test/Isl/CodeGen/invariant_load_scalar_dep.ll
test/Isl/CodeGen/reduction_2.ll
test/Isl/CodeGen/whole-scop-non-affine-subregion.ll
test/ScopDetect/base_pointer.ll
test/ScopDetectionDiagnostics/ReportLoopBound-01.ll
test/ScopDetectionDiagnostics/ReportVariantBasePtr-01.ll
test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_1.ll
test/ScopInfo/NonAffine/non_affine_conditional_surrounding_affine_loop.ll
test/ScopInfo/NonAffine/non_affine_conditional_surrounding_non_affine_loop.ll
test/ScopInfo/intra_and_inter_bb_scalar_dep.ll
test/ScopInfo/invariant_load_base_pointer.ll
test/ScopInfo/invariant_load_base_pointer_conditional.ll
test/ScopInfo/invariant_load_condition.ll
test/ScopInfo/invariant_load_loop_ub.ll
test/ScopInfo/invariant_load_ptr_ptr_noalias.ll
test/ScopInfo/invariant_load_scalar_dep.ll
test/ScopInfo/invariant_loads_complicated_dependences.ll
test/ScopInfo/invariant_loads_cyclic_dependences.ll
test/ScopInfo/invariant_loop_bounds.ll
test/ScopInfo/invariant_same_loop_bound_multiple_times-1.ll
test/ScopInfo/invariant_same_loop_bound_multiple_times-2.ll
test/ScopInfo/required-invariant-loop-bounds.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13338.36221.patch
Type: text/x-patch
Size: 106953 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151001/4997d43c/attachment.bin>
More information about the llvm-commits
mailing list