Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
56eb4c70
Commit
56eb4c70
authored
Jan 07, 2020
by
Michael Meissner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore patch reverted on trunk instead of a branch
From-SVN: r279972
parent
cdf77151
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
3 deletions
+89
-3
gcc/config/rs6000/rs6000.c
+86
-0
gcc/ipa-inline-analysis.c
+1
-1
gcc/ipa-inline.c
+2
-2
No files found.
gcc/config/rs6000/rs6000.c
View file @
56eb4c70
...
...
@@ -6753,6 +6753,90 @@ hard_reg_and_mode_to_addr_mask (rtx reg, machine_mode mode)
return
addr_mask
;
}
/* Helper function to adjust a vector address (ADDR) to point to a given
element offset (ELEMENT_OFFSET). This function handles updating addresses
that use PLUS (i.e. a D_FORM address with an integer constant or an X_FORM
address adding two registers). If we can't update the address directly, we
can use the base register temporary (BASE_TMP) to form a valid address. The
mode of the element within the vector is SCALAR_MODE. */
rtx
adjust_vec_address_plus
(
rtx
addr
,
rtx
element_offset
,
rtx
base_tmp
,
machine_mode
scalar_mode
)
{
gcc_assert
(
GET_CODE
(
addr
)
==
PLUS
);
rtx
new_addr
=
NULL
;
rtx
op0
=
XEXP
(
addr
,
0
);
rtx
op1
=
XEXP
(
addr
,
1
);
rtx
insn
;
gcc_assert
(
REG_P
(
op0
)
||
SUBREG_P
(
op0
));
if
(
CONST_INT_P
(
op1
)
&&
CONST_INT_P
(
element_offset
))
{
HOST_WIDE_INT
offset
=
INTVAL
(
op1
)
+
INTVAL
(
element_offset
);
rtx
offset_rtx
=
GEN_INT
(
offset
);
new_addr
=
gen_rtx_PLUS
(
Pmode
,
op0
,
offset_rtx
);
enum
insn_form
iform
=
address_to_insn_form
(
new_addr
,
scalar_mode
,
NON_PREFIXED_DEFAULT
);
/* If the address isn't valid, change REG+OFFSET into REG+REG. */
if
(
iform
==
INSN_FORM_BAD
)
{
/* The offset either overflowed or it might not be a valid DS/DQ
offset, move offset to the temporary (which will likely be split),
and do X-FORM addressing. */
emit_move_insn
(
base_tmp
,
offset_rtx
);
new_addr
=
gen_rtx_PLUS
(
Pmode
,
op0
,
base_tmp
);
}
}
else
{
bool
op1_reg_p
=
(
REG_P
(
op1
)
||
SUBREG_P
(
op1
));
bool
ele_reg_p
=
(
REG_P
(
element_offset
)
||
SUBREG_P
(
element_offset
));
/* Note, ADDI requires the register being added to be a base
register. If the register was R0, load it up into the temporary
and do the add. */
if
(
op1_reg_p
&&
(
ele_reg_p
||
reg_or_subregno
(
op1
)
!=
FIRST_GPR_REGNO
))
{
insn
=
gen_add3_insn
(
base_tmp
,
op1
,
element_offset
);
gcc_assert
(
insn
!=
NULL_RTX
);
emit_insn
(
insn
);
}
else
if
(
ele_reg_p
&&
reg_or_subregno
(
element_offset
)
!=
FIRST_GPR_REGNO
)
{
insn
=
gen_add3_insn
(
base_tmp
,
element_offset
,
op1
);
gcc_assert
(
insn
!=
NULL_RTX
);
emit_insn
(
insn
);
}
/* Make sure we don't overwrite the temporary if the element being
extracted is variable, and we've put the offset into base_tmp
previously. */
else
if
(
reg_mentioned_p
(
base_tmp
,
element_offset
))
emit_insn
(
gen_add2_insn
(
base_tmp
,
op1
));
else
{
emit_move_insn
(
base_tmp
,
op1
);
emit_insn
(
gen_add2_insn
(
base_tmp
,
element_offset
));
}
new_addr
=
gen_rtx_PLUS
(
Pmode
,
op0
,
base_tmp
);
}
return
new_addr
;
}
/* Adjust a memory address (MEM) of a vector type to point to a scalar field
within the vector (ELEMENT) with a mode (SCALAR_MODE). Use a base register
temporary (BASE_TMP) to fixup the address. Return the new memory address
...
...
@@ -6898,6 +6982,8 @@ rs6000_adjust_vec_address (rtx scalar_reg,
valid_addr_p
=
(
addr_mask
&
RELOAD_REG_OFFSET
)
!=
0
;
}
/* An address that is a single register is always valid for either indexed or
offsettable loads. */
else
if
(
REG_P
(
new_addr
)
||
SUBREG_P
(
new_addr
))
valid_addr_p
=
true
;
...
...
gcc/ipa-inline-analysis.c
View file @
56eb4c70
...
...
@@ -462,7 +462,7 @@ offline_size (struct cgraph_node *node, ipa_size_summary *info)
return
0
;
}
/* Estimate the growth caused by inlining NODE into all calle
e
s. */
/* Estimate the growth caused by inlining NODE into all calle
r
s. */
int
estimate_growth
(
struct
cgraph_node
*
node
)
...
...
gcc/ipa-inline.c
View file @
56eb4c70
...
...
@@ -184,8 +184,8 @@ caller_growth_limits (struct cgraph_edge *e)
the function to shrink if it went over the limits by forced inlining. */
newsize
=
estimate_size_after_inlining
(
to
,
e
);
if
(
newsize
>=
ipa_size_summaries
->
get
(
what
)
->
size
&&
newsize
>
opt_for_fn
(
to
->
decl
,
param_large_function_insns
)
&&
newsize
>
limit
)
&&
(
newsize
>
opt_for_fn
(
to
->
decl
,
param_large_function_insns
)
||
newsize
>
limit
)
)
{
e
->
inline_failed
=
CIF_LARGE_FUNCTION_GROWTH_LIMIT
;
return
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment