This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
S/390: Minor scheduling tweaks
- From: Ulrich Weigand <weigand at i1 dot informatik dot uni-erlangen dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 28 Sep 2004 23:40:58 +0200 (CEST)
- Subject: S/390: Minor scheduling tweaks
Hello,
some minor tweaks related to scheduling:
- s390_adjust_cost is now superfluous, everything is handled
via the DFA
- handle store-multiple insns like store in s390_adjust_priority
- fix type attribute for main_pool on 64-bit
Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux.
Applied to mainline.
Bye,
Ulrich
ChangeLog:
* config/s390/s390.c (s390_adjust_cost): Remove.
(TARGET_SCHED_ADJUST_COST): Do not redefine.
(s390_adjust_priority): Handle TYPE_STM like TYPE_STORE.
* config/s390/s390.md ("main_pool"): Use "larl" type
attribute if TARGET_CPU_ZARCH.
Index: gcc/config/s390/s390.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.c,v
retrieving revision 1.179
diff -c -p -r1.179 s390.c
*** gcc/config/s390/s390.c 25 Sep 2004 00:16:55 -0000 1.179
--- gcc/config/s390/s390.c 28 Sep 2004 19:14:50 -0000
*************** static void s390_output_mi_thunk (FILE *
*** 67,73 ****
HOST_WIDE_INT, tree);
static enum attr_type s390_safe_attr_type (rtx);
- static int s390_adjust_cost (rtx, rtx, rtx, int);
static int s390_adjust_priority (rtx, int);
static int s390_issue_rate (void);
static int s390_first_cycle_multipass_dfa_lookahead (void);
--- 67,72 ----
*************** static bool s390_pass_by_reference (CUMU
*** 121,128 ****
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_tree_hwi_hwi_tree_true
- #undef TARGET_SCHED_ADJUST_COST
- #define TARGET_SCHED_ADJUST_COST s390_adjust_cost
#undef TARGET_SCHED_ADJUST_PRIORITY
#define TARGET_SCHED_ADJUST_PRIORITY s390_adjust_priority
#undef TARGET_SCHED_ISSUE_RATE
--- 120,125 ----
*************** s390_agen_dep_p (rtx dep_insn, rtx insn)
*** 4167,4207 ****
return 0;
}
- /* Return the modified cost of the dependency of instruction INSN
- on instruction DEP_INSN through the link LINK. COST is the
- default cost of that dependency.
-
- Data dependencies are all handled without delay. However, if a
- register is modified and subsequently used as base or index
- register of a memory reference, at least 4 cycles need to pass
- between setting and using the register to avoid pipeline stalls.
- An exception is the LA instruction. An address generated by LA can
- be used by introducing only a one cycle stall on the pipeline. */
-
- static int
- s390_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost)
- {
- /* If the dependence is an anti-dependence, there is no cost. For an
- output dependence, there is sometimes a cost, but it doesn't seem
- worth handling those few cases. */
-
- if (REG_NOTE_KIND (link) != 0)
- return 0;
-
- /* If we can't recognize the insns, we can't really do anything. */
- if (recog_memoized (insn) < 0 || recog_memoized (dep_insn) < 0)
- return cost;
-
- /* Operand forward in case of lr, load and la. */
- if (s390_tune == PROCESSOR_2084_Z990
- && cost == 1
- && (s390_safe_attr_type (dep_insn) == TYPE_LA
- || s390_safe_attr_type (dep_insn) == TYPE_LR
- || s390_safe_attr_type (dep_insn) == TYPE_LOAD))
- return 0;
- return cost;
- }
-
/* A C statement (sans semicolon) to update the integer scheduling priority
INSN_PRIORITY (INSN). Increase the priority to execute the INSN earlier,
reduce the priority to execute INSN later. Do not define this macro if
--- 4164,4169 ----
*************** s390_adjust_priority (rtx insn ATTRIBUTE
*** 4226,4231 ****
--- 4188,4194 ----
priority = priority << 3;
break;
case TYPE_STORE:
+ case TYPE_STM:
priority = priority << 1;
break;
default:
Index: gcc/config/s390/s390.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.md,v
retrieving revision 1.126
diff -c -p -r1.126 s390.md
*** gcc/config/s390/s390.md 25 Sep 2004 00:16:56 -0000 1.126
--- gcc/config/s390/s390.md 28 Sep 2004 19:14:51 -0000
***************
*** 7405,7411 ****
(unspec_volatile [(const_int 0)] UNSPECV_MAIN_POOL))]
"GET_MODE (operands[0]) == Pmode"
"* abort ();"
! [(set_attr "op_type" "NN")])
(define_insn "reload_base_31"
[(set (match_operand 0 "register_operand" "=a")
--- 7405,7414 ----
(unspec_volatile [(const_int 0)] UNSPECV_MAIN_POOL))]
"GET_MODE (operands[0]) == Pmode"
"* abort ();"
! [(set_attr "op_type" "NN")
! (set (attr "type")
! (if_then_else (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0))
! (const_string "larl") (const_string "la")))])
(define_insn "reload_base_31"
[(set (match_operand 0 "register_operand" "=a")
--
Dr. Ulrich Weigand
weigand@informatik.uni-erlangen.de