llvm-project/polly/lib/CodeGen
Roman Gareev bd5c6039c6 Align newly created arrays to the first level cache line boundary
Aligning data to cache lines boundaries helps to avoid overheads related to
an access to it ([1]). This patch aligns newly created arrays and adds an
option to specify the first level cache line size. By default we use 64 bytes,
which is a typical cache-line size ([2]).

In case of Intel Core i7-3820 SandyBridge and the following options,

clang -O3 gemm.c -I utilities/ utilities/polybench.c -DPOLYBENCH_TIME
-march=native -mllvm -polly -mllvm -polly-pattern-matching-based-opts=true
-DPOLYBENCH_USE_SCALAR_LB -mllvm -polly-target-cache-level-associativity=8,8
-mllvm -polly-target-cache-level-sizes=32768,262144 -mllvm
-polly-target-latency-vector-fma=8

it helps to improve the performance from 11.303 GFlops/sec (39,247% of
theoretical peak) to 12.63 GFlops/sec (43,8542% of theoretical peak).

Refs.:

[1] - http://www.alexonlinux.com/aligned-vs-unaligned-memory-access
[2] - http://igoro.com/archive/gallery-of-processor-cache-effects/

Differential Revision: https://reviews.llvm.org/D28020

Reviewed-by: Tobias Grosser <tobias@grosser.es>
llvm-svn: 290253
2016-12-21 12:37:36 +00:00
..
BlockGenerators.cpp canSynthesize: Remove unused argument LI. NFC. 2016-11-29 15:11:04 +00:00
CodeGeneration.cpp [Polly CodeGen] Break critical edge from RTC to original loop. 2016-11-02 22:32:23 +00:00
CodegenCleanup.cpp Try to fix polly buildbots. 2016-07-06 02:21:00 +00:00
IRBuilder.cpp Perform copying to created arrays according to the packing transformation 2016-09-14 06:26:09 +00:00
IslAst.cpp IslAst: always use the context during ast generation 2016-11-10 09:39:58 +00:00
IslExprBuilder.cpp [Polly CodeGen] Break critical edge from RTC to original loop. 2016-11-02 22:32:23 +00:00
IslNodeBuilder.cpp Align newly created arrays to the first level cache line boundary 2016-12-21 12:37:36 +00:00
LoopGenerators.cpp Fix clang-format 2016-12-19 14:06:40 +00:00
PPCGCodeGeneration.cpp Update for clang-format change in r288119 2016-11-29 12:52:08 +00:00
RuntimeDebugBuilder.cpp Update for llvm r274769 2016-07-07 18:03:30 +00:00
Utils.cpp [Polly CodeGen] Break critical edge from RTC to original loop. 2016-11-02 22:32:23 +00:00