[polly][PATCH] Derive run-time conditions for delinearization
Tobias Grosser
tobias at grosser.es
Wed Jun 25 02:37:56 PDT 2014
Hi,
I would like to ask for feedback on the following patch:
[polly][PATCH] Derive run-time conditions for delinearization
As our delinearization works optimistically, we need in some cases
run-time checks that verify our optimistic assumptions. A simple example
is the following code:
void foo(long n, long m, long o, double A[n][m][o]) {
for (long i = 0; i < 100; i++)
for (long j = 0; j < 150; j++)
for (long k = 0; k < 200; k++)
A[i][j][k] = 1.0;
}
After clang linearized the access to A and we delinearized it again to
A[i][j][k] we need to ensure that we do not access the delinearized
array out of bounds (this information is not available in LLVM-IR).
Hence, we need to verify the following constraints at run-time:
CHECK: Assumed Context:
CHECK: [o, m] -> { : m >= 150 and o >= 200 }
---
include/polly/ScopInfo.h | 19 ++++++
lib/Analysis/ScopInfo.cpp | 78
++++++++++++++++++++++
lib/CodeGen/IslCodeGeneration.cpp | 5 +-
...tidim_2d_parametric_array_static_loop_bounds.ll | 44 ++++++++++++
test/ScopInfo/multidim_2d-diagonal-matrix.ll | 4 ++
.../ScopInfo/multidim_2d_outer_larger_than_zero.ll | 54 +++++++++++++++
...tidim_2d_parametric_array_static_loop_bounds.ll | 50 ++++++++++++++
...tidim_3d_parametric_array_static_loop_bounds.ll | 66 ++++++++++++++++++
.../multidim_ivs_and_integer_offsets_3d.ll | 3 +
.../multidim_ivs_and_parameteric_offsets_3d.ll | 11 +++
test/ScopInfo/multidim_nested_start_integer.ll | 2 +
.../multidim_nested_start_share_parameter.ll | 2 +
test/ScopInfo/multidim_only_ivs_2d.ll | 2 +
test/ScopInfo/multidim_only_ivs_3d.ll | 2 +
test/ScopInfo/multidim_only_ivs_3d_cast.ll | 16 +++--
test/ScopInfo/multidim_only_ivs_3d_reverse.ll | 46 +++++++------
test/ScopInfo/simple_loop_1.ll | 3 +
17 files changed, 380 insertions(+), 27 deletions(-)
create mode 100644
test/Isl/CodeGen/multidim_2d_parametric_array_static_loop_bounds.ll
create mode 100644 test/ScopInfo/multidim_2d_outer_larger_than_zero.ll
create mode 100644
test/ScopInfo/multidim_2d_parametric_array_static_loop_bounds.ll
create mode 100644
test/ScopInfo/multidim_3d_parametric_array_static_loop_bounds.ll
Thanks,
Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Derive-run-time-conditions-for-delinearization.patch
Type: text/x-patch
Size: 27159 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140625/685ed004/attachment.bin>
More information about the llvm-commits
mailing list