This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][IRA] Analysis of register usage of functions for usage by IRA.


On 03/14/2013 05:34 AM, Tom de Vries wrote:
On 13/02/13 23:35, Vladimir Makarov wrote:

Sorry for the delay with the answer. I was and am quite busy with other more urgent things. I'll work on it when I have more free time. In any case, I'll do it before stage1 to have your patch ready.
Vladimir,

do you have an ETA on this review?


Actually, I am done with it. In general, it is ok. Although I have some minors comments:

In Changelog, you missed '*" before cgraph.h:

    * haifa-sched.c (recompute_todo_spec, check_clobbered_conditions): Add
    new argument to find_all_hard_reg_sets call.
    cgraph.h (struct cgraph_node): Add function_used_regs,
    function_used_regs_initialized and function_used_regs_valid fields.


@@ -3391,6 +3394,7 @@ df_get_call_refs (struct df_collection_r } } else if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i)

I'd remove the test of regs_invalidated_by_call.

+           && TEST_HARD_REG_BIT (fn_reg_set_usage, i)
            /* no clobbers for regs that are the result of the call */
            && !TEST_HARD_REG_BIT (defs_generated, i)

+static void
+collect_fn_hard_reg_usage (void)
+{
+ rtx insn;
+ int i;
+ struct cgraph_node *node;
+ struct hard_reg_set_container other_usage;
+
+ if (!flag_use_caller_save)
+ return;
+
+ node = cgraph_get_node (current_function_decl);
+ gcc_assert (node != NULL);
+
+ gcc_assert (!node->function_used_regs_initialized);
+ node->function_used_regs_initialized = 1;
+
+ for (insn = get_insns (); insn != NULL_RTX; insn = next_insn (insn))
+ {
+ HARD_REG_SET insn_used_regs;
+
+ if (!NONDEBUG_INSN_P (insn))
+ continue;
+
+ find_all_hard_reg_sets (insn, &insn_used_regs, false);
+
+ if (CALL_P (insn)
+ && !get_call_reg_set_usage (insn, &insn_used_regs, call_used_reg_set))
+ {
+ CLEAR_HARD_REG_SET (node->function_used_regs);
+ return;
+ }
+


I'd put it before find_all_hard_reg_sets

+      IOR_HARD_REG_SET (node->function_used_regs, insn_used_regs);
+    }
+



But you can ignore my two last 2 comments.

The patch is ok for me for trunk at stage1. But I think you need a formal approval for df-scan.c, arm.c, mips.c, GCC testsuite expect files (lib/target-supports.exp and gcc.target/mips/mips.exp) as I am not a maintainer of these parts although these changes look ok for me.

Thanks for your hard work and sorry for the review delay.

I guess you need to pay attention to reported problems for some time after you commit the patch as it affects all targets.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]