diff options
| author | Tobias Grosser <grosser@fim.uni-passau.de> | 2013-05-16 06:40:06 +0000 |
|---|---|---|
| committer | Tobias Grosser <grosser@fim.uni-passau.de> | 2013-05-16 06:40:06 +0000 |
| commit | 5db6ffd76f50e58467530c63feb098d2ec59410e (patch) | |
| tree | 8c7b12ca0a3570903cfc638038c788b513928123 /polly/test/Cloog/CodeGen | |
| parent | ba71c085234044f8291b82749552a79d01f99631 (diff) | |
| download | bcm5719-llvm-5db6ffd76f50e58467530c63feb098d2ec59410e.tar.gz bcm5719-llvm-5db6ffd76f50e58467530c63feb098d2ec59410e.zip | |
LoopGenerators: Construct loops such that they are already loop rotated
BeforeBB
|
v
GuardBB
/ \
__ PreHeaderBB \
/ \ / |
latch HeaderBB |
\ / \ /
< \ /
\ /
ExitBB
This does not only remove the need for an explicit loop rotate pass, but it also
gives us the possibility to skip the construction of the guard condition in case
the loop is known to be executed at least once. We do not yet exploit this, but
by implementing this analysis in the isl code generator we should be able to
remove more guards than the generic loop rotate pass can. Another point is that
loop rotation can introduce additional PHI nodes, which may hide that a loop can
be executed in parallel. This change avoids this complication and will make it
easier to move the openmp code generation into a separate pass.
llvm-svn: 181986
Diffstat (limited to 'polly/test/Cloog/CodeGen')
| -rw-r--r-- | polly/test/Cloog/CodeGen/MemAccess/codegen_simple_md.ll | 12 | ||||
| -rw-r--r-- | polly/test/Cloog/CodeGen/OpenMP/simple_nested_loop.ll | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/polly/test/Cloog/CodeGen/MemAccess/codegen_simple_md.ll b/polly/test/Cloog/CodeGen/MemAccess/codegen_simple_md.ll index eb58575b8fb..132f70f608b 100644 --- a/polly/test/Cloog/CodeGen/MemAccess/codegen_simple_md.ll +++ b/polly/test/Cloog/CodeGen/MemAccess/codegen_simple_md.ll @@ -59,16 +59,16 @@ for.end6: ; preds = %for.cond ; WITHCONST: %p_mul_coeff = mul i64 16, [[REG1]] ; WITHCONST: %p_sum_coeff = add i64 5, %p_mul_coeff ; WITHCONST: [[REG2:%[0-9]+]] = sext i32 %{{[0-9]+}} to i64 -; WITHCONST: %p_mul_coeff6 = mul i64 2, [[REG2]] -; WITHCONST: %p_sum_coeff7 = add i64 %p_sum_coeff, %p_mul_coeff6 -; WITHCONST: %p_newarrayidx_ = getelementptr [1040 x i32]* @A, i64 0, i64 %p_sum_coeff7 +; WITHCONST: %p_mul_coeff8 = mul i64 2, [[REG2]] +; WITHCONST: %p_sum_coeff9 = add i64 %p_sum_coeff, %p_mul_coeff8 +; WITHCONST: %p_newarrayidx_ = getelementptr [1040 x i32]* @A, i64 0, i64 %p_sum_coeff9 ; WITHCONST: store i32 100, i32* %p_newarrayidx_ ; WITHOUTCONST: [[REG1:%[0-9]+]] = sext i32 %{{[0-9]+}} to i64 ; WITHOUTCONST: %p_mul_coeff = mul i64 16, [[REG1]] ; WITHOUTCONST: %p_sum_coeff = add i64 0, %p_mul_coeff ; WITHOUTCONST: [[REG2:%[0-9]+]] = sext i32 %{{[0-9]+}} to i64 -; WITHOUTCONST: %p_mul_coeff6 = mul i64 2, [[REG2]] -; WITHOUTCONST: %p_sum_coeff7 = add i64 %p_sum_coeff, %p_mul_coeff6 -; WITHOUTCONST: %p_newarrayidx_ = getelementptr [1040 x i32]* @A, i64 0, i64 %p_sum_coeff7 +; WITHOUTCONST: %p_mul_coeff8 = mul i64 2, [[REG2]] +; WITHOUTCONST: %p_sum_coeff9 = add i64 %p_sum_coeff, %p_mul_coeff8 +; WITHOUTCONST: %p_newarrayidx_ = getelementptr [1040 x i32]* @A, i64 0, i64 %p_sum_coeff9 ; WITHOUTCONST: store i32 100, i32* %p_newarrayidx_ diff --git a/polly/test/Cloog/CodeGen/OpenMP/simple_nested_loop.ll b/polly/test/Cloog/CodeGen/OpenMP/simple_nested_loop.ll index 9753b0e92ec..1f4d68a81c7 100644 --- a/polly/test/Cloog/CodeGen/OpenMP/simple_nested_loop.ll +++ b/polly/test/Cloog/CodeGen/OpenMP/simple_nested_loop.ll @@ -80,7 +80,7 @@ declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind ; CHECK: %omp.userContext = alloca { i32 } ; CHECK: getelementptr inbounds { i32 }* %omp.userContext, i32 0, i32 0 -; CHECK: store i32 %polly.loopiv, i32* %1 +; CHECK: store i32 %polly.indvar, i32* %0 ; CHECK: %omp_data = bitcast { i32 }* %omp.userContext to i8* ; CHECK: call void @GOMP_parallel_loop_runtime_start(void (i8*)* @loop_openmp.omp_subfn, i8* %omp_data, i32 0, i32 0, i32 10, i32 1) ; CHECK: call void @loop_openmp.omp_subfn(i8* %omp_data) |

