On 17/07/2014 16:08, Roman Gareev wrote:
I see. Could you use vec_safe_grow_cleared(iv_map, loop_num) instead?
>This shows probably better that you zero initialize the vector.
If I am not mistaken, vec_safe_grow_cleared has the following declaration:
vec_safe_grow_cleared (vec<T, A, vl_embed> *&v, unsigned len CXX_MEM_STAT_INFO)
Should we rewrite all the functions, which interact with iv_map?
Can you explain why all functions would need to be rewritten? I proposed
this function as an easier way to NULL initialize the vector and did not
expect any rewrite to be necessary.
If there is no such thing, please just add a comment that your loop NULL
initializes the vector. We can later improve this.
I've added test cases, which produce the following ISL code:
isl-ast-gen-single-loop-1.c
for (int c1 = 0; c1 <= 49; c1 += 1)
S_3(c1);
isl-ast-gen-single-loop-2.c
for (int c1 = 0; c1 <= -n.0 + 69; c1 += 1)
S_5(c1);
isl-ast-gen-single-loop-3.c
for (int c1 = 0; c1 < n.0; c1 += 1)
S_5(c1);
The second and the third one use arrays. I wanted to make them similar
to the first one, but inability to handle blocks prevented this. For
example,
OK. The tests look good.
Cheers,
Tobias