On Tue, Jul 26, 2011 at 09:34, Richard Guenther <rguent...@suse.de> wrote: > Truncating -1 doesn't matter - it matters that if you perform any > unsigned arithmetic in arbitrary precision signed arithmetic that > you properly truncate after each operation to simulate unsigned > twos-complement wrapping semantic. And if you did that you wouldn't > need to sign-extend -1U either.
Ok, so I guess that the type of the expression that we generate from Graphite should be, as the original expression, of unsigned type. In the previous example, > for (scat_3=0;scat_3<=4294967295*scat_1+T_51-1;scat_3++) { > S6(scat_1,scat_3); > } this is still valid if the type of "4294967295*scat_1" is unsigned. That would fix only -fgraphite-identity: we also have to watch out for operations on the polyhedral representation that would use -1U in other computations, and here I'm thinking about everything we have implemented on the polyhedral representation: dependence test, counting the number of points, i.e., all the heuristics, etc. When disabling Graphite on all unsigned niter expressions, we get the following fails: FAIL: gcc.dg/graphite/scop-0.c scan-tree-dump-times graphite "number of SCoPs: 1" 1 FAIL: gcc.dg/graphite/scop-1.c scan-tree-dump-times graphite "number of SCoPs: 3" 1 FAIL: gcc.dg/graphite/scop-10.c scan-tree-dump-times graphite "number of SCoPs: 3" 1 FAIL: gcc.dg/graphite/scop-11.c scan-tree-dump-times graphite "number of SCoPs: 3" 1 FAIL: gcc.dg/graphite/scop-12.c scan-tree-dump-times graphite "number of SCoPs: 5" 1 FAIL: gcc.dg/graphite/scop-13.c scan-tree-dump-times graphite "number of SCoPs: 2" 1 FAIL: gcc.dg/graphite/scop-16.c scan-tree-dump-times graphite "number of SCoPs: 2" 1 FAIL: gcc.dg/graphite/scop-17.c scan-tree-dump-times graphite "number of SCoPs: 2" 1 FAIL: gcc.dg/graphite/scop-18.c scan-tree-dump-times graphite "number of SCoPs: 2" 1 FAIL: gcc.dg/graphite/scop-2.c scan-tree-dump-times graphite "number of SCoPs: 4" 1 FAIL: gcc.dg/graphite/scop-20.c scan-tree-dump-times graphite "number of SCoPs: 2" 1 FAIL: gcc.dg/graphite/scop-21.c scan-tree-dump-times graphite "number of SCoPs: 1" 1 FAIL: gcc.dg/graphite/scop-22.c scan-tree-dump-times graphite "number of SCoPs: 1" 1 FAIL: gcc.dg/graphite/scop-3.c scan-tree-dump-times graphite "number of SCoPs: 1" 1 FAIL: gcc.dg/graphite/scop-4.c scan-tree-dump-times graphite "number of SCoPs: 2" 1 FAIL: gcc.dg/graphite/scop-5.c scan-tree-dump-times graphite "number of SCoPs: 3" 1 FAIL: gcc.dg/graphite/scop-6.c scan-tree-dump-times graphite "number of SCoPs: 3" 1 FAIL: gcc.dg/graphite/scop-7.c scan-tree-dump-times graphite "number of SCoPs: 3" 1 FAIL: gcc.dg/graphite/scop-8.c scan-tree-dump-times graphite "number of SCoPs: 2" 1 FAIL: gcc.dg/graphite/scop-9.c scan-tree-dump-times graphite "number of SCoPs: 2" 1 FAIL: gcc.dg/graphite/scop-dsyr2k.c scan-tree-dump-times graphite "number of SCoPs: 1" 1 FAIL: gcc.dg/graphite/scop-dsyrk.c scan-tree-dump-times graphite "number of SCoPs: 1" 1 FAIL: gcc.dg/graphite/scop-matmult.c scan-tree-dump-times graphite "number of SCoPs: 1" 1 FAIL: gcc.dg/graphite/scop-mvt.c scan-tree-dump-times graphite "number of SCoPs: 2" 1 FAIL: gcc.dg/graphite/scop-sor.c scan-tree-dump-times graphite "number of SCoPs: 1" 1 FAIL: gcc.dg/graphite/interchange-0.c scan-tree-dump-times graphite "will be interchanged" 1 FAIL: gcc.dg/graphite/interchange-1.c scan-tree-dump-times graphite "will be interchanged" 1 FAIL: gcc.dg/graphite/interchange-10.c scan-tree-dump-times graphite "will be interchanged" 2 FAIL: gcc.dg/graphite/interchange-11.c scan-tree-dump-times graphite "will be interchanged" 1 FAIL: gcc.dg/graphite/interchange-12.c scan-tree-dump-times graphite "will be interchanged" 1 FAIL: gcc.dg/graphite/interchange-13.c scan-tree-dump-times graphite "will be interchanged" 1 FAIL: gcc.dg/graphite/interchange-3.c scan-tree-dump-times graphite "will be interchanged" 1 FAIL: gcc.dg/graphite/interchange-4.c scan-tree-dump-times graphite "will be interchanged" 1 FAIL: gcc.dg/graphite/interchange-5.c scan-tree-dump-times graphite "will be interchanged" 1 FAIL: gcc.dg/graphite/interchange-6.c scan-tree-dump-times graphite "will be interchanged" 1 FAIL: gcc.dg/graphite/interchange-7.c scan-tree-dump-times graphite "will be interchanged" 1 FAIL: gcc.dg/graphite/interchange-8.c scan-tree-dump-times graphite "will be interchanged" 2 FAIL: gcc.dg/graphite/interchange-9.c scan-tree-dump-times graphite "will be interchanged" 1 FAIL: gcc.dg/graphite/block-1.c scan-tree-dump-times graphite "will be loop blocked" 3 FAIL: gcc.dg/graphite/block-5.c scan-tree-dump-times graphite "will be loop blocked" 1 FAIL: gcc.dg/graphite/vect-pr43423.c scan-tree-dump-times vect "vectorized 2 loops" 1 FAIL: gcc.dg/graphite/pr35356-1.c scan-tree-dump-times graphite "loop_1" 0 FAIL: gcc.dg/graphite/pr35356-2.c scan-tree-dump-times graphite "MIN_EXPR" 4 FAIL: gcc.dg/graphite/pr35356-2.c scan-tree-dump-times graphite "MAX_EXPR" 4 FAIL: gfortran.dg/graphite/interchange-3.f90 -O scan-tree-dump-times graphite "will be interchanged" 1 FAIL: gfortran.dg/graphite/block-1.f90 -O scan-tree-dump-times graphite "number of SCoPs: 1" 1 FAIL: gfortran.dg/graphite/block-2.f -O scan-tree-dump-times graphite "number of SCoPs: 2" 1 FAIL: libgomp.graphite/bounds.c scan-tree-dump-times graphite "0 loops carried no dependency" 1 FAIL: libgomp.graphite/force-parallel-1.c scan-tree-dump-times graphite "1 loops carried no dependency" 2 FAIL: libgomp.graphite/force-parallel-1.c scan-tree-dump-times optimized "loopfn" 5 FAIL: libgomp.graphite/force-parallel-2.c scan-tree-dump-times graphite "2 loops carried no dependency" 2 FAIL: libgomp.graphite/force-parallel-2.c scan-tree-dump-times optimized "loopfn" 5 FAIL: libgomp.graphite/force-parallel-3.c scan-tree-dump-times graphite "4 loops carried no dependency" 1 FAIL: libgomp.graphite/force-parallel-3.c scan-tree-dump-times optimized "loopfn.0" 5 FAIL: libgomp.graphite/force-parallel-3.c scan-tree-dump-times optimized "loopfn.1" 5 FAIL: libgomp.graphite/force-parallel-4.c scan-tree-dump-times graphite "2 loops carried no dependency" 1 FAIL: libgomp.graphite/force-parallel-4.c scan-tree-dump-times optimized "loopfn.0" 5 FAIL: libgomp.graphite/force-parallel-4.c scan-tree-dump-times optimized "loopfn.1" 5 FAIL: libgomp.graphite/force-parallel-5.c scan-tree-dump-times graphite "2 loops carried no dependency" 1 FAIL: libgomp.graphite/force-parallel-5.c scan-tree-dump-times optimized "loopfn.0" 5 FAIL: libgomp.graphite/force-parallel-5.c scan-tree-dump-times optimized "loopfn.1" 5 FAIL: libgomp.graphite/force-parallel-6.c scan-tree-dump-times graphite "1 loops carried no dependency" 1 FAIL: libgomp.graphite/force-parallel-6.c scan-tree-dump-times optimized "loopfn.0" 5 FAIL: libgomp.graphite/force-parallel-7.c scan-tree-dump-times graphite "3 loops carried no dependency" 1 FAIL: libgomp.graphite/force-parallel-7.c scan-tree-dump-times optimized "loopfn.0" 5 FAIL: libgomp.graphite/force-parallel-8.c scan-tree-dump-times graphite "2 loops carried no dependency" 1 FAIL: libgomp.graphite/force-parallel-8.c scan-tree-dump-times optimized "loopfn.0" 5 FAIL: libgomp.graphite/force-parallel-8.c scan-tree-dump-times optimized "loopfn.1" 5 FAIL: libgomp.graphite/force-parallel-9.c scan-tree-dump-times graphite "4 loops carried no dependency" 1 FAIL: libgomp.graphite/force-parallel-9.c scan-tree-dump-times optimized "loopfn.0" 5 FAIL: libgomp.graphite/force-parallel-9.c scan-tree-dump-times optimized "loopfn.1" 5 So the only solution that I can see is to implement the niter analysis as the resolution of a constraint system, and that would avoid creating the unsigned expressions. Sebastian