Merge lp:~cltang/gcc-linaro/lp-721021-tune-xscale into lp:gcc-linaro/4.5

Proposed by Chung-Lin Tang
Status: Merged
Merged at revision: 99479
Proposed branch: lp:~cltang/gcc-linaro/lp-721021-tune-xscale
Merge into: lp:gcc-linaro/4.5
Diff against target: 107 lines (+44/-32)
2 files modified
ChangeLog.linaro (+12/-0)
gcc/config/arm/arm.c (+32/-32)
To merge this branch: bzr merge lp:~cltang/gcc-linaro/lp-721021-tune-xscale
Reviewer Review Type Date Requested Status
Andrew Stubbs (community) Approve
Review via email: mp+51188@code.launchpad.net

Description of the change

This is a backport of the fix for PR45177, where the XScale ldm/stm cost heuristics were adjusted to fix an OOM bug.

To post a comment you must log in.
Revision history for this message
Andrew Stubbs (ams-codesourcery) wrote :

Applied and tested with no regressions. Approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog.linaro'
2--- ChangeLog.linaro 2011-02-22 11:38:56 +0000
3+++ ChangeLog.linaro 2011-02-24 18:28:04 +0000
4@@ -1,3 +1,15 @@
5+2011-02-24 Chung-Lin Tang <cltang@codesourcery.com>
6+
7+ Backport from FSF mainline:
8+
9+ 2010-08-10 Bernd Schmidt <bernds@codesourcery.com>
10+
11+ PR bootstrap/45177
12+ * config/arm/arm.c (multiple_operation_profitable_p): Move xscale
13+ test here from arm_gen_load_multiple_1.
14+ (arm_gen_load_multiple_1, arm_gen_store_multiple_1): Use
15+ multiple_operation_profitable_p.
16+
17 2011-02-22 Andrew Stubbs <ams@codesourcery.com>
18
19 Merge from FSF 4.5 branch r170352 (pre 4.5.3).
20
21=== modified file 'gcc/config/arm/arm.c'
22--- gcc/config/arm/arm.c 2011-02-22 11:38:56 +0000
23+++ gcc/config/arm/arm.c 2011-02-24 18:28:04 +0000
24@@ -9728,6 +9728,36 @@
25 if (nops == 2 && arm_ld_sched && add_offset != 0)
26 return false;
27
28+ /* XScale has load-store double instructions, but they have stricter
29+ alignment requirements than load-store multiple, so we cannot
30+ use them.
31+
32+ For XScale ldm requires 2 + NREGS cycles to complete and blocks
33+ the pipeline until completion.
34+
35+ NREGS CYCLES
36+ 1 3
37+ 2 4
38+ 3 5
39+ 4 6
40+
41+ An ldr instruction takes 1-3 cycles, but does not block the
42+ pipeline.
43+
44+ NREGS CYCLES
45+ 1 1-3
46+ 2 2-6
47+ 3 3-9
48+ 4 4-12
49+
50+ Best case ldr will always win. However, the more ldr instructions
51+ we issue, the less likely we are to be able to schedule them well.
52+ Using ldr instructions also increases code size.
53+
54+ As a compromise, we use ldr for counts of 1 or 2 regs, and ldm
55+ for counts of 3 or 4 regs. */
56+ if (nops <= 2 && arm_tune_xscale && !optimize_size)
57+ return false;
58 return true;
59 }
60
61@@ -10086,35 +10116,7 @@
62 int i = 0, j;
63 rtx result;
64
65- /* XScale has load-store double instructions, but they have stricter
66- alignment requirements than load-store multiple, so we cannot
67- use them.
68-
69- For XScale ldm requires 2 + NREGS cycles to complete and blocks
70- the pipeline until completion.
71-
72- NREGS CYCLES
73- 1 3
74- 2 4
75- 3 5
76- 4 6
77-
78- An ldr instruction takes 1-3 cycles, but does not block the
79- pipeline.
80-
81- NREGS CYCLES
82- 1 1-3
83- 2 2-6
84- 3 3-9
85- 4 4-12
86-
87- Best case ldr will always win. However, the more ldr instructions
88- we issue, the less likely we are to be able to schedule them well.
89- Using ldr instructions also increases code size.
90-
91- As a compromise, we use ldr for counts of 1 or 2 regs, and ldm
92- for counts of 3 or 4 regs. */
93- if (low_irq_latency || (arm_tune_xscale && count <= 2 && ! optimize_size))
94+ if (low_irq_latency || !multiple_operation_profitable_p (false, count, 0))
95 {
96 rtx seq;
97
98@@ -10166,9 +10168,7 @@
99 if (GET_CODE (basereg) == PLUS)
100 basereg = XEXP (basereg, 0);
101
102- /* See arm_gen_load_multiple_1 for discussion of
103- the pros/cons of ldm/stm usage for XScale. */
104- if (low_irq_latency || (arm_tune_xscale && count <= 2 && ! optimize_size))
105+ if (low_irq_latency || !multiple_operation_profitable_p (false, count, 0))
106 {
107 rtx seq;
108

Subscribers

People subscribed via source and target branches