Commit 9fff751c by Uros Bizjak

i386.c (distance_non_agu_define): Simplify calculation of "found".

	* config/i386/i386.c (distance_non_agu_define): Simplify calculation
	of "found".  Simplify return value calculation.
	(distance_agu_use): Ditto.

From-SVN: r179561
parent 17a3dae3
2011-10-05 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.c (distance_non_agu_define): Simplify calculation
of "found". Simplify return value calculation.
(distance_agu_use): Ditto.
2011-10-05 Bernd Schmidt <bernds@codesourcery.com> 2011-10-05 Bernd Schmidt <bernds@codesourcery.com>
PR bootstrap/50621 PR bootstrap/50621
...@@ -20,8 +26,7 @@ ...@@ -20,8 +26,7 @@
small data area register. small data area register.
(rx_pid_base_regnum): New function. Returns the number of the pid (rx_pid_base_regnum): New function. Returns the number of the pid
base register. base register.
(rx_decl_for_addr): New function. Returns the symbolic part of a (rx_decl_for_addr): New function. Returns the symbolic part of a MEM.
MEM.
(rx_pid_data_operand): New function. Returns whether an object is (rx_pid_data_operand): New function. Returns whether an object is
in the position independent data area. in the position independent data area.
(rx_legitimize_address): New function. Puts undecided PID (rx_legitimize_address): New function. Puts undecided PID
...@@ -49,8 +54,7 @@ ...@@ -49,8 +54,7 @@
(CASE_VECTOR_PC_RELATIVE): Define. (CASE_VECTOR_PC_RELATIVE): Define.
(JUMP_TABLES_IN_TEXT_SECTION): Enable for PID mode. (JUMP_TABLES_IN_TEXT_SECTION): Enable for PID mode.
* config/rx/rx-protos.h (rx_maybe_pidify_operand): Prototype. * config/rx/rx-protos.h (rx_maybe_pidify_operand): Prototype.
* doc/invoke.texi (RX Options): Document -mpid command line * doc/invoke.texi (RX Options): Document -mpid command line option.
option.
2011-10-05 Richard Guenther <rguenther@suse.de> 2011-10-05 Richard Guenther <rguenther@suse.de>
...@@ -101,9 +105,8 @@ ...@@ -101,9 +105,8 @@
2011-10-05 Richard Guenther <rguenther@suse.de> 2011-10-05 Richard Guenther <rguenther@suse.de>
* gimple-fold.c (gimple_fold_stmt_to_constant_1): For * gimple-fold.c (gimple_fold_stmt_to_constant_1): For ternary ops
ternary ops with an embedded expression valueize and fold with an embedded expression valueize and fold that as well.
that as well.
* tree-ssa-sccvn.c (try_to_simplify): Also allow SSA name * tree-ssa-sccvn.c (try_to_simplify): Also allow SSA name
results from gimple_fold_stmt_to_constant_1. results from gimple_fold_stmt_to_constant_1.
...@@ -16142,19 +16142,20 @@ distance_non_agu_define (unsigned int regno1, unsigned int regno2, ...@@ -16142,19 +16142,20 @@ distance_non_agu_define (unsigned int regno1, unsigned int regno2,
FOR_EACH_EDGE (e, ei, bb->preds) FOR_EACH_EDGE (e, ei, bb->preds)
{ {
int bb_dist = distance_non_agu_define_in_bb (regno1, regno2, int bb_dist
insn, distance, = distance_non_agu_define_in_bb (regno1, regno2,
BB_END (e->src), insn, distance,
&found_in_bb); BB_END (e->src),
&found_in_bb);
if (found_in_bb) if (found_in_bb)
{ {
if (shortest_dist < 0) if (shortest_dist < 0)
shortest_dist = bb_dist; shortest_dist = bb_dist;
else if (bb_dist > 0) else if (bb_dist > 0)
shortest_dist = MIN (bb_dist, shortest_dist); shortest_dist = MIN (bb_dist, shortest_dist);
}
found = found || found_in_bb; found = true;
}
} }
distance = shortest_dist; distance = shortest_dist;
...@@ -16167,11 +16168,9 @@ distance_non_agu_define (unsigned int regno1, unsigned int regno2, ...@@ -16167,11 +16168,9 @@ distance_non_agu_define (unsigned int regno1, unsigned int regno2,
extract_insn_cached (insn); extract_insn_cached (insn);
if (!found) if (!found)
distance = -1; return -1;
else
distance = distance >> 1;
return distance; return distance >> 1;
} }
/* Return the distance in half-cycles between INSN and the next /* Return the distance in half-cycles between INSN and the next
...@@ -16184,9 +16183,9 @@ distance_non_agu_define (unsigned int regno1, unsigned int regno2, ...@@ -16184,9 +16183,9 @@ distance_non_agu_define (unsigned int regno1, unsigned int regno2,
found and false otherwise. */ found and false otherwise. */
static int static int
distance_agu_use_in_bb(unsigned int regno, distance_agu_use_in_bb (unsigned int regno,
rtx insn, int distance, rtx start, rtx insn, int distance, rtx start,
bool *found, bool *redefined) bool *found, bool *redefined)
{ {
basic_block bb = start ? BLOCK_FOR_INSN (start) : NULL; basic_block bb = start ? BLOCK_FOR_INSN (start) : NULL;
rtx next = start; rtx next = start;
...@@ -16271,18 +16270,19 @@ distance_agu_use (unsigned int regno0, rtx insn) ...@@ -16271,18 +16270,19 @@ distance_agu_use (unsigned int regno0, rtx insn)
FOR_EACH_EDGE (e, ei, bb->succs) FOR_EACH_EDGE (e, ei, bb->succs)
{ {
int bb_dist = distance_agu_use_in_bb (regno0, insn, int bb_dist
distance, BB_HEAD (e->dest), = distance_agu_use_in_bb (regno0, insn,
&found_in_bb, &redefined_in_bb); distance, BB_HEAD (e->dest),
&found_in_bb, &redefined_in_bb);
if (found_in_bb) if (found_in_bb)
{ {
if (shortest_dist < 0) if (shortest_dist < 0)
shortest_dist = bb_dist; shortest_dist = bb_dist;
else if (bb_dist > 0) else if (bb_dist > 0)
shortest_dist = MIN (bb_dist, shortest_dist); shortest_dist = MIN (bb_dist, shortest_dist);
}
found = found || found_in_bb; found = true;
}
} }
distance = shortest_dist; distance = shortest_dist;
...@@ -16290,11 +16290,9 @@ distance_agu_use (unsigned int regno0, rtx insn) ...@@ -16290,11 +16290,9 @@ distance_agu_use (unsigned int regno0, rtx insn)
} }
if (!found || redefined) if (!found || redefined)
distance = -1; return -1;
else
distance = distance >> 1;
return distance; return distance >> 1;
} }
/* Define this macro to tune LEA priority vs ADD, it take effect when /* Define this macro to tune LEA priority vs ADD, it take effect when
...@@ -16349,7 +16347,7 @@ ix86_lea_outperforms (rtx insn, unsigned int regno0, unsigned int regno1, ...@@ -16349,7 +16347,7 @@ ix86_lea_outperforms (rtx insn, unsigned int regno0, unsigned int regno1,
false otherwise. */ false otherwise. */
static bool static bool
ix86_ok_to_clobber_flags(rtx insn) ix86_ok_to_clobber_flags (rtx insn)
{ {
basic_block bb = BLOCK_FOR_INSN (insn); basic_block bb = BLOCK_FOR_INSN (insn);
df_ref *use; df_ref *use;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment