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: Fwd: [PATCH] Scheduling result adjustment to enable macro-fusion


On 10/15/13 15:30, Wei Mi wrote:


Aren't you just trying to see if we have a comparison feeding the
conditional jump and if they're already adjacent?  Do you actually need to
get the condition code regs to do that test?


Yes, I am trying to see if we have a comparison feeding the
conditional jump and if they're already adjacent. Do you have more
easier way to do that test?
Can't you just look at the last insn in the block and if it's a conditional peek at the previous insn and see if it sets CC mode register?

Hmm, I guess that's effectively what you're doing, I guess I was just surprised by the need to first get the fixed_condition_code_regs as I expected you to just extract them from the conditional jump. But thinking a bit more about it now your solution seems rather clean.



   static void haifa_init_only_bb (basic_block, basic_block);
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index e1a2dce..156359e 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -2443,6 +2443,8 @@ add_branch_dependences (rtx head, rtx tail)
        cc0 setters remain at the end because they can't be moved away from
        their cc0 user.

+     Predecessors of SCHED_GROUP_P instructions at the end remain at the
end.
+
        COND_EXEC insns cannot be moved past a branch (see e.g. PR17808).

        Insns setting TARGET_CLASS_LIKELY_SPILLED_P registers (usually
return
@@ -2465,7 +2467,8 @@ add_branch_dependences (rtx head, rtx tail)
   #endif
                   || (!reload_completed
                       && sets_likely_spilled (PATTERN (insn)))))
-        || NOTE_P (insn))
+        || NOTE_P (insn)
+        || (last != 0 && SCHED_GROUP_P (last)))
       {
         if (!NOTE_P (insn))
          {

This looks like a straighforward bugfix and probably should go forward
independent of this enhancement.

Ok, I will separate it into another patch.
Go ahead and consider that pre-approved. Just send it to the list with a note that I approved it in this thread.


Jeff


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