tm: Add uninstrumented code path

Co-Authored-By: Richard Henderson <rth@redhat.com>

From-SVN: r193271
This commit is contained in:
Aldy Hernandez 2012-11-06 23:55:39 +00:00 committed by Richard Henderson
parent 066b83541d
commit 398b1daa2d
15 changed files with 631 additions and 313 deletions

View file

@ -1,3 +1,26 @@
2012-11-06 Aldy Hernandez <aldyh@redhat.com>
Richard Henderson <rth@redhat.com>
* cfg-flags.def (TM_UNINSTRUMENTED, TM_ABORT): New.
* trans-mem.c (PROB_VERY_LIKELY, PROB_UNLIKELY, PROB_LIKELY): New.
(struct tm_region): Add tm_state, restart_block,
original_transaction_was_outer.
(tm_region_init_0): Initialize them.
(collect_bb2reg, get_bb_regions_instrumented): New.
(tm_log_emit_save_or_restores): Merge into ...
(expand_transaction): ... here.
(generate_tm_state, propagate_tm_flags_out): New.
(execute_tm_mark): Avoid processing blocks more than once.
(split_bb_make_tm_edge): Split out from ...
(make_tm_edge): ... here. And merge the rest into ...
(expand_block_edges): ... here.
(execute_tm_edges): Avoid processing blocks more than once.
(ipa_uninstrument_transaction): New.
(ipa_tm_scan_calls_transaction): Use it. Rebuild cgraph and ssa.
(ipa_tm_execute): Init and free original_copy_tables.
* trans-mem.h (PR_MULTIWAYCODE): New.
* tree-cfg.c (make_edges): Use EDGE_TM_ABORT.
2012-11-06 Aldy Hernandez <aldyh@redhat.com>
* cfghooks.c (copy_bbs): Handle a null loop_father.

View file

@ -171,6 +171,12 @@ DEF_EDGE_FLAG(CAN_FALLTHRU, 13)
This flag is only used for the RTL CFG. */
DEF_EDGE_FLAG(LOOP_EXIT, 14)
/* Uninstrumented edge out of a GIMPLE_TRANSACTION statement. */
DEF_EDGE_FLAG(TM_UNINSTRUMENTED, 15)
/* Abort (over) edge out of a GIMPLE_TRANSACTION statement. */
DEF_EDGE_FLAG(TM_ABORT, 16)
#endif
/*

View file

@ -1,3 +1,15 @@
2012-11-06 Aldy Hernandez <aldyh@redhat.com>
* c-c++-common/tm/trxn-expr-3.c: Adjust for uninstrumented code path.
* gcc.dg/tm/debug-1.c: Same.
* gcc.dg/tm/irrevocable-3.c: Same.
* gcc.dg/tm/irrevocable-4.c: Same.
* gcc.dg/tm/memopt-10.c: Same.
* gcc.dg/tm/memopt-11.c: Same.
* gcc.dg/tm/props-4.c: Same.
* gcc.dg/tm/wrap-3.c: Same.
* gcc.dg/tm/wrap-4.c: Same.
2012-11-06 Andrew Pinski <apinski@cavium.com>
* g++.dg/abi/aarch64_guard1.C: Add -fno-section-anchors.

View file

@ -10,5 +10,5 @@ int f2()
}
/* { dg-final { scan-tree-dump-times "ITM_RU" 2 "tmmark" } } */
/* { dg-final { scan-tree-dump-times "ITM_commitTransaction" 2 "tmmark" } } */
/* { dg-final { scan-tree-dump-times "ITM_commitTransaction" 4 "tmmark" } } */
/* { dg-final { cleanup-tree-dump "tmmark" } } */

View file

@ -20,7 +20,7 @@ main() {
}
/* { dg-final { scan-tree-dump-times ": 13:.*b = 9898" 1 "tmmark" } } */
/* { dg-final { scan-tree-dump-times ": 14:.*__transaction" 1 "tmmark" } } */
/* { dg-final { scan-tree-dump-times ": 14:.*_ITM_beginTransaction" 1 "tmmark" } } */
/* { dg-final { scan-tree-dump-times ": 15:.*ITM_WU. \\(&z" 1 "tmmark" } } */
/* { dg-final { scan-tree-dump-times ": 16:.*ITM_WU. \\(&a" 1 "tmmark" } } */
/* { dg-final { cleanup-tree-dump "tmmark" } } */

View file

