On 26/07/2014 15:48, Roman Gareev wrote:
What do you mean by wrong answer? Is there still a bug in the code
generation or the AST is just more complex as expected.
I mean that the value of res is wrong. I think it is because of the
wrong id of pbb->domain and pbb->transformed inherited from S_3 by S_9
(It was correct for S_3, but it is incorrect for S_9).
Sorry Roman. I am still confused. Are we looking for a test case or are
we still trying to understand an issue. Specifically, do we still
incorrectly transform the code even after your isl_id_for_pbb() patch?
To my understanding bb copies are introduced in case reductions are seen.
You could try to just initialize an array (maybe a little bit more complex,
but without += statements):
for i:
A[i] = ...
You could do the summation/verfication outside of the scop e.g. in the main
function.
It seems that it doesn't help (at least for now).
Help for what? I was looking to create a simple test case. Is there
still an open bug?
I am looking for a simple test case that does _not_ contain a reduction
in addition to the test case you already have.
However, I've found out the following example:
static int __attribute__((noinline))
foo ()
{
int i, res = 0;
for (i = 0; i < 50; i++)
{
if (i < 5)
res += 1;
}
This one still has a reduction.
It gives the correct result, inspite of duplicating of pbbs and
generates the following ISL AST
{
for (int c1 = 0; c1 <= 49; c1 += 1) {
for (int c2 = 0; c2 <= 1; c2 += 1)
S_3(c1);
if (c1 <= 4)
S_4(c1);
S_5(c1);
}
S_7();
And this one still duplicates pbbs. So this is not the simple test case
I am looking for. It introduces several new statements I do not
understand, so it does not seem to be a trivial test case.
Maybe we could use it. What do you think about this?
What do you want to use it for?
Cheers,
Tobias