diff options
author | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-04-20 13:14:30 +0200 |
---|---|---|
committer | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-04-28 23:35:53 +0200 |
commit | c9b8c68e8f295da1f0ebd209ca22c62df4e4f75d (patch) | |
tree | 98c7df9e19d868ec7484cc65960ebfda429d8a24 | |
parent | 9de0c30fb0512e1f94bc72c92e03bc1b1406234e (diff) |
blacklisting memset
-rw-r--r-- | gcc/ipa-hello-world.c | 4 | ||||
-rw-r--r-- | gcc/ipa-str-reorg-dead-field-eliminate.c | 7 | ||||
-rw-r--r-- | gcc/ipa-type-escape-analysis.c | 4 |
3 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ipa-hello-world.c b/gcc/ipa-hello-world.c index e9322455eca..65a1ba9c6a4 100644 --- a/gcc/ipa-hello-world.c +++ b/gcc/ipa-hello-world.c @@ -306,8 +306,10 @@ static void count_access_for_types_in_call_rhs(gimple *stmt, const record_set &non_escaping_records, field_access_counter &counter) { is_gimple_call_p(stmt); - unsigned args = gimple_call_num_args (stmt); + + + for (unsigned i = 0; i < args; i++) { const_tree arg = gimple_call_arg (stmt, i); diff --git a/gcc/ipa-str-reorg-dead-field-eliminate.c b/gcc/ipa-str-reorg-dead-field-eliminate.c index f966af3b2b0..59b82fd2b3f 100644 --- a/gcc/ipa-str-reorg-dead-field-eliminate.c +++ b/gcc/ipa-str-reorg-dead-field-eliminate.c @@ -596,7 +596,7 @@ is_interesting_struct_escape_analysis(const_tree record) is_record_p(main_variant); const char* const ob_type_name = get_type_name(main_variant); const char* blacklist [5] = { "__gcov_fn_info", "__gcov_ctr_info", "__gcov_fn_info", "__gcov_info", "indirect_call_tuple" }; - const char* whitelist [4] = { "arc", "arc_t", "network_t", "network" }; + //const char* whitelist [4] = { "arc", "arc_t", "node", "node_t" }; for (int i = 0; i < 5; i++) { @@ -604,12 +604,14 @@ is_interesting_struct_escape_analysis(const_tree record) if (is_blacklisted) return false; } + /* bool is_whitelisted = false; for (int i = 0; i < 4; i++) { is_whitelisted |= strcmp(whitelist[i], ob_type_name) == 0; } if (!is_whitelisted) return false; + */ bool in_set = @@ -1468,6 +1470,7 @@ rewrite_component_ref_def_lhs (gimple_stmt_iterator &gsi, tree expr, t_map &type tree expr_type = TREE_TYPE (expr); gcc_assert (expr_type); delete_info_t *delete_info1 = type_map.get (expr_type); + delete_info1 = delete_info1 ? delete_info1 : type_map.get (TYPE_MAIN_VARIANT(expr_type)); const_tree *new_expr_type_ptr = delete_info1 ? &(delete_info1->new_record) : NULL; tree _struct = TREE_OPERAND (expr, 0); @@ -1475,6 +1478,7 @@ rewrite_component_ref_def_lhs (gimple_stmt_iterator &gsi, tree expr, t_map &type tree _struct_type = TREE_TYPE (_struct); gcc_assert (_struct_type); delete_info_t *delete_info = type_map.get (_struct_type); + delete_info = delete_info ? delete_info : type_map.get (TYPE_MAIN_VARIANT(_struct_type)); const_tree *new_struct_type_ptr = delete_info ? &(delete_info->new_record) : NULL; if (new_expr_type_ptr) @@ -1608,6 +1612,7 @@ rewrite_mem_ref_def (tree expr, t_map &type_map, tree type = TREE_TYPE (expr); delete_info_t *delete_info = type_map.get (type); + delete_info = delete_info ? delete_info : type_map.get (TYPE_MAIN_VARIANT(type)); const_tree *new_type_ptr = delete_info ? &(delete_info->new_record) : NULL; if (new_type_ptr) substitute_type(expr, new_type_ptr); diff --git a/gcc/ipa-type-escape-analysis.c b/gcc/ipa-type-escape-analysis.c index ff86447e869..64463c7df56 100644 --- a/gcc/ipa-type-escape-analysis.c +++ b/gcc/ipa-type-escape-analysis.c @@ -636,13 +636,13 @@ is_any_function_escaping(type_map &escape_map) { gcc_assert(cnode); const char* _free = "free"; - const char* _memset = "memset"; + //const char* _memset = "memset"; const char* _malloc = "malloc"; const char* _realloc = "realloc"; const char* _calloc= "calloc"; const char* ob_name = cnode->name(); if (strcmp(ob_name, _free) == 0) continue; - if (strcmp(ob_name, _memset) == 0) continue; + //if (strcmp(ob_name, _memset) == 0) continue; if (strcmp(ob_name, _malloc) == 0) continue; if (strcmp(ob_name, _realloc) == 0) continue; if (strcmp(ob_name, _calloc) == 0) continue; |