@ -10,5 +10,5 @@ foo()
}
}
/* { dg-final { scan-tree-dump-times "GTMA_MAY_ENTER_IRREVOCABLE" 1 "tmmark" } } */
/* { dg-final { scan-tree-dump-times "doesGoIrrevocable" 1 "tmmark" } } */
/* { dg-final { cleanup-tree-dump "tmmark" } } */

View file

@ -12,5 +12,5 @@ foo()
}
}
/* { dg-final { scan-tree-dump-times "GTMA_MAY_ENTER_IRREVOCABLE" 1 "tmmark" } } */
/* { dg-final { scan-tree-dump-times "hasNoIrrevocable" 0 "tmmark" } } */
/* { dg-final { cleanup-tree-dump "tmmark" } } */

View file

@ -24,5 +24,5 @@ int f()
/* { dg-final { scan-tree-dump-times "ITM_LU" 0 "tmmark" } } */
/* { dg-final { scan-tree-dump-times "ITM_WU" 0 "tmmark" } } */
/* { dg-final { scan-tree-dump-times "tm_save" 1 "tmmark" } } */
/* { dg-final { scan-tree-dump-times "int tm_save" 1 "tmmark" } } */
/* { dg-final { cleanup-tree-dump "tmmark" } } */

View file

@ -25,5 +25,5 @@ int f()
/* { dg-final { scan-tree-dump-times "ITM_LU" 0 "tmmark" } } */
/* { dg-final { scan-tree-dump-times "ITM_WU" 0 "tmmark" } } */
/* { dg-final { scan-tree-dump-times "tm_save" 1 "tmmark" } } */
/* { dg-final { scan-tree-dump-times "int tm_save" 1 "tmmark" } } */
/* { dg-final { cleanup-tree-dump "tmmark" } } */

View file

@ -22,6 +22,5 @@ foo(void)
/* { dg-final { scan-tree-dump-times " instrumentedCode" 1 "tmedge" } } */
/* { dg-final { scan-tree-dump-times "hasNoAbort" 0 "tmedge" } } */
/* { dg-final { scan-tree-dump-times "LABEL=<L0>" 1 "tmmark" } } */
/* { dg-final { cleanup-tree-dump "tmedge" } } */
/* { dg-final { cleanup-tree-dump "tmmark" } } */

View file

@ -10,5 +10,8 @@ void foo()
__transaction_relaxed { free (p); }
}
/* { dg-final { scan-tree-dump-times "free" 0 "optimized" } } */
/* We still have one call to free()-- on the uninstrumented path
everything is as usual. */
/* { dg-final { scan-tree-dump-times "free" 1 "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */

View file

@ -11,5 +11,8 @@ void foo()
__transaction_relaxed { candy(); }
}
/* { dg-final { scan-tree-dump-times "candy" 0 "optimized" } } */
/* We still have one call to candy()-- on the uninstrumented path
everything is as usual. */
/* { dg-final { scan-tree-dump-times "candy \\(\\);" 1 "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */

File diff suppressed because it is too large Load diff

View file

@ -21,6 +21,7 @@
/* These defines must match the enumerations in libitm.h. */
#define PR_INSTRUMENTEDCODE 0x0001
#define PR_UNINSTRUMENTEDCODE 0x0002
#define PR_MULTIWAYCODE (PR_INSTRUMENTEDCODE | PR_UNINSTRUMENTEDCODE)
#define PR_HASNOXMMUPDATE 0x0004
#define PR_HASNOABORT 0x0008
#define PR_HASNOIRREVOCABLE 0x0020

View file

@ -666,7 +666,7 @@ make_edges (void)
{
tree abort_label = gimple_transaction_label (last);
if (abort_label)
make_edge (bb, label_to_block (abort_label), 0);
make_edge (bb, label_to_block (abort_label), EDGE_TM_ABORT);
fallthru = true;
}
break;
@ -2062,7 +2062,7 @@ gimple_debug_bb_n (int n)
/* Dump the CFG on stderr.
FLAGS are the same used by the tree dumping functions
(see TDF_* in tree-pass.h). */
(see TDF_* in dumpfile.h). */
void
gimple_debug_cfg (int flags)
@ -6737,7 +6737,7 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb,
}
/* Dump FUNCTION_DECL FN to file FILE using FLAGS (see TDF_* in tree-pass.h)
/* Dump FUNCTION_DECL FN to file FILE using FLAGS (see TDF_* in dumpfile.h)
*/
void