aboutsummaryrefslogtreecommitdiff
path: root/gcc/lra-constraints.c
diff options
context:
space:
mode:
authorVladimir Makarov <vmakarov@redhat.com>2017-04-07 16:01:50 +0000
committerVladimir Makarov <vmakarov@gcc.gnu.org>2017-04-07 16:01:50 +0000
commit057da7af80d2fca356032c22efefcaf50d04da8b (patch)
tree1440f552945d7e20bb953c464d47bae09d44299b /gcc/lra-constraints.c
parente3d1043293beed1696e6cb68f19d3bd6fb44c3b0 (diff)
downloadgcc-057da7af80d2fca356032c22efefcaf50d04da8b.zip
gcc-057da7af80d2fca356032c22efefcaf50d04da8b.tar.gz
gcc-057da7af80d2fca356032c22efefcaf50d04da8b.tar.bz2
re PR rtl-optimization/70478 ([LRA] S/390: Performance regression - superfluous stack frame)
2017-04-07 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimization/70478 * lra-constraints.c (process_alt_operands): Disfavor alternative insn memory operands. 2017-04-07 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimization/70478 * gcc.target/s390/pr70478.c: New. From-SVN: r246764
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r--gcc/lra-constraints.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index 4d98624..9440205 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -2685,6 +2685,21 @@ process_alt_operands (int only_alternative)
}
}
+ /* When we use memory operand, the insn should read the
+ value from memory and even if we just wrote a value
+ into the memory it is costly in comparison with an
+ insn alternative which does not use memory
+ (e.g. register or immediate operand). */
+ if (no_regs_p && offmemok)
+ {
+ if (lra_dump_file != NULL)
+ fprintf
+ (lra_dump_file,
+ " Using memory insn operand %d: reject+=3\n",
+ nop);
+ reject += 3;
+ }
+
#ifdef SECONDARY_MEMORY_NEEDED
/* If reload requires moving value through secondary
memory, it will need one more insn at least. */