[polly] removing cloog dependence in the testsuite

Hi Tobi,

when polly is configured with isl and without cloog, make polly-test does not
pass cleanly as there are several testcases that use a pass flag that does not
exist in this configuration: -polly-cloog.

I was thinking to address this problem by renaming -polly-cloog and
-polly-codegen-isl to -polly-codegen and making all these tests using
-polly-codegen.

Another option is to disable these tests when cloog is not available, and to
write other tests that will work with -polly-codegen-isl.

Which one do you think is the best to implement?

Thanks,
Sebastian

Hi Tobi,

Sebastian Pop wrote:

Another option is to disable these tests when cloog is not available, and to
write other tests that will work with -polly-codegen-isl.

I think I like this way better. The attached patches move all the test
dependent on Cloog to be conditionally executed to CLOOG_FOUND. I am preparing
another patch that will adapt most of the current tests to work with ISL's code
generator.

Ok to commit?

Thanks,
Sebastian

0001-execute-cloog-specific-testcases-only-with-CLOOG_FOU.patch (27.2 KB)

0002-use-polly-ast-instead-of-polly-cloog.patch (11.5 KB)

Hi Tobi,

Sebastian Pop wrote:

Sebastian Pop wrote:
> Another option is to disable these tests when cloog is not available, and to
> write other tests that will work with -polly-codegen-isl.

I think I like this way better. The attached patches move all the test
dependent on Cloog to be conditionally executed to CLOOG_FOUND. I am preparing
another patch that will adapt most of the current tests to work with ISL's code
generator.

See attached the patch that adds to the Isl/CodeGen all the tests that can be
run also with the ISL code generator (the vectorizer tests cannot yet be
executed with the ISL code generator yet: when we enabling the vectorizer with
the ISL codegen we will add them). All these tests are exact copy of the
Cloog/CodeGen tests adapted to match the output of ISL.

With the 3 patches make polly-test is passing with both configurations enabling
either the cloog codegen and the isl codegen.

Is it ok to commit all these three patches?

Thanks,
Sebastian

0001-adapt-cloog-codegen-testcases-to-isl.patch (111 KB)

Hi Tobi,

Sebastian Pop wrote:
> Sebastian Pop wrote:
> > Another option is to disable these tests when cloog is not available, and to
> > write other tests that will work with -polly-codegen-isl.
>
> I think I like this way better. The attached patches move all the test
> dependent on Cloog to be conditionally executed to CLOOG_FOUND. I am preparing
> another patch that will adapt most of the current tests to work with ISL's code
> generator.

See attached the patch that adds to the Isl/CodeGen all the tests that
can be
run also with the ISL code generator (the vectorizer tests cannot yet be
executed with the ISL code generator yet: when we enabling the vectorizer
with
the ISL codegen we will add them). All these tests are exact copy of the
Cloog/CodeGen tests adapted to match the output of ISL.

With the 3 patches make polly-test is passing with both configurations
enabling
either the cloog codegen and the isl codegen.

Very nice. Thanks for the work!

Is it ok to commit all these three patches?

Patch two is fine.

Regarding patch one and three: We already have the directory
test/CodeGen and test/IslCodeGen. I propose to just leave the CLooG test
cases in test/CodeGen, but to run them conditionally.
You can add the new isl test cases to test/IslCodeGen.

If you agree, such changes are preapproved here.

Tobi

Tobias Grosser wrote:

Regarding patch one and three: We already have the directory
test/CodeGen and test/IslCodeGen. I propose to just leave the CLooG test
cases in test/CodeGen, but to run them conditionally.

I only know how to disable the test of a full directory, so if you want I can
disable all the CodeGen directory (and subdirectories) when Cloog is not
available. Note that in my first patch I have moved only those tests not
working without cloog, and there are several testcases left in CodeGen that can
still be executed with ISL's codegen.

You can add the new isl test cases to test/IslCodeGen.

That's what patch 3 does, except for a minor rename to avoid a redundant CodeGen
in the dir names.

Sebastian

