+2013-02-27 Aldy Hernandez <aldyh@redhat.com>
+
+ * trans-mem.c (expand_transaction): Do not set PR_INSTRUMENTEDCODE
+ if GTMA_HAS_NO_INSTRUMENTATION.
+ (generate_tm_state): Keep GTMA_HAS_NO_INSTRUMENTATION bit.
+ (ipa_tm_transform_transaction): Set GTMA_HAS_NO_INSTRUMENTATION.
+ * gimple.h (GTMA_HAS_NO_INSTRUMENTATION): Define.
+ * gimple-pretty-print.c (dump_gimple_transaction): Handle
+ GTMA_HAS_NO_INSTRUMENTATION.
+
+2013-02-25 Aldy Hernandez <aldyh@redhat.com>
+
2013-03-08 Jakub Jelinek <jakub@redhat.com>
* config/gnu-user.h (LIBTSAN_EARLY_SPEC): Don't link against
pp_string (buffer, "GTMA_DOES_GO_IRREVOCABLE ");
subcode &= ~GTMA_DOES_GO_IRREVOCABLE;
}
+ if (subcode & GTMA_HAS_NO_INSTRUMENTATION)
+ {
+ pp_string (buffer, "GTMA_HAS_NO_INSTRUMENTATION ");
+ subcode &= ~GTMA_HAS_NO_INSTRUMENTATION;
+ }
if (subcode)
pp_printf (buffer, "0x%x ", subcode);
pp_string (buffer, "]");
tell the runtime that it should begin the transaction in
serial-irrevocable mode. */
#define GTMA_DOES_GO_IRREVOCABLE (1u << 6)
+/* The transaction contains no instrumentation code whatsover, most
+ likely because it is guaranteed to go irrevocable upon entry. */
+#define GTMA_HAS_NO_INSTRUMENTATION (1u << 7)
struct GTY(()) gimple_statement_transaction
{
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-tree-tmmark" } */
+
+/* If we're sure to go irrevocable, as in the case below, do not pass
+ PR_INSTRUMENTEDCODE to the run-time if there is nothing
+ instrumented within the transaction. */
+
+int
+main()
+{
+ __transaction_relaxed { __asm__(""); }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times " instrumentedCode" 0 "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */
flags |= PR_HASNOABORT;
if ((subcode & GTMA_HAVE_STORE) == 0)
flags |= PR_READONLY;
- if (inst_edge)
+ if (inst_edge && !(subcode & GTMA_HAS_NO_INSTRUMENTATION))
flags |= PR_INSTRUMENTEDCODE;
if (uninst_edge)
flags |= PR_UNINSTRUMENTEDCODE;
if (subcode & GTMA_DOES_GO_IRREVOCABLE)
subcode &= (GTMA_DECLARATION_MASK | GTMA_DOES_GO_IRREVOCABLE
- | GTMA_MAY_ENTER_IRREVOCABLE);
+ | GTMA_MAY_ENTER_IRREVOCABLE
+ | GTMA_HAS_NO_INSTRUMENTATION);
else
subcode &= GTMA_DECLARATION_MASK;
gimple_transaction_set_subcode (region->transaction_stmt, subcode);
&& bitmap_bit_p (d->irrevocable_blocks_normal,
region->entry_block->index))
{
- transaction_subcode_ior (region, GTMA_DOES_GO_IRREVOCABLE);
- transaction_subcode_ior (region, GTMA_MAY_ENTER_IRREVOCABLE);
+ transaction_subcode_ior (region, GTMA_DOES_GO_IRREVOCABLE
+ | GTMA_MAY_ENTER_IRREVOCABLE
+ | GTMA_HAS_NO_INSTRUMENTATION);
continue;
}