Hi guys, These are couple of patches for Graphite-OpenCL.
First patch fixes lack of MINUS_EXPR processing in OpenCL kernel code generation. The second one fixed VEC related issue, which caused ISE on some tests from NPB (NASA parallel benchmark).
ChangeLogs: [1] * graphite-opencl-codegen.c (opencl_print_operand): Handle MINUS_EXPR in OpenCL kernel code generation. [2] * graphite-opencl.c (opencl_postpass_data): Use correct vectors for processing postpass data in opencl_postpass_data -- Alexey Kravets mr.kayr...@gmail.com
* graphite-opencl.c (opencl_postpass_data): Use correct vectors for processing postpass data in opencl_postpass_data. diff --git a/gcc/graphite-opencl.c b/gcc/graphite-opencl.c index e118d17..7e2dac6 100644 --- a/gcc/graphite-opencl.c +++ b/gcc/graphite-opencl.c @@ -1990,16 +1990,13 @@ opencl_postpass_data (opencl_main code_gen, opencl_clast_meta meta) if (meta->parent) { - VEC (opencl_data, heap) *parent_vec_host - = meta->parent->post_pass_to_host; - VEC (opencl_data, heap) *parent_vec_device - = meta->parent->post_pass_to_device; - FOR_EACH_VEC_ELT (opencl_data, meta->post_pass_to_host, i, curr) - VEC_safe_push (opencl_data, heap, parent_vec_host, curr); + VEC_safe_push (opencl_data, heap, meta->parent->post_pass_to_host, + curr); FOR_EACH_VEC_ELT (opencl_data, meta->post_pass_to_device, i, curr) - VEC_safe_push (opencl_data, heap, parent_vec_device, curr); + VEC_safe_push (opencl_data, heap, meta->parent->post_pass_to_device, + curr); } VEC_free (opencl_data, heap, meta->post_pass_to_host);
* graphite-opencl-codegen.c (opencl_print_operand): Handle MINUS_EXPR in OpenCL kernel code generation. diff --git a/gcc/graphite-opencl-codegen.c b/gcc/graphite-opencl-codegen.c index 450eded..e7a8703 100644 --- a/gcc/graphite-opencl-codegen.c +++ b/gcc/graphite-opencl-codegen.c @@ -1146,6 +1146,20 @@ opencl_print_operand (tree node, bool lhs, opencl_main code_gen) opencl_append_string_to_body (")", code_gen); return 0; } + case MINUS_EXPR: + { + if (lhs) + return -1; + + opencl_append_string_to_body ("(", code_gen); + opencl_print_operand (TREE_OPERAND (node, 0), false, code_gen); + opencl_append_string_to_body (" - ", code_gen); + opencl_print_operand (TREE_OPERAND (node, 1), false, code_gen); + opencl_append_string_to_body (")", code_gen); + return 0; + } + + case MULT_EXPR: {