Tobias Grosser wrote:

Regarding patch one and three: We already have the directory
test/CodeGen and test/IslCodeGen. I propose to just leave the CLooG test
cases in test/CodeGen, but to run them conditionally.

I only know how to disable the test of a full directory, so if you want I can
disable all the CodeGen directory (and subdirectories) when Cloog is not
available. Note that in my first patch I have moved only those tests not
working without cloog, and there are several testcases left in CodeGen that can
still be executed with ISL's codegen.

I did not realize there are tests that work for both.
What are those tests doing?

You can add the new isl test cases to test/IslCodeGen.

That's what patch 3 does, except for a minor rename to avoid a redundant CodeGen
in the dir names.

I was basically aiming for having one test directory for one LLVM-IR pass. Instead of having shared test cases, I would rather copy those tests to the isl directory.

Cheers
Tobi

Tobias Grosser wrote:

>Tobias Grosser wrote:
>>Regarding patch one and three: We already have the directory
>>test/CodeGen and test/IslCodeGen. I propose to just leave the CLooG test
>>cases in test/CodeGen, but to run them conditionally.
>
>I only know how to disable the test of a full directory, so if you want I can
>disable all the CodeGen directory (and subdirectories) when Cloog is not
>available. Note that in my first patch I have moved only those tests not
>working without cloog, and there are several testcases left in CodeGen that can
>still be executed with ISL's codegen.

I did not realize there are tests that work for both.
What are those tests doing?

Here is what is left in my CodeGen dir:

polly/test/CodeGen$ find . -name '*.ll'
./20100708.ll
./single_loop_ull_max_iterations.ll
./single_loop_uint_max_iterations.ll
./reduction.ll
./single_do_loop_one_iteration.ll
./OpenMP/20120330-argument-use.ll
./OpenMP/simple_nested_loop.ll
./OpenMP/structnames.ll
./OpenMP/parallel_loop_simple2.ll
./OpenMP/copy_in_temporary.ll
./OpenMP/parallel_loop_simple.ll
./OpenMP/clastvar_after_parallel_loop.ll
./OpenMP/add_memref.ll
./OpenMP/copy_in_argument.ll
./OpenMP/invalidate_subfn_scops.ll
./OpenMP/two_loop.ll
./OpenMP/parallel_loop.ll
./OpenMP/param_referenced_in_stmt.ll
./OpenMP/extract_memref.ll
./scev.ll
./single_do_loop_int_param_iterations.ll
./MemAccess/simple_analyze.ll
./MemAccess/simple.ll
./20110312-Fail-without-basicaa.ll
./GPGPU/3d_innermost_non_parallel.ll
./GPGPU/2d_innermost_parallel.ll
./test.ll

The OpenMP ones are already guarded with have_cloog, and the GPGPU ones are also
guarded.

I could move all these except OpenMP/GPGPU to the Cloog/CodeGen dir.

>>You can add the new isl test cases to test/IslCodeGen.
>>
>
>That's what patch 3 does, except for a minor rename to avoid a redundant CodeGen
>in the dir names.

I was basically aiming for having one test directory for one LLVM-IR
pass. Instead of having shared test cases, I would rather copy those
tests to the isl directory.

Then let's not use CodeGen for the Cloog code gen dir. I have used
Cloog/CodeGen and Isl/CodeGen and I think this is consistent with what you want.

I can then move the remaining tests in Cloog/CodeGen and duplicate them in
Isl/CodeGen. What do you think?

Sebastian

Tobias Grosser wrote:

Tobias Grosser wrote:

Regarding patch one and three: We already have the directory
test/CodeGen and test/IslCodeGen. I propose to just leave the CLooG test
cases in test/CodeGen, but to run them conditionally.

I only know how to disable the test of a full directory, so if you want I can
disable all the CodeGen directory (and subdirectories) when Cloog is not
available. Note that in my first patch I have moved only those tests not
working without cloog, and there are several testcases left in CodeGen that can
still be executed with ISL's codegen.

I did not realize there are tests that work for both.
What are those tests doing?

