periscop / cloog

The CLooG Code Generator in the Polyhedral Model
GNU Lesser General Public License v2.1
40 stars 23 forks source link

support for isl-0.19 #38

Closed ftynse closed 6 years ago

ftynse commented 6 years ago

Replace uses of deprecated isl functions that get removed in isl-0.19

Closes #37

doko42 commented 6 years ago

this patch is not yet complete. libtool: link: gcc -shared -fPIC -DPIC source/.libs/libcloog_isl_la-block.o source/.libs/libcloog_isl_la-clast.o source/.libs/libcloog_isl_la-matrix.o source/.libs/libcloog_isl_la-state.o source/.libs/libcloog_isl_la-input.o source/.libs/libcloog_isl_la-int.o source/.libs/libcloog_isl_la-loop.o source/.libs/libcloog_isl_la-names.o source/.libs/libcloog_isl_la-options.o source/.libs/libcloog_isl_la-pprint.o source/.libs/libcloog_isl_la-program.o source/.libs/libcloog_isl_la-statement.o source/.libs/libcloog_isl_la-stride.o source/.libs/libcloog_isl_la-union_domain.o source/.libs/libcloog_isl_la-util.o source/.libs/libcloog_isl_la-version.o source/isl/.libs/libcloog_isl_la-domain.o source/isl/.libs/libcloog_isl_la-constraints.o source/isl/.libs/libcloog_isl_la-backend.o -L/lib -lisl -lgmp -g -O2 -fstack-protector-strong -Wl,-Bsymbolic-functions -Wl,-z -Wl,relro -Wl,-z -Wl,defs -Wl,-soname -Wl,libcloog-isl.so.4 -o .libs/libcloog-isl.so.4.0.0 source/isl/.libs/libcloog_isl_la-constraints.o: In function cloog_constraint_set_drop_constraint': ./source/isl/constraints.c:648: undefined reference toisl_basic_set_drop_constraint' collect2: error: ld returned 1 exit status Makefile:725: recipe for target 'libcloog-isl.la' failed make[2]: *** [libcloog-isl.la] Error 1

ftynse commented 6 years ago

that is why there is a WIP (work in progress) tag in its name.

On 12/03/2018 10:12, Matthias Klose wrote:

this patch is not yet complete. libtool: link: gcc -shared -fPIC -DPIC source/.libs/libcloog_isl_la-block.o source/.libs/libcloog_isl_la-clast.o source/.libs/libcloog_isl_la-matrix.o source/.libs/libcloog_isl_la-state.o source/.libs/libcloog_isl_la-input.o source/.libs/libcloog_isl_la-int.o source/.libs/libcloog_isl_la-loop.o source/.libs/libcloog_isl_la-names.o source/.libs/libcloog_isl_la-options.o source/.libs/libcloog_isl_la-pprint.o source/.libs/libcloog_isl_la-program.o source/.libs/libcloog_isl_la-statement.o source/.libs/libcloog_isl_la-stride.o source/.libs/libcloog_isl_la-union_domain.o source/.libs/libcloog_isl_la-util.o source/.libs/libcloog_isl_la-version.o source/isl/.libs/libcloog_isl_la-domain.o source/isl/.libs/libcloog_isl_la-constraints.o source/isl/.libs/libcloog_isl_la-backend.o -L/lib -lisl -lgmp -g -O2 -fstack-protector-strong -Wl,-Bsymbolic-functions -Wl,-z -Wl,relro -Wl,-z -Wl,defs -Wl,-soname -Wl,libcloog-isl.so.4 -o .libs/libcloog-isl.so.4.0.0 source/isl/.libs/libcloog_isl_la-constraints.o: In function |cloog_constraint_set_drop_constraint': ./source/isl/constraints.c:648: undefined reference to|isl_basic_set_drop_constraint' collect2: error: ld returned 1 exit status Makefile:725: recipe for target 'libcloog-isl.la' failed make[2]: *** [libcloog-isl.la] Error 1

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/periscop/cloog/pull/38#issuecomment-372239484, or mute the thread https://github.com/notifications/unsubscribe-auth/ABcTa3peVAdmF-CBQAaeF74lh4ryVNXyks5tdjv5gaJpZM4Sd5Hy.

harenome commented 6 years ago

Have a look at my update-isl branch. The make test_hybrid target passes albeit a few warnings. Commit 0ca1b109beffe6598d747e772e923b7c76a6ae7a should not be cherry-picked.

Commit 659f9cee6cbaa17dad16afa94c8e26e77e76629e introduces a first (incomplete) attempt at removing the isl_basic_set_drop_constraint() function: we iterate over the constraint in the basic set and construct a new one with the constraints that differ from the constraint of interest.

At first, the resulting basic set seems to be what we expect. However, it causes constraint_cloog_dim_to_isl_dim() to fail (hence the temporary commit 0ca1b109beffe6598d747e772e923b7c76a6ae7a: isl and cloog seem to luckily cope with this horrendous unitialized return, at least for the test cases). It would seem some existentially quantified variables are missing.

ftynse commented 6 years ago

Yeah, I tried removing isl_basic_set_drop_constraint in different ways without success and then ran out of time... The conceptual problem is that CLooG uses basic_set as a list of constraints, but it is not exactly a list since isl applies simplification rules on them.

ftynse commented 6 years ago

in particular, isl removes existentially quantified dimensions that are no longer involved in constraints automatically, but CLooG assumes they are still there. This was not happening with drop constraint, but seems to happen with any other method I tried so far. One solution would be to keep a pair isl_basic_set, isl_local_space and use the space for dimension index conversion, but this looks too heavy. One thing I did not try was transforming a basic set into a matrix of constraints, removing one line, and transforming the matrix back into the set.

harenome commented 6 years ago

I have updated my update-isl branch. If anyone already pulled this branch, please be aware that I used git push --force to update the branch.

I added a default return value for constraint_cloog_dim_to_isl_dim() in commit da7dac8e1f5f92150246d28431ddab92bde8a4d3 and handled the special value where required.

All tests except test/isl/jacobi-shared.cloog pass. For this particular test, CLooG does not seem to terminate anymore if the -sh 1 option is not passed. (-sh: Compute actual convex hull) Note @Syllo: this option should have been passed to generate_test_advanced when using the make test_hybrid target but it does not terminate. It would seem generate_test_advanced does not get the special options, are the options actually passed? We may need to fix this as well.

Syllo commented 6 years ago

@harenome Indeed, the ClooG options were not passed to generate_test_adavanced. Fix available on this branch. Please try with these two commits.

harenome commented 6 years ago

@Syllo: The tests pass. Shall we merge all of these commits?

ftynse commented 6 years ago

Can you guys push on top of this branch?

ftynse commented 6 years ago

We also need to bump isl submodule

harenome commented 6 years ago

Just pushed everything on top of this branch. I had already updated the submodule.

ftynse commented 6 years ago

@doko42 could you please confirm that the problem is solved for you?