summaryrefslogtreecommitdiff
path: root/gcc/trans-mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/trans-mem.c')
-rw-r--r--gcc/trans-mem.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index 31dee7678d2..c9af68002ac 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -55,14 +55,9 @@
#include "gimple-pretty-print.h"
#include "cfgloop.h"
#include "tree-ssa-address.h"
+#include "predict.h"
-#define PROB_VERY_UNLIKELY (REG_BR_PROB_BASE / 2000 - 1)
-#define PROB_VERY_LIKELY (PROB_ALWAYS - PROB_VERY_UNLIKELY)
-#define PROB_UNLIKELY (REG_BR_PROB_BASE / 5 - 1)
-#define PROB_LIKELY (PROB_ALWAYS - PROB_VERY_LIKELY)
-#define PROB_ALWAYS (REG_BR_PROB_BASE)
-
#define A_RUNINSTRUMENTEDCODE 0x0001
#define A_RUNUNINSTRUMENTEDCODE 0x0002
#define A_SAVELIVEVARIABLES 0x0004
@@ -1961,7 +1956,7 @@ tm_region_init (struct tm_region *region)
/* We could store this information in bb->aux, but we may get called
through get_all_tm_blocks() from another pass that may be already
using bb->aux. */
- bb_regions.safe_grow_cleared (last_basic_block);
+ bb_regions.safe_grow_cleared (last_basic_block_for_fn (cfun));
queue.safe_push (bb);
bb_regions[bb->index] = region;
@@ -2633,7 +2628,7 @@ static vec<tm_region_p>
get_bb_regions_instrumented (bool traverse_clones,
bool include_uninstrumented_p)
{
- unsigned n = last_basic_block;
+ unsigned n = last_basic_block_for_fn (cfun);
struct bb2reg_stuff stuff;
vec<tm_region_p> ret;
@@ -2661,7 +2656,7 @@ compute_transaction_bits (void)
certainly don't need it to calculate CDI_DOMINATOR info. */
gate_tm_init ();
- FOR_EACH_BB (bb)
+ FOR_EACH_BB_FN (bb, cfun)
bb->flags &= ~BB_IN_TRANSACTION;
for (region = all_tm_regions; region; region = region->next)
@@ -2998,7 +2993,7 @@ execute_tm_mark (void)
&& sub & GTMA_MAY_ENTER_IRREVOCABLE)
continue;
}
- expand_block_tm (r, BASIC_BLOCK (i));
+ expand_block_tm (r, BASIC_BLOCK_FOR_FN (cfun, i));
}
}
@@ -3189,7 +3184,7 @@ execute_tm_edges (void)
FOR_EACH_VEC_ELT (bb_regions, i, r)
if (r != NULL)
- expand_block_edges (r, BASIC_BLOCK (i));
+ expand_block_edges (r, BASIC_BLOCK_FOR_FN (cfun, i));
bb_regions.release ();
@@ -3705,7 +3700,7 @@ tm_memopt_compute_antic (struct tm_region *region,
unsigned int i;
bitmap_iterator bi;
EXECUTE_IF_SET_IN_BITMAP (region->exit_blocks, 0, i, bi)
- BB_VISITED_P (BASIC_BLOCK (i)) = true;
+ BB_VISITED_P (BASIC_BLOCK_FOR_FN (cfun, i)) = true;
}
qin = worklist;
@@ -4577,7 +4572,8 @@ ipa_tm_scan_irr_function (struct cgraph_node *node, bool for_clone)
unsigned i;
EXECUTE_IF_SET_IN_BITMAP (new_irr, 0, i, bmi)
- ipa_tm_decrement_clone_counts (BASIC_BLOCK (i), for_clone);
+ ipa_tm_decrement_clone_counts (BASIC_BLOCK_FOR_FN (cfun, i),
+ for_clone);
if (old_irr)
{