Here is what is left in my CodeGen dir:

polly/test/CodeGen$ find . -name '*.ll'
./20100708.ll
./single_loop_ull_max_iterations.ll
./single_loop_uint_max_iterations.ll
./reduction.ll
./single_do_loop_one_iteration.ll
./OpenMP/20120330-argument-use.ll
./OpenMP/simple_nested_loop.ll
./OpenMP/structnames.ll
./OpenMP/parallel_loop_simple2.ll
./OpenMP/copy_in_temporary.ll
./OpenMP/parallel_loop_simple.ll
./OpenMP/clastvar_after_parallel_loop.ll
./OpenMP/add_memref.ll
./OpenMP/copy_in_argument.ll
./OpenMP/invalidate_subfn_scops.ll
./OpenMP/two_loop.ll
./OpenMP/parallel_loop.ll
./OpenMP/param_referenced_in_stmt.ll
./OpenMP/extract_memref.ll
./scev.ll
./single_do_loop_int_param_iterations.ll
./MemAccess/simple_analyze.ll
./MemAccess/simple.ll
./20110312-Fail-without-basicaa.ll
./GPGPU/3d_innermost_non_parallel.ll
./GPGPU/2d_innermost_parallel.ll
./test.ll
The OpenMP ones are already guarded with have_cloog, and the GPGPU ones are also
guarded.

OK thanks. Most of them do not check the output, but rather the absence of a crash.

I could move all these except OpenMP/GPGPU to the Cloog/CodeGen dir.

You can add the new isl test cases to test/IslCodeGen.

That's what patch 3 does, except for a minor rename to avoid a redundant CodeGen
in the dir names.

I was basically aiming for having one test directory for one LLVM-IR
pass. Instead of having shared test cases, I would rather copy those
tests to the isl directory.

Then let's not use CodeGen for the Cloog code gen dir. I have used
Cloog/CodeGen and Isl/CodeGen and I think this is consistent with what you want.

I can then move the remaining tests in Cloog/CodeGen and duplicate them in
Isl/CodeGen. What do you think?

Fine with me (You probably just need to copy the remaining tests in the top level directory).

Tobi

Tobias Grosser wrote:

>I can then move the remaining tests in Cloog/CodeGen and duplicate them in
>Isl/CodeGen. What do you think?

Fine with me (You probably just need to copy the remaining tests in
the top level directory).

Ok, so I moved the OpenMP, GPGPU, and MemAccess dirs to the toplevel
polly/test/{OpenMP,GPGPU,MemAccess} and then the remaining testcases to
polly/test/Isl as that is executed both with and without Cloog.

Sebastian

Tobias Grosser wrote:

I can then move the remaining tests in Cloog/CodeGen and duplicate them in
Isl/CodeGen. What do you think?

Fine with me (You probably just need to copy the remaining tests in
the top level directory).

Ok, so I moved the OpenMP, GPGPU, and MemAccess dirs to the toplevel
polly/test/{OpenMP,GPGPU,MemAccess} and then the remaining testcases to

Those are all cloog specific code generation tests. Please leave them as subdirectories of the cloog directory.

polly/test/Isl as that is executed both with and without Cloog.

OK.

Cheers
Tobi

Tobias Grosser wrote:

>Tobias Grosser wrote:
>>>I can then move the remaining tests in Cloog/CodeGen and duplicate them in
>>>Isl/CodeGen. What do you think?
>>
>>Fine with me (You probably just need to copy the remaining tests in
>>the top level directory).
>
>Ok, so I moved the OpenMP, GPGPU, and MemAccess dirs to the toplevel
>polly/test/{OpenMP,GPGPU,MemAccess} and then the remaining testcases to

Ok, when we will have the OpenMP working with ISL codegen, we will adapt these
testcases for Isl.

Also note that all the vectorizer testcases will be in the Cloog test dir for
now. When you submit the vectorizer Isl codegen, please copy them to the Isl
test dir.

Thanks,
Sebastian

Yes, I will do that.

Tobi