Mercurial > hg > CbC > CbC_gcc
diff gcc/trans-mem.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
line wrap: on
line diff
--- a/gcc/trans-mem.c Fri Oct 27 22:46:09 2017 +0900 +++ b/gcc/trans-mem.c Thu Oct 25 07:37:49 2018 +0900 @@ -1,5 +1,5 @@ /* Passes for transactional memory support. - Copyright (C) 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2008-2018 Free Software Foundation, Inc. Contributed by Richard Henderson <rth@redhat.com> and Aldy Hernandez <aldyh@redhat.com>. @@ -235,8 +235,7 @@ if (TREE_CODE (x) == ADDR_EXPR) x = TREE_OPERAND (x, 0); if (TREE_CODE (x) == FUNCTION_DECL - && DECL_BUILT_IN_CLASS (x) == BUILT_IN_NORMAL - && DECL_FUNCTION_CODE (x) == BUILT_IN_TM_IRREVOCABLE) + && fndecl_built_in_p (x, BUILT_IN_TM_IRREVOCABLE)) return true; return false; @@ -358,7 +357,8 @@ return false; fndecl = gimple_call_fndecl (stmt); - return (fndecl && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL + return (fndecl + && fndecl_built_in_p (fndecl, BUILT_IN_NORMAL) && BUILTIN_TM_LOAD_P (DECL_FUNCTION_CODE (fndecl))); } @@ -374,7 +374,7 @@ return false; fndecl = gimple_call_fndecl (stmt); - if (fndecl && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL) + if (fndecl && fndecl_built_in_p (fndecl, BUILT_IN_NORMAL)) { enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl); return (fcode == BUILT_IN_TM_LOAD_1 @@ -402,7 +402,8 @@ return false; fndecl = gimple_call_fndecl (stmt); - return (fndecl && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL + return (fndecl + && fndecl_built_in_p (fndecl, BUILT_IN_NORMAL) && BUILTIN_TM_STORE_P (DECL_FUNCTION_CODE (fndecl))); } @@ -418,7 +419,8 @@ return false; fndecl = gimple_call_fndecl (stmt); - if (fndecl && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL) + if (fndecl + && fndecl_built_in_p (fndecl, BUILT_IN_NORMAL)) { enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl); return (fcode == BUILT_IN_TM_STORE_1 @@ -440,9 +442,7 @@ static bool is_tm_abort (tree fndecl) { - return (fndecl - && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL - && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_TM_ABORT); + return (fndecl && fndecl_built_in_p (fndecl, BUILT_IN_TM_ABORT)); } /* Build a GENERIC tree for a user abort. This is called by front ends @@ -2007,7 +2007,7 @@ if (gimple_code (g) == GIMPLE_CALL) { tree fn = gimple_call_fndecl (g); - if (fn && DECL_BUILT_IN_CLASS (fn) == BUILT_IN_NORMAL) + if (fn && fndecl_built_in_p (fn, BUILT_IN_NORMAL)) { if ((DECL_FUNCTION_CODE (fn) == BUILT_IN_TM_COMMIT || DECL_FUNCTION_CODE (fn) == BUILT_IN_TM_COMMIT_EH) @@ -2582,7 +2582,7 @@ gassign *assign_stmt; /* Remember if the call was going to throw. */ - if (stmt_can_throw_internal (stmt)) + if (stmt_can_throw_internal (cfun, stmt)) { edge_iterator ei; edge e; @@ -2932,7 +2932,6 @@ edge ef = make_edge (test_bb, join_bb, EDGE_FALSE_VALUE); redirect_edge_pred (fallthru_edge, join_bb); - join_bb->frequency = test_bb->frequency = transaction_bb->frequency; join_bb->count = test_bb->count = transaction_bb->count; ei->probability = profile_probability::always (); @@ -2940,7 +2939,6 @@ ef->probability = profile_probability::unlikely (); code_bb->count = et->count (); - code_bb->frequency = EDGE_FREQUENCY (et); transaction_bb = join_bb; } @@ -2964,7 +2962,6 @@ gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING); edge ei = make_edge (transaction_bb, test_bb, EDGE_FALLTHRU); - test_bb->frequency = transaction_bb->frequency; test_bb->count = transaction_bb->count; ei->probability = profile_probability::always (); @@ -3006,7 +3003,6 @@ edge e = make_edge (transaction_bb, test_bb, fallthru_edge->flags); e->probability = fallthru_edge->probability; test_bb->count = fallthru_edge->count (); - test_bb->frequency = EDGE_FREQUENCY (e); // Now update the edges to the inst/uninist implementations. // For now assume that the paths are equally likely. When using HTM, @@ -5069,9 +5065,7 @@ node->create_edge (cgraph_node::get_create (builtin_decl_explicit (BUILT_IN_TM_IRREVOCABLE)), - g, gimple_bb (g)->count, - compute_call_stmt_bb_frequency (node->decl, - gimple_bb (g))); + g, gimple_bb (g)->count); } /* Construct a call to TM_GETTMCLONE and insert it before GSI. */ @@ -5120,9 +5114,7 @@ gsi_insert_before (gsi, g, GSI_SAME_STMT); - node->create_edge (cgraph_node::get_create (gettm_fn), g, gimple_bb (g)->count, - compute_call_stmt_bb_frequency (node->decl, - gimple_bb (g))); + node->create_edge (cgraph_node::get_create (gettm_fn), g, gimple_bb (g)->count); /* Cast return value from tm_gettmclone* into appropriate function pointer. */