aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/array-notation-common.c
diff options
context:
space:
mode:
authorJulia Koval <julia.koval@intel.com>2017-11-28 11:35:37 +0100
committerJulia Koval <jkoval@gcc.gnu.org>2017-11-28 11:35:37 +0100
commit5e9d6aa4c2fd245837ec26de1d01ee8eb7786af3 (patch)
tree193e05dc5baa657f44264efe9cf165e8572a0ccc /gcc/c-family/array-notation-common.c
parent1be49a38e45a80d1ee6854f262c94abeb621dfda (diff)
downloadgcc-5e9d6aa4c2fd245837ec26de1d01ee8eb7786af3.zip
gcc-5e9d6aa4c2fd245837ec26de1d01ee8eb7786af3.tar.gz
gcc-5e9d6aa4c2fd245837ec26de1d01ee8eb7786af3.tar.bz2
Remove Cilk Plus support.
* Makefile.def (target_modules): Remove libcilkrts. * Makefile.in: Ditto. * configure: Ditto. * configure.ac: Ditto. contrib/ * contrib/gcc_update: Ditto. gcc/ * Makefile.in (cilkplus.def, cilk-builtins.def, c-family/cilk.o, c-family/c-cilkplus.o, c-family/array-notation-common.o, cilk-common.o, cilk.h, cilk-common.c): Remove. * builtin-types.def (BT_FN_INT_PTR_PTR_PTR_FTYPE_BT_INT_BT_PTR_BT_PTR_BT_PTR): Remove. * builtins.c (is_builtin_name): Remove cilkplus condition. (BUILT_IN_CILK_DETACH, BUILT_IN_CILK_POP_FRAME): Remove. * builtins.def (DEF_CILK_BUILTIN_STUB, DEF_CILKPLUS_BUILTIN, cilk-builtins.def, cilkplus.def): Remove. * cif-code.def (CILK_SPAWN): Remove. * cilk-builtins.def: Delete. * cilk-common.c: Ditto. * cilk.h: Ditto. * cilkplus.def: Ditto. * config/darwin.h (fcilkplus): Delete. * cppbuiltin.c: Ditto. * doc/extend.texi: Remove cilkplus doc. * doc/generic.texi: Ditto. * doc/invoke.texi: Ditto. * doc/passes.texi: Ditto. * gcc.c (fcilkplus): Remove. * gengtype.c (cilk.h): Remove. * gimple-pretty-print.c (dump_gimple_omp_for): Remove cilkplus support. * gimple.h (GF_OMP_FOR_KIND_CILKFOR, GF_OMP_FOR_KIND_CILKSIMD): Remove. * gimplify.c (gimplify_return_expr, maybe_fold_stmt, gimplify_call_expr, is_gimple_stmt, gimplify_modify_expr, gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses, gimplify_omp_for, gimplify_expr): Remove cilkplus conditions. * ipa-fnsummary.c (ipa_dump_fn_summary, compute_fn_summary, inline_read_section): Ditto. * ipa-inline-analysis.c (cilk.h): Remove. * ira.c (ira_setup_eliminable_regset): Remove cilkplus support. * lto-wrapper.c (merge_and_complain, append_compiler_options, append_linker_options): Remove condition for fcilkplus. * lto/lto-lang.c (cilk.h): Remove. (lto_init): Remove condition for fcilkplus. * omp-expand.c (expand_cilk_for_call): Delete. (expand_omp_taskreg, expand_omp_for_static_chunk, expand_omp_for): Remove cilkplus conditions. (expand_cilk_for): Delete. * omp-general.c (omp_extract_for_data): Remove cilkplus support. * omp-low.c (scan_sharing_clauses, create_omp_child_function, execute_lower_omp, diagnose_sb_0): Ditto. * omp-simd-clone.c (simd_clone_clauses_extract): Ditto. * tree-core.h (OMP_CLAUSE__CILK_FOR_COUNT_): Delete. * tree-nested.c: Ditto. * tree-pretty-print.c (dump_omp_clause): Remove cilkplus support. (dump_generic_node): Ditto. * tree.c (OMP_CLAUSE__CILK_FOR_COUNT_): Delete. * tree.def (cilk_simd, cilk_for, cilk_spawn_stmt, cilk_sync_stmt): Delete. * tree.h (CILK_SPAWN_FN, EXPR_CILK_SPAWN): Delete. gcc/c-family/ * array-notation-common.c: Delete. * c-cilkplus.c: Ditto. * c-common.c (_Cilk_spawn, _Cilk_sync, _Cilk_for): Remove. * c-common.def (ARRAY_NOTATION_REF): Remove. * c-common.h (RID_CILK_SPAWN, build_array_notation_expr, build_array_notation_ref, C_ORT_CILK, c_check_cilk_loop, c_validate_cilk_plus_loop, cilkplus_an_parts, cilk_ignorable_spawn_rhs_op, cilk_recognize_spawn): Remove. * c-gimplify.c (CILK_SPAWN_STMT): Remove. * c-omp.c: Remove CILK_SIMD check. * c-pragma.c: Ditto. * c-pragma.h: Remove CILK related pragmas. * c-pretty-print.c (c_pretty_printer::postfix_expression): Remove ARRAY_NOTATION_REF condition. (c_pretty_printer::expression): Ditto. * c.opt (fcilkplus): Remove. * cilk.c: Delete. gcc/c/ * Make-lang.in (c/c-array-notation.o): Remove. * c-array-notation.c: Delete. * c-decl.c: Remove cilkplus condition. * c-parser.c (c_parser_cilk_simd, c_parser_cilk_for, c_parser_cilk_verify_simd, c_parser_array_notation, c_parser_cilk_clause_vectorlength, c_parser_cilk_grainsize, c_parser_cilk_simd_fn_vector_attrs, c_finish_cilk_simd_fn_tokens): Delete. (c_parser_declaration_or_fndef): Remove cilkplus condition. (c_parser_direct_declarator_inner): Ditto. (CILK_SIMD_FN_CLAUSE_MASK): Delete. (c_parser_attributes, c_parser_compound_statement, c_parser_statement_after_labels, c_parser_if_statement, c_parser_switch_statement, c_parser_while_statement, c_parser_do_statement, c_parser_for_statement, c_parser_unary_expression, c_parser_postfix_expression, c_parser_postfix_expression_after_primary, c_parser_pragma, c_parser_omp_clause_name, c_parser_omp_all_clauses, c_parser_omp_for_loop, c_finish_omp_declare_simd): Remove cilkplus support. * c-typeck.c (build_array_ref, build_function_call_vec, convert_arguments, lvalue_p, build_compound_expr, c_finish_return, c_finish_if_stmt, c_finish_loop, build_binary_op): Remove cilkplus support. gcc/cp/ * Make-lang.in (cp/cp-array-notation.o, cp/cp-cilkplus.o): Delete. * call.c (convert_for_arg_passing, build_cxx_call): Remove cilkplus. * constexpr.c (potential_constant_expression_1): Ditto. * cp-array-notation.c: Delete. * cp-cilkplus.c: Ditto. * cp-cilkplus.h: Ditto. * cp-gimplify.c (cp_gimplify_expr, cp_fold_r, cp_genericize): Remove cilkplus condition. * cp-objcp-common.c (ARRAY_NOTATION_REF): Delete. * cp-tree.h (cilkplus_an_triplet_types_ok_p): Delete. * decl.c (grokfndecl, finish_function): Remove cilkplus condition. * error.c (dump_decl, dump_expr): Remove ARRAY_NOTATION_REF condition. * lambda.c (cp-cilkplus.h): Remove. * parser.c (cp_parser_cilk_simd, cp_parser_cilk_for, cp_parser_cilk_simd_vectorlength): Delete. (cp_debug_parser, cp_parser_ctor_initializer_opt_and_function_body, cp_parser_postfix_expression, cp_parser_postfix_open_square_expression, cp_parser_statement, cp_parser_jump_statement, cp_parser_direct_declarator, cp_parser_late_return_type_opt, cp_parser_gnu_attribute_list, cp_parser_omp_clause_name, cp_parser_omp_clause_aligned, cp_parser_omp_clause_linear, cp_parser_omp_all_clauses, cp_parser_omp_flush, cp_parser_omp_for_cond, cp_parser_omp_for_incr, cp_parser_omp_for_loop_init, cp_parser_omp_for_loop, cp_parser_omp_declare_simd): Remove cilkplus support. (CILK_SIMD_FN_CLAUSE_MASK, cp_parser_late_parsing_cilk_simd_fn_info, cp_parser_cilk_grainsize): Remove. (cp_parser_pragma, c_parse_file): Remove cilkplus support. (cp_parser_cilk_simd_vectorlength, cp_parser_cilk_simd_linear, cp_parser_cilk_simd_clause_name, cp_parser_cilk_simd_all_clauses, cp_parser_cilk_simd, cp_parser_cilk_for): Remove. * parser.h (IN_CILK_SIMD_FOR, IN_CILK_SPAWN): Remove. * pt.c (tsubst_attribute, tsubst_expr, tsubst_copy_and_build): Remove cilkplus support. * semantics.c (finish_goto_stmt, begin_while_stmt, finish_do_body, finish_init_stmt, finish_switch_cond, simplify_aggr_init_expr, finish_omp_clauses, finish_omp_clauses, finish_omp_for): Remove cilkplus support. * tree.c (lvalue_kind): Remove ARRAY_NOTATION_REF conditon. * typeck.c (cp_build_array_ref, cp_build_compound_expr, check_return_expr): Remove cilkplus support. gcc/testsuite/ * c-c++-common/attr-simd-3.c: Delete. * c-c++-common/cilk-plus/AN/an-if.c: Delete. * c-c++-common/cilk-plus/AN/array_test1.c: Delete. * c-c++-common/cilk-plus/AN/array_test2.c: Delete. * c-c++-common/cilk-plus/AN/array_test_ND.c: Delete. * c-c++-common/cilk-plus/AN/builtin_fn_custom.c: Delete. * c-c++-common/cilk-plus/AN/builtin_fn_mutating.c: Delete. * c-c++-common/cilk-plus/AN/builtin_func_double.c: Delete. * c-c++-common/cilk-plus/AN/builtin_func_double2.c: Delete. * c-c++-common/cilk-plus/AN/comma_exp.c: Delete. * c-c++-common/cilk-plus/AN/conditional.c: Delete. * c-c++-common/cilk-plus/AN/decl-ptr-colon.c: Delete. * c-c++-common/cilk-plus/AN/dimensionless-arrays.c: Delete. * c-c++-common/cilk-plus/AN/exec-once.c: Delete. * c-c++-common/cilk-plus/AN/exec-once2.c: Delete. * c-c++-common/cilk-plus/AN/fn_ptr-2.c: Delete. * c-c++-common/cilk-plus/AN/fn_ptr.c: Delete. * c-c++-common/cilk-plus/AN/fp_triplet_values.c: Delete. * c-c++-common/cilk-plus/AN/gather-scatter-errors.c: Delete. * c-c++-common/cilk-plus/AN/gather_scatter.c: Delete. * c-c++-common/cilk-plus/AN/if_test.c: Delete. * c-c++-common/cilk-plus/AN/if_test_errors.c: Delete. * c-c++-common/cilk-plus/AN/misc.c: Delete. * c-c++-common/cilk-plus/AN/n-ptr-test.c: Delete. * c-c++-common/cilk-plus/AN/parser_errors.c: Delete. * c-c++-common/cilk-plus/AN/parser_errors2.c: Delete. * c-c++-common/cilk-plus/AN/parser_errors3.c: Delete. * c-c++-common/cilk-plus/AN/parser_errors4.c: Delete. * c-c++-common/cilk-plus/AN/pr57457-2.c: Delete. * c-c++-common/cilk-plus/AN/pr57457.c: Delete. * c-c++-common/cilk-plus/AN/pr57490.c: Delete. * c-c++-common/cilk-plus/AN/pr57541-2.c: Delete. * c-c++-common/cilk-plus/AN/pr57541.c: Delete. * c-c++-common/cilk-plus/AN/pr57577.c: Delete. * c-c++-common/cilk-plus/AN/pr58942.c: Delete. * c-c++-common/cilk-plus/AN/pr61191.c: Delete. * c-c++-common/cilk-plus/AN/pr61455-2.c: Delete. * c-c++-common/cilk-plus/AN/pr61455.c: Delete. * c-c++-common/cilk-plus/AN/pr61962.c: Delete. * c-c++-common/cilk-plus/AN/pr61963.c: Delete. * c-c++-common/cilk-plus/AN/pr62008.c: Delete. * c-c++-common/cilk-plus/AN/pr63884.c: Delete. * c-c++-common/cilk-plus/AN/rank_mismatch.c: Delete. * c-c++-common/cilk-plus/AN/rank_mismatch2.c: Delete. * c-c++-common/cilk-plus/AN/rank_mismatch3.c: Delete. * c-c++-common/cilk-plus/AN/sec_implicit.c: Delete. * c-c++-common/cilk-plus/AN/sec_implicit2.c: Delete. * c-c++-common/cilk-plus/AN/sec_implicit_ex.c: Delete. * c-c++-common/cilk-plus/AN/sec_reduce_ind_same_value.c: Delete. * c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c: Delete. * c-c++-common/cilk-plus/AN/sec_reduce_return.c: Delete. * c-c++-common/cilk-plus/AN/side-effects-1.c: Delete. * c-c++-common/cilk-plus/AN/test_builtin_return.c: Delete. * c-c++-common/cilk-plus/AN/test_sec_limits.c: Delete. * c-c++-common/cilk-plus/AN/tst_lngth.c: Delete. * c-c++-common/cilk-plus/AN/vla.c: Delete. * c-c++-common/cilk-plus/CK/Wparentheses-1.c: Delete. * c-c++-common/cilk-plus/CK/cilk-for-2.c: Delete. * c-c++-common/cilk-plus/CK/cilk-for-3.c: Delete. * c-c++-common/cilk-plus/CK/cilk-fors.c: Delete. * c-c++-common/cilk-plus/CK/cilk_for_errors.c: Delete. * c-c++-common/cilk-plus/CK/cilk_for_grain.c: Delete. * c-c++-common/cilk-plus/CK/cilk_for_grain_errors.c: Delete. * c-c++-common/cilk-plus/CK/cilk_for_ptr_iter.c: Delete. * c-c++-common/cilk-plus/CK/compound_cilk_spawn.c: Delete. * c-c++-common/cilk-plus/CK/concec_cilk_spawn.c: Delete. * c-c++-common/cilk-plus/CK/errors.c: Delete. * c-c++-common/cilk-plus/CK/fib.c: Delete. * c-c++-common/cilk-plus/CK/fib_init_expr_xy.c: Delete. * c-c++-common/cilk-plus/CK/fib_no_return.c: Delete. * c-c++-common/cilk-plus/CK/fib_no_sync.c: Delete. * c-c++-common/cilk-plus/CK/invalid_spawns.c: Delete. * c-c++-common/cilk-plus/CK/invalid_sync.c: Delete.c * c-c++-common/cilk-plus/CK/nested_cilk_for.c: Delete. * c-c++-common/cilk-plus/CK/no_args_error.c: Delete. * c-c++-common/cilk-plus/CK/pr59631.c: Delete. * c-c++-common/cilk-plus/CK/pr60197-2.c: Delete. * c-c++-common/cilk-plus/CK/pr60197.c: Delete. * c-c++-common/cilk-plus/CK/pr60469.c: Delete. * c-c++-common/cilk-plus/CK/pr60586.c: Delete. * c-c++-common/cilk-plus/CK/pr63307.c: Delete. * c-c++-common/cilk-plus/CK/pr69826-1.c: Delete. * c-c++-common/cilk-plus/CK/pr69826-2.c: Delete. * c-c++-common/cilk-plus/CK/pr79428-4.c: Delete. * c-c++-common/cilk-plus/CK/pr79428-7.c: Delete. * c-c++-common/cilk-plus/CK/spawn_in_return.c: Delete. * c-c++-common/cilk-plus/CK/spawnee_inline.c: Delete. * c-c++-common/cilk-plus/CK/spawner_inline.c: Delete. * c-c++-common/cilk-plus/CK/spawning_arg.c: Delete. * c-c++-common/cilk-plus/CK/steal_check.c: Delete. * c-c++-common/cilk-plus/CK/sync_wo_spawn.c: Delete. * c-c++-common/cilk-plus/CK/test__cilk.c: Delete. * c-c++-common/cilk-plus/CK/varargs_test.c: Delete. * c-c++-common/cilk-plus/PS/Wparentheses-1.c: Delete. * c-c++-common/cilk-plus/PS/body.c: Delete. * c-c++-common/cilk-plus/PS/clauses1.c: Delete. * c-c++-common/cilk-plus/PS/clauses2.c: Delete. * c-c++-common/cilk-plus/PS/clauses3.c: Delete. * c-c++-common/cilk-plus/PS/clauses4.c: Delete. * c-c++-common/cilk-plus/PS/for1.c: Delete. * c-c++-common/cilk-plus/PS/for2.c: Delete. * c-c++-common/cilk-plus/PS/for3.c: Delete. * c-c++-common/cilk-plus/PS/pr69363.c: Delete. * c-c++-common/cilk-plus/PS/reduction-1.c: Delete. * c-c++-common/cilk-plus/PS/reduction-2.c: Delete. * c-c++-common/cilk-plus/PS/reduction-3.c: Delete. * c-c++-common/cilk-plus/PS/run-1.c: Delete. * c-c++-common/cilk-plus/PS/safelen.c: Delete. * c-c++-common/cilk-plus/PS/vectorlength-2.c: Delete. * c-c++-common/cilk-plus/PS/vectorlength-3.c: Delete. * c-c++-common/cilk-plus/PS/vectorlength.c: Delete. * c-c++-common/cilk-plus/SE/ef_error.c: Delete. * c-c++-common/cilk-plus/SE/ef_error2.c: Delete. * c-c++-common/cilk-plus/SE/ef_error3.c: Delete. * c-c++-common/cilk-plus/SE/ef_test.c: Delete. * c-c++-common/cilk-plus/SE/ef_test2.c: Delete. * c-c++-common/cilk-plus/SE/vlength_errors.c: Delete. * g++.dg/cilk-plus/AN/array_function.c: Delete. * g++.dg/cilk-plus/AN/array_test1_tplt.c: Delete. * g++.dg/cilk-plus/AN/array_test2_tplt.c: Delete. * g++.dg/cilk-plus/AN/array_test_ND_tplt.c: Delete. * g++.dg/cilk-plus/AN/braced_list.c: Delete. * g++.dg/cilk-plus/AN/builtin_fn_custom_tplt.c: Delete. * g++.dg/cilk-plus/AN/builtin_fn_mutating_tplt.c: Delete. * g++.dg/cilk-plus/AN/fp_triplet_values_tplt.c: Delete. * g++.dg/cilk-plus/AN/postincr_test.c: Delete. * g++.dg/cilk-plus/AN/preincr_test.c: Delete. * g++.dg/cilk-plus/CK/catch_exc.c: Delete. * g++.dg/cilk-plus/CK/cf3.c: Delete. * g++.dg/cilk-plus/CK/cilk-for-tplt.c: Delete. * g++.dg/cilk-plus/CK/const_spawn.c: Delete. * g++.dg/cilk-plus/CK/fib-opr-overload.c: Delete. * g++.dg/cilk-plus/CK/fib-tplt.c: Delete. * g++.dg/cilk-plus/CK/for1.c: Delete. * g++.dg/cilk-plus/CK/lambda_spawns.c: Delete. * g++.dg/cilk-plus/CK/lambda_spawns_tplt.c: Delete. * g++.dg/cilk-plus/CK/pr60586.c: Delete. * g++.dg/cilk-plus/CK/pr66326.c: Delete. * g++.dg/cilk-plus/CK/pr68001.c: Delete. * g++.dg/cilk-plus/CK/pr68997.c: Delete. * g++.dg/cilk-plus/CK/pr69024.c: Delete. * g++.dg/cilk-plus/CK/pr69048.c: Delete. * g++.dg/cilk-plus/CK/pr69267.c: Delete. * g++.dg/cilk-plus/CK/pr80038.c: Delete. * g++.dg/cilk-plus/CK/stl_iter.c: Delete. * g++.dg/cilk-plus/CK/stl_rev_iter.c: Delete. * g++.dg/cilk-plus/CK/stl_test.c: Delete. * g++.dg/cilk-plus/cilk-plus.exp * g++.dg/cilk-plus/ef_test.C: Delete. * g++.dg/cilk-plus/for.C: Delete. * g++.dg/cilk-plus/for2.C: Delete. * g++.dg/cilk-plus/for3.C: Delete. * g++.dg/cilk-plus/for4.C: Delete. * g++.dg/cilk-plus/pr60967.C: Delete. * g++.dg/cilk-plus/pr69028.C: Delete. * g++.dg/cilk-plus/pr70565.C: Delete. * g++.dg/pr57662.C: Delete. * gcc.dg/cilk-plus/cilk-plus.exp * gcc.dg/cilk-plus/for1.c: Delete. * gcc.dg/cilk-plus/for2.c: Delete. * gcc.dg/cilk-plus/jump-openmp.c: Delete. * gcc.dg/cilk-plus/jump.c: Delete. * gcc.dg/cilk-plus/pr69798-1.c: Delete. * gcc.dg/cilk-plus/pr69798-2.c: Delete. * gcc.dg/cilk-plus/pr78306.c: Delete. * gcc.dg/cilk-plus/pr79116.c: Delete. * gcc.dg/graphite/id-28.c: Delete. * lib/cilk-plus-dg.exp: Delete. * lib/target-supports.exp (cilkplus_runtime): Delete. Co-Authored-By: Sebastian Peryt <sebastian.peryt@intel.com> From-SVN: r255195
Diffstat (limited to 'gcc/c-family/array-notation-common.c')
-rw-r--r--gcc/c-family/array-notation-common.c689
1 files changed, 0 insertions, 689 deletions
diff --git a/gcc/c-family/array-notation-common.c b/gcc/c-family/array-notation-common.c
deleted file mode 100644
index a480994..0000000
--- a/gcc/c-family/array-notation-common.c
+++ /dev/null
@@ -1,689 +0,0 @@
-/* This file is part of the Intel(R) Cilk(TM) Plus support
- This file contains the builtin functions for Array
- notations.
- Copyright (C) 2013-2017 Free Software Foundation, Inc.
- Contributed by Balaji V. Iyer <balaji.v.iyer@intel.com>,
- Intel Corporation
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "options.h"
-#include "c-family/c-common.h"
-#include "tree-iterator.h"
-#include "stringpool.h"
-#include "attribs.h"
-
-/* Returns true if the function call in FNDECL is __sec_implicit_index. */
-
-bool
-is_sec_implicit_index_fn (tree fndecl)
-{
- if (!fndecl)
- return false;
-
- if (TREE_CODE (fndecl) == ADDR_EXPR)
- fndecl = TREE_OPERAND (fndecl, 0);
-
- return
- (TREE_CODE (fndecl) == FUNCTION_DECL
- && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
- && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_CILKPLUS_SEC_IMPLICIT_INDEX);
-}
-
-/* Returns the first and only argument for FN, which should be a
- sec_implicit_index function. FN's location in the source file is as
- indicated by LOCATION. The argument to FN must be a constant integer
- expression, otherwise returns -1. */
-
-HOST_WIDE_INT
-extract_sec_implicit_index_arg (location_t location, tree fn)
-{
- tree fn_arg;
- HOST_WIDE_INT return_int = 0;
-
- if (TREE_CODE (fn) == CALL_EXPR)
- {
- fn_arg = CALL_EXPR_ARG (fn, 0);
- if (TREE_CODE (fn_arg) == INTEGER_CST)
- return_int = int_cst_value (fn_arg);
- else
- {
- /* If the location is unknown, and if fn has a location, then use that
- information so that the user has a better idea where the error
- could be. */
- if (location == UNKNOWN_LOCATION && EXPR_HAS_LOCATION (fn))
- location = EXPR_LOCATION (fn);
- error_at (location, "__sec_implicit_index parameter must be an "
- "integer constant expression");
- return -1;
- }
- }
- return return_int;
-}
-
-/* Returns true if there is a length mismatch among exprssions that are at the
- same dimension and one the same side of the equal sign. The Array notation
- lengths (LIST->LENGTH) is passed in as a 2D vector of trees. */
-
-bool
-length_mismatch_in_expr_p (location_t loc, vec<vec<an_parts> >list)
-{
- size_t ii, jj;
- tree length = NULL_TREE;
-
- size_t x = list.length ();
- size_t y = list[0].length ();
-
- for (jj = 0; jj < y; jj++)
- {
- length = NULL_TREE;
- for (ii = 0; ii < x; ii++)
- {
- if (!length)
- length = list[ii][jj].length;
- else if (TREE_CODE (length) == INTEGER_CST)
- {
- /* If length is a INTEGER, and list[ii][jj] is an integer then
- check if they are equal. If they are not equal then return
- true. */
- if (TREE_CODE (list[ii][jj].length) == INTEGER_CST
- && !tree_int_cst_equal (list[ii][jj].length, length))
- {
- error_at (loc, "length mismatch in expression");
- return true;
- }
- }
- else
- /* We set the length node as the current node just in case it turns
- out to be an integer. */
- length = list[ii][jj].length;
- }
- }
- return false;
-}
-
-/* Given an FNDECL of type FUNCTION_DECL or ADDR_EXPR, return the corresponding
- BUILT_IN_CILKPLUS_SEC_REDUCE_* being called. If none, return
- BUILT_IN_NONE. */
-
-enum built_in_function
-is_cilkplus_reduce_builtin (tree fndecl)
-{
- if (!fndecl)
- return BUILT_IN_NONE;
- if (TREE_CODE (fndecl) == ADDR_EXPR)
- fndecl = TREE_OPERAND (fndecl, 0);
-
- if (TREE_CODE (fndecl) == FUNCTION_DECL
- && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
- switch (DECL_FUNCTION_CODE (fndecl))
- {
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ADD:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MUL:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_ZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_ZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_NONZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_NONZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING:
- return DECL_FUNCTION_CODE (fndecl);
- default:
- break;
- }
-
- return BUILT_IN_NONE;
-}
-
-/* This function will recurse into EXPR finding any
- ARRAY_NOTATION_EXPRs and calculate the overall rank of EXPR,
- storing it in *RANK. LOC is the location of the original expression.
-
- ORIG_EXPR is the original expression used to display if any rank
- mismatch errors are found.
-
- Upon entry, *RANK must be either 0, or the rank of a parent
- expression that must have the same rank as the one being
- calculated. It is illegal to have multiple array notation with different
- rank in the same expression (see examples below for clarification).
-
- If there were any rank mismatches while calculating the rank, an
- error will be issued, and FALSE will be returned. Otherwise, TRUE
- is returned.
-
- If IGNORE_BUILTIN_FN is TRUE, ignore array notation specific
- built-in functions (__sec_reduce_*, etc).
-
- Here are some examples of array notations and their rank:
-
- Expression RANK
- 5 0
- X (a variable) 0
- *Y (a pointer) 0
- A[5] 0
- B[5][10] 0
- A[:] 1
- B[0:10] 1
- C[0:10:2] 1
- D[5][0:10:2] 1 (since D[5] is considered "scalar")
- D[5][:][10] 1
- E[:] + 5 1
- F[:][:][:] + 5 + X 3
- F[:][:][:] + E[:] + 5 + X RANKMISMATCH-ERROR since rank (E[:]) = 1 and
- rank (F[:][:][:]) = 3. They must be equal
- or have a rank of zero.
- F[:][5][10] + E[:] * 5 + *Y 1
-
- int func (int);
- func (A[:]) 1
- func (B[:][:][:][:]) 4
-
- int func2 (int, int)
- func2 (A[:], B[:][:][:][:]) RANKMISMATCH-ERROR -- Since Rank (A[:]) = 1
- and Rank (B[:][:][:][:]) = 4
-
- A[:] + func (B[:][:][:][:]) RANKMISMATCH-ERROR
- func2 (A[:], B[:]) + func (A) 1
-
- */
-
-bool
-find_rank (location_t loc, tree orig_expr, tree expr, bool ignore_builtin_fn,
- size_t *rank)
-{
- tree ii_tree;
- size_t ii = 0, current_rank = 0;
-
- if (TREE_CODE (expr) == ARRAY_NOTATION_REF)
- {
- ii_tree = expr;
- while (ii_tree)
- {
- if (TREE_CODE (ii_tree) == ARRAY_NOTATION_REF)
- {
- current_rank++;
- ii_tree = ARRAY_NOTATION_ARRAY (ii_tree);
- }
- else if (handled_component_p (ii_tree)
- || INDIRECT_REF_P (ii_tree))
- ii_tree = TREE_OPERAND (ii_tree, 0);
- else if (TREE_CODE (ii_tree) == PARM_DECL
- || VAR_P (ii_tree))
- break;
- else
- gcc_unreachable ();
- }
- if (*rank == 0)
- /* In this case, all the expressions this function has encountered thus
- far have been scalars or expressions with zero rank. Please see
- header comment for examples of such expression. */
- *rank = current_rank;
- else if (*rank != current_rank)
- {
- /* In this case, find rank is being recursed through a set of
- expression of the form A <OPERATION> B, where A and B both have
- array notations in them and the rank of A is not equal to rank of
- B.
- A simple example of such case is the following: X[:] + Y[:][:] */
- *rank = current_rank;
- return false;
- }
- }
- else if (TREE_CODE (expr) == STATEMENT_LIST)
- {
- tree_stmt_iterator ii_tsi;
- for (ii_tsi = tsi_start (expr); !tsi_end_p (ii_tsi);
- tsi_next (&ii_tsi))
- if (!find_rank (loc, orig_expr, *tsi_stmt_ptr (ii_tsi),
- ignore_builtin_fn, rank))
- return false;
- }
- else
- {
- if (TREE_CODE (expr) == CALL_EXPR)
- {
- tree func_name = CALL_EXPR_FN (expr);
- tree prev_arg = NULL_TREE, arg;
- call_expr_arg_iterator iter;
- size_t prev_rank = 0;
- if (TREE_CODE (func_name) == ADDR_EXPR)
- if (!ignore_builtin_fn)
- if (is_cilkplus_reduce_builtin (func_name))
- /* If it is a built-in function, then we know it returns a
- scalar. */
- return true;
- if (!find_rank (loc, orig_expr, func_name, ignore_builtin_fn, rank))
- return false;
- FOR_EACH_CALL_EXPR_ARG (arg, iter, expr)
- {
- if (!find_rank (loc, orig_expr, arg, ignore_builtin_fn, rank))
- {
- if (prev_arg && EXPR_HAS_LOCATION (prev_arg)
- && prev_rank != *rank)
- error_at (EXPR_LOCATION (prev_arg),
- "rank mismatch between %qE and %qE", prev_arg,
- arg);
- else if (prev_arg && prev_rank != *rank)
- /* Here the original expression is printed as a "heads-up"
- to the programmer. This is because since there is no
- location information for the offending argument, the
- error could be in some internally generated code that is
- not visible for the programmer. Thus, the correct fix
- may lie in the original expression. */
- error_at (loc, "rank mismatch in expression %qE",
- orig_expr);
- return false;
- }
- prev_arg = arg;
- prev_rank = *rank;
- }
- }
- else
- {
- tree prev_arg = NULL_TREE;
- for (ii = 0; ii < TREE_CODE_LENGTH (TREE_CODE (expr)); ii++)
- {
- if (TREE_OPERAND (expr, ii)
- && !find_rank (loc, orig_expr, TREE_OPERAND (expr, ii),
- ignore_builtin_fn, rank))
- {
- if (prev_arg && EXPR_HAS_LOCATION (prev_arg))
- error_at (EXPR_LOCATION (prev_arg),
- "rank mismatch between %qE and %qE", prev_arg,
- TREE_OPERAND (expr, ii));
- return false;
- }
- prev_arg = TREE_OPERAND (expr, ii);
- }
- }
- }
- return true;
-}
-
-/* Extracts all array notations in NODE and stores them in ARRAY_LIST. If
- IGNORE_BUILTIN_FN is set, then array notations inside array notation
- specific built-in functions are ignored. The NODE can be constants,
- VAR_DECL, PARM_DECLS, STATEMENT_LISTS or full expressions. */
-
-void
-extract_array_notation_exprs (tree node, bool ignore_builtin_fn,
- vec<tree, va_gc> **array_list)
-{
- size_t ii = 0;
-
- if (!node)
- return;
- if (TREE_CODE (node) == ARRAY_NOTATION_REF)
- {
- vec_safe_push (*array_list, node);
- return;
- }
- if (TREE_CODE (node) == DECL_EXPR)
- {
- tree x = DECL_EXPR_DECL (node);
- if (DECL_INITIAL (x))
- extract_array_notation_exprs (DECL_INITIAL (x),
- ignore_builtin_fn,
- array_list);
- }
- else if (TREE_CODE (node) == STATEMENT_LIST)
- {
- tree_stmt_iterator ii_tsi;
- for (ii_tsi = tsi_start (node); !tsi_end_p (ii_tsi); tsi_next (&ii_tsi))
- extract_array_notation_exprs (*tsi_stmt_ptr (ii_tsi),
- ignore_builtin_fn, array_list);
- }
- else if (TREE_CODE (node) == CALL_EXPR)
- {
- tree arg;
- call_expr_arg_iterator iter;
- if (is_cilkplus_reduce_builtin (CALL_EXPR_FN (node)))
- {
- if (ignore_builtin_fn)
- return;
- else
- {
- vec_safe_push (*array_list, node);
- return;
- }
- }
- if (is_sec_implicit_index_fn (CALL_EXPR_FN (node)))
- {
- vec_safe_push (*array_list, node);
- return;
- }
- /* This will extract array notations in function pointers. */
- extract_array_notation_exprs (CALL_EXPR_FN (node), ignore_builtin_fn,
- array_list);
- FOR_EACH_CALL_EXPR_ARG (arg, iter, node)
- extract_array_notation_exprs (arg, ignore_builtin_fn, array_list);
- }
- else
- for (ii = 0; ii < TREE_CODE_LENGTH (TREE_CODE (node)); ii++)
- if (TREE_OPERAND (node, ii))
- extract_array_notation_exprs (TREE_OPERAND (node, ii),
- ignore_builtin_fn, array_list);
- return;
-}
-
-/* LIST contains all the array notations found in *ORIG and ARRAY_OPERAND
- contains the expanded ARRAY_REF. E.g., if LIST[<some_index>] contains
- an array_notation expression, then ARRAY_OPERAND[<some_index>] contains its
- expansion. If *ORIG matches LIST[<some_index>] then *ORIG is set to
- ARRAY_OPERAND[<some_index>]. This function recursively steps through
- all the sub-trees of *ORIG, if it is larger than a single
- ARRAY_NOTATION_REF. */
-
-void
-replace_array_notations (tree *orig, bool ignore_builtin_fn,
- vec<tree, va_gc> *list,
- vec<tree, va_gc> *array_operand)
-{
- size_t ii = 0;
- extern tree build_c_cast (location_t, tree, tree);
- tree node = NULL_TREE, node_replacement = NULL_TREE;
-
- if (vec_safe_length (list) == 0)
- return;
-
- if (TREE_CODE (*orig) == ARRAY_NOTATION_REF)
- {
- for (ii = 0; vec_safe_iterate (list, ii, &node); ii++)
- if (*orig == node)
- {
- node_replacement = (*array_operand)[ii];
- *orig = node_replacement;
- }
- }
- else if (TREE_CODE (*orig) == STATEMENT_LIST)
- {
- tree_stmt_iterator ii_tsi;
- for (ii_tsi = tsi_start (*orig); !tsi_end_p (ii_tsi); tsi_next (&ii_tsi))
- replace_array_notations (tsi_stmt_ptr (ii_tsi), ignore_builtin_fn, list,
- array_operand);
- }
- else if (TREE_CODE (*orig) == CALL_EXPR)
- {
- tree arg;
- call_expr_arg_iterator iter;
- if (is_cilkplus_reduce_builtin (CALL_EXPR_FN (*orig)))
- {
- if (!ignore_builtin_fn)
- {
- for (ii = 0; vec_safe_iterate (list, ii, &node); ii++)
- if (*orig == node)
- {
- node_replacement = (*array_operand)[ii];
- *orig = node_replacement;
- }
- }
- return;
- }
- if (is_sec_implicit_index_fn (CALL_EXPR_FN (*orig)))
- {
- for (ii = 0; vec_safe_iterate (list, ii, &node); ii++)
- if (*orig == node)
- {
- node_replacement = (*array_operand)[ii];
- *orig = build_c_cast (EXPR_LOCATION (*orig),
- TREE_TYPE (*orig), node_replacement);
- }
- return;
- }
- /* Fixes array notations in array notations in function pointers. */
- replace_array_notations (&CALL_EXPR_FN (*orig), ignore_builtin_fn, list,
- array_operand);
- ii = 0;
- FOR_EACH_CALL_EXPR_ARG (arg, iter, *orig)
- {
- replace_array_notations (&arg, ignore_builtin_fn, list,
- array_operand);
- CALL_EXPR_ARG (*orig, ii) = arg;
- ii++;
- }
- }
- else
- {
- for (ii = 0; ii < (size_t) TREE_CODE_LENGTH (TREE_CODE (*orig)); ii++)
- if (TREE_OPERAND (*orig, ii))
- replace_array_notations (&TREE_OPERAND (*orig, ii), ignore_builtin_fn,
- list, array_operand);
- }
- return;
-}
-
-/* Callback for walk_tree. Find all the scalar expressions in *TP and push
- them in DATA struct, typecasted to (void *). If *WALK_SUBTREES is set to 0
- then do not go into the *TP's subtrees. Since this function steps through
- all the subtrees, *TP and TP can be NULL_TREE and NULL, respectively. The
- function returns NULL_TREE unconditionally. */
-
-tree
-find_inv_trees (tree *tp, int *walk_subtrees, void *data)
-{
- struct inv_list *i_list = (struct inv_list *) data;
- unsigned int ii = 0;
-
- if (!tp || !*tp)
- return NULL_TREE;
- if (TREE_CONSTANT (*tp))
- return NULL_TREE; /* No need to save constant to a variable. */
- if (TREE_CODE (*tp) != COMPOUND_EXPR && !contains_array_notation_expr (*tp))
- {
- vec_safe_push (i_list->list_values, *tp);
- *walk_subtrees = 0;
- }
- else if (TREE_CODE (*tp) == ARRAY_NOTATION_REF
- || TREE_CODE (*tp) == ARRAY_REF
- || TREE_CODE (*tp) == CALL_EXPR)
- /* No need to step through the internals of array notation. */
- *walk_subtrees = 0;
- else
- {
- *walk_subtrees = 1;
-
- /* This function is used by C and C++ front-ends. In C++, additional
- tree codes such as TARGET_EXPR must be eliminated. These codes are
- passed into additional_tcodes and are walked through and checked. */
- for (ii = 0; ii < vec_safe_length (i_list->additional_tcodes); ii++)
- if (TREE_CODE (*tp) == (*(i_list->additional_tcodes))[ii])
- *walk_subtrees = 0;
- }
- return NULL_TREE;
-}
-
-/* Callback for walk_tree. Replace all the scalar expressions in *TP with the
- appropriate replacement stored in the struct *DATA (typecasted to void*).
- The subtrees are not touched if *WALK_SUBTREES is set to zero. */
-
-tree
-replace_inv_trees (tree *tp, int *walk_subtrees, void *data)
-{
- size_t ii = 0;
- tree t, r;
- struct inv_list *i_list = (struct inv_list *) data;
-
- if (vec_safe_length (i_list->list_values))
- {
- for (ii = 0; vec_safe_iterate (i_list->list_values, ii, &t); ii++)
- if (simple_cst_equal (*tp, t) == 1)
- {
- vec_safe_iterate (i_list->replacement, ii, &r);
- gcc_assert (r != NULL_TREE);
- *tp = r;
- *walk_subtrees = 0;
- }
- }
- else
- *walk_subtrees = 0;
- return NULL_TREE;
-}
-
-/* Returns true if EXPR or any of its subtrees contain ARRAY_NOTATION_EXPR
- node. */
-
-bool
-contains_array_notation_expr (tree expr)
-{
- vec<tree, va_gc> *array_list = NULL;
-
- if (!expr)
- return false;
- if (TREE_CODE (expr) == FUNCTION_DECL)
- if (is_cilkplus_reduce_builtin (expr))
- return true;
-
- extract_array_notation_exprs (expr, false, &array_list);
- if (vec_safe_length (array_list) == 0)
- return false;
- else
- return true;
-}
-
-/* This function will check if OP is a CALL_EXPR that is a built-in array
- notation function. If so, then we will return its type to be the type of
- the array notation inside. */
-
-tree
-find_correct_array_notation_type (tree op)
-{
- tree fn_arg, return_type = NULL_TREE;
-
- if (op)
- {
- return_type = TREE_TYPE (op); /* This is the default case. */
- if (TREE_CODE (op) == CALL_EXPR)
- if (is_cilkplus_reduce_builtin (CALL_EXPR_FN (op)))
- {
- fn_arg = CALL_EXPR_ARG (op, 0);
- if (fn_arg)
- return_type = TREE_TYPE (fn_arg);
- }
- }
- return return_type;
-}
-
-/* Extracts all the array notation triplet information from LIST and stores
- them in the following fields of the 2-D array NODE(size x rank):
- START, LENGTH and STRIDE, holding the starting index, length, and stride,
- respectively. In addition, it also sets two bool fields, IS_VECTOR and
- COUNT_DOWN, in NODE indicating whether a certain value at a certain field
- is a vector and if the array is accessed from high to low. */
-
-void
-cilkplus_extract_an_triplets (vec<tree, va_gc> *list, size_t size, size_t rank,
- vec<vec<struct cilkplus_an_parts> > *node)
-{
- vec<vec<tree> > array_exprs = vNULL;
-
- node->safe_grow_cleared (size);
- array_exprs.safe_grow_cleared (size);
-
- if (rank > 0)
- for (size_t ii = 0; ii < size; ii++)
- {
- (*node)[ii].safe_grow_cleared (rank);
- array_exprs[ii].safe_grow_cleared (rank);
- }
- for (size_t ii = 0; ii < size; ii++)
- {
- size_t jj = 0;
- tree ii_tree = (*list)[ii];
- while (ii_tree)
- {
- if (TREE_CODE (ii_tree) == ARRAY_NOTATION_REF)
- {
- array_exprs[ii][jj] = ii_tree;
- jj++;
- ii_tree = ARRAY_NOTATION_ARRAY (ii_tree);
- }
- else if (TREE_CODE (ii_tree) == ARRAY_REF)
- ii_tree = TREE_OPERAND (ii_tree, 0);
- else
- break;
- }
- }
- for (size_t ii = 0; ii < size; ii++)
- if (TREE_CODE ((*list)[ii]) == ARRAY_NOTATION_REF)
- for (size_t jj = 0; jj < rank; jj++)
- {
- tree ii_tree = array_exprs[ii][jj];
- (*node)[ii][jj].is_vector = true;
- (*node)[ii][jj].value = ARRAY_NOTATION_ARRAY (ii_tree);
- (*node)[ii][jj].start
- = fold_build1 (CONVERT_EXPR, integer_type_node,
- ARRAY_NOTATION_START (ii_tree));
- (*node)[ii][jj].length
- = fold_build1 (CONVERT_EXPR, integer_type_node,
- ARRAY_NOTATION_LENGTH (ii_tree));
- (*node)[ii][jj].stride
- = fold_build1 (CONVERT_EXPR, integer_type_node,
- ARRAY_NOTATION_STRIDE (ii_tree));
- }
-
- release_vec_vec (array_exprs);
-}
-
-/* Replaces all the __sec_implicit_arg functions in LIST with the induction
- variable stored in VAR at the appropriate location pointed by the
- __sec_implicit_arg's first parameter. Emits an error if the parameter is
- not between 0 and RANK. */
-
-vec <tree, va_gc> *
-fix_sec_implicit_args (location_t loc, vec <tree, va_gc> *list,
- vec<an_loop_parts> an_loop_info, size_t rank,
- tree orig_stmt)
-{
- vec <tree, va_gc> *array_operand = NULL;
- for (size_t ii = 0; ii < vec_safe_length (list); ii++)
- if (TREE_CODE ((*list)[ii]) == CALL_EXPR
- && is_sec_implicit_index_fn (CALL_EXPR_FN ((*list)[ii])))
- {
- int idx = extract_sec_implicit_index_arg (loc, (*list)[ii]);
- if (idx < 0)
- /* In this case, the returning function would have emitted an
- error thus it is not necessary to do so again. */
- return NULL;
- else if (idx < (int) rank)
- vec_safe_push (array_operand, an_loop_info[idx].var);
- else
- {
- error_at (loc, "__sec_implicit_index argument %d must be "
- "less than the rank of %qE", idx, orig_stmt);
- return NULL;
- }
- }
- else
- /* Save the existing value into the array operand. */
- vec_safe_push (array_operand, (*list)[ii]);
- return array_operand;
-}
-
-/* Returns true if NAME is an IDENTIFIER_NODE with identifier "vector",
- "__vector", or "__vector__". */
-
-bool
-is_cilkplus_vector_p (tree name)
-{
- return flag_cilkplus && is_attribute_p ("vector", name);
-}