aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>2017-06-01 11:30:36 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2017-06-01 11:30:36 +0000
commit4ba66aee9e94f1bfb82fbebac661ad60cbce1176 (patch)
tree920f8201c4998b83ba0902c07bf6f8b77588fb31
parente257141f075b6764ea5a1c1d7b1f2d364bf241a2 (diff)
downloadgcc-4ba66aee9e94f1bfb82fbebac661ad60cbce1176.zip
gcc-4ba66aee9e94f1bfb82fbebac661ad60cbce1176.tar.gz
gcc-4ba66aee9e94f1bfb82fbebac661ad60cbce1176.tar.bz2
S/390: Don't fetch the return address early with ooo
We used to load the return address slot some time in advance. This helped on older machines to resolve the data dependencies in time. However, it is pointless on out of order CPUs. Disabled with that patch. gcc/ChangeLog: 2017-06-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * config/s390/s390.c (s390_emit_epilogue): Disable early return address fetch for z10 or later. From-SVN: r248789
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/s390/s390.c63
2 files changed, 37 insertions, 31 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9ff24c9..9cfcfad 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2017-06-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+
+ * config/s390/s390.c (s390_emit_epilogue): Disable early return
+ address fetch for z10 or later.
+
2017-06-01 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.md (tst_movb): Add guard when splitting.
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 7be22d9..eb94237 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -11410,38 +11410,39 @@ s390_emit_epilogue (bool sibcall)
gen_rtx_REG (Pmode, i), cfa_restores);
}
- if (! sibcall)
- {
- /* Fetch return address from stack before load multiple,
- this will do good for scheduling.
-
- Only do this if we already decided that r14 needs to be
- saved to a stack slot. (And not just because r14 happens to
- be in between two GPRs which need saving.) Otherwise it
- would be difficult to take that decision back in
- s390_optimize_prologue. */
- if (cfun_gpr_save_slot (RETURN_REGNUM) == SAVE_SLOT_STACK)
- {
- int return_regnum = find_unused_clobbered_reg();
- if (!return_regnum)
- return_regnum = 4;
- return_reg = gen_rtx_REG (Pmode, return_regnum);
-
- addr = plus_constant (Pmode, frame_pointer,
- offset + cfun_frame_layout.gprs_offset
- + (RETURN_REGNUM
- - cfun_frame_layout.first_save_gpr_slot)
- * UNITS_PER_LONG);
- addr = gen_rtx_MEM (Pmode, addr);
- set_mem_alias_set (addr, get_frame_alias_set ());
- emit_move_insn (return_reg, addr);
+ /* Fetch return address from stack before load multiple,
+ this will do good for scheduling.
+
+ Only do this if we already decided that r14 needs to be
+ saved to a stack slot. (And not just because r14 happens to
+ be in between two GPRs which need saving.) Otherwise it
+ would be difficult to take that decision back in
+ s390_optimize_prologue.
+
+ This optimization is only helpful on in-order machines. */
+ if (! sibcall
+ && cfun_gpr_save_slot (RETURN_REGNUM) == SAVE_SLOT_STACK
+ && s390_tune <= PROCESSOR_2097_Z10)
+ {
+ int return_regnum = find_unused_clobbered_reg();
+ if (!return_regnum)
+ return_regnum = 4;
+ return_reg = gen_rtx_REG (Pmode, return_regnum);
+
+ addr = plus_constant (Pmode, frame_pointer,
+ offset + cfun_frame_layout.gprs_offset
+ + (RETURN_REGNUM
+ - cfun_frame_layout.first_save_gpr_slot)
+ * UNITS_PER_LONG);
+ addr = gen_rtx_MEM (Pmode, addr);
+ set_mem_alias_set (addr, get_frame_alias_set ());
+ emit_move_insn (return_reg, addr);
- /* Once we did that optimization we have to make sure
- s390_optimize_prologue does not try to remove the
- store of r14 since we will not be able to find the
- load issued here. */
- cfun_frame_layout.save_return_addr_p = true;
- }
+ /* Once we did that optimization we have to make sure
+ s390_optimize_prologue does not try to remove the store
+ of r14 since we will not be able to find the load issued
+ here. */
+ cfun_frame_layout.save_return_addr_p = true;
}
insn = restore_gprs (frame_pointer,