This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RFC: use predicates for RTL objects more
- From: Steven Bosscher <stevenb at suse dot de>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 10 May 2004 00:14:03 +0200
- Subject: RFC: use predicates for RTL objects more
- Organization: SUSE Labs
Hi,
In rtl.h there are a lot of predicates apparently used as short-hands
for GET_CODE(X) == SOME_CODE, but they're not always used everywhere.
IMHO it would make the RTL optimizers more readable if the predicates
were used everywhere, but it takes many purely cosmetic changes and
it may clutter CVS, so I'm not sure if that's something we want.
So I'd like to head some opinions ;-)
As an example, the attached patch makes gcse.c use the available
predicates as well as a few new ones:
NONJUMP_INSN_P(X) --> (GET_CODE(X)==INSN)
because we have INSN_P but that is also for jumps and calls.
CALL_P --> (GET_CODE(X)==CALL_INSN)
like NONJUMP_INSN_P and JUMP_P
MEM_P
like REG_P
(It'd probably be nice to also have SET_P(X), there are many places
where we check GET_CODE(X)==SET...)
As you can see, the diff is huge, which is why I wouldn't want to do
this for all files in one big patch... Still, do people think it is
a good idea to convert all the files like this?
If so, then I'll prepare a patch for the web docs to add this as a
beginner project.
Another thing I noticed is that INSN_P would always cause a load
to happen
INSN_P -> (GET_RTX_CLASS (GET_CODE(X)) == RTX_INSN)
This is unnecessary, the only machine insns are INSN, JUMP_INSN,
and CALL_INSN. Redefining the predicate as follows seems better:
INSN_P -> (NONJUMP_INSN_P (X) || JUMP_P (X) || CALL_P (X))
which gives an obvious improvement:
movzwq (%rdi), %rax | movzwl (%rdi), %eax
cmpl $7, rtx_class(,%rax,4) | subl $43, %eax
sete %al | cmpw $2, %ax
> setbe %al
movzbl %al, %eax movzbl %al, %eax
(Interestingly, if JUMP_P and CALL_P are swapped, we produce two
compare-and-jump instructions instead of the above. A combine
wart I suppose?)
I'll see if this gives an actual compile time improvement and post
a patch if it does.
Gr.
Steven
Index: gcse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcse.c,v
retrieving revision 1.205.2.38
diff -c -3 -p -r1.205.2.38 gcse.c
*** gcse.c 29 Apr 2004 19:44:29 -0000 1.205.2.38
--- gcse.c 9 May 2004 21:15:22 -0000
*************** Software Foundation, 59 Temple Place - S
*** 231,238 ****
substitutions.
PRE is quite expensive in complicated functions because the DFA can take
! awhile to converge. Hence we only perform one pass. The parameter max-gcse-passes can
! be modified if one wants to experiment.
**********************
--- 231,238 ----
substitutions.
PRE is quite expensive in complicated functions because the DFA can take
! a while to converge. Hence we only perform one pass. The parameter
! max-gcse-passes can be modified if one wants to experiment.
**********************
*************** Software Foundation, 59 Temple Place - S
*** 267,278 ****
**********************
A fair bit of simplicity is created by creating small functions for simple
! tasks, even when the function is only called in one place. This may
! measurably slow things down [or may not] by creating more function call
! overhead than is necessary. The source is laid out so that it's trivial
! to make the affected functions inline so that one can measure what speed
! up, if any, can be achieved, and maybe later when things settle things can
! be rearranged.
Help stamp out big monolithic functions! */
--- 267,273 ----
**********************
A fair bit of simplicity is created by creating small functions for simple
! tasks, even when the function is only called in one place.
Help stamp out big monolithic functions! */
*************** static FILE *gcse_file;
*** 287,293 ****
* If we changed any jumps via cprop.
* If we added any labels via edge splitting. */
-
static int run_jump_opt_after_gcse;
/* Bitmaps are normally not included in debugging dumps.
--- 282,287 ----
*************** gcse_main (rtx f, FILE *file)
*** 737,744 ****
debug_stderr = stderr;
gcse_file = file;
! /* Identify the basic block information for this function, including
! successors and predecessors. */
max_gcse_regno = max_reg_num ();
if (file)
--- 731,738 ----
debug_stderr = stderr;
gcse_file = file;
! /* Save the highest register number. Registers created in this pass
! will have a higher regno than this. */
max_gcse_regno = max_reg_num ();
if (file)
*************** gcse_main (rtx f, FILE *file)
*** 863,868 ****
--- 857,863 ----
obstack_free (&gcse_obstack, NULL);
free_reg_set_mem ();
+
/* We are finished with alias. */
end_alias_analysis ();
allocate_reg_info (max_reg_num (), FALSE, FALSE);
*************** gcse_main (rtx f, FILE *file)
*** 870,876 ****
if (!optimize_size && flag_gcse_sm)
store_motion ();
- /* Record where pseudo-registers are set. */
return run_jump_opt_after_gcse;
}
--- 865,870 ----
*************** get_bitmap_width (int n, int x, int y)
*** 1094,1100 ****
ABSALTERED. */
static void
! compute_local_properties (sbitmap *transp, sbitmap *comp, sbitmap *antloc, struct hash_table *table)
{
unsigned int i;
--- 1088,1095 ----
ABSALTERED. */
static void
! compute_local_properties (sbitmap *transp, sbitmap *comp, sbitmap *antloc,
! struct hash_table *table)
{
unsigned int i;
*************** record_set_info (rtx dest, rtx setter AT
*** 1235,1241 ****
{
rtx record_set_insn = (rtx) data;
! if (GET_CODE (dest) == REG && REGNO (dest) >= FIRST_PSEUDO_REGISTER)
record_one_set (REGNO (dest), record_set_insn);
}
--- 1230,1236 ----
{
rtx record_set_insn = (rtx) data;
! if (REG_P (dest) && REGNO (dest) >= FIRST_PSEUDO_REGISTER)
record_one_set (REGNO (dest), record_set_insn);
}
*************** mems_conflict_for_gcse_p (rtx dest, rtx
*** 1436,1442 ****
/* If DEST is not a MEM, then it will not conflict with the load. Note
that function calls are assumed to clobber memory, but are handled
elsewhere. */
! if (GET_CODE (dest) != MEM)
return;
/* If we are setting a MEM in our list of specially recognized MEMs,
--- 1431,1437 ----
/* If DEST is not a MEM, then it will not conflict with the load. Note
that function calls are assumed to clobber memory, but are handled
elsewhere. */
! if (! MEM_P (dest))
return;
/* If we are setting a MEM in our list of specially recognized MEMs,
*************** load_killed_in_block_p (basic_block bb,
*** 1484,1490 ****
/* If SETTER is a call everything is clobbered. Note that calls
to pure functions are never put on the list, so we need not
worry about them. */
! if (GET_CODE (setter) == CALL_INSN)
return 1;
/* SETTER must be an INSN of some kind that sets memory. Call
--- 1479,1485 ----
/* If SETTER is a call everything is clobbered. Note that calls
to pure functions are never put on the list, so we need not
worry about them. */
! if (CALL_P (setter))
return 1;
/* SETTER must be an INSN of some kind that sets memory. Call
*************** hash_expr_1 (rtx x, enum machine_mode mo
*** 1566,1579 ****
enum rtx_code code;
const char *fmt;
- /* Used to turn recursion into iteration. We can't rely on GCC's
- tail-recursion elimination since we need to keep accumulating values
- in HASH. */
-
if (x == 0)
return hash;
repeat:
code = GET_CODE (x);
switch (code)
{
--- 1561,1574 ----
enum rtx_code code;
const char *fmt;
if (x == 0)
return hash;
+ /* Used to turn recursion into iteration. We can't rely on GCC's
+ tail-recursion elimination since we need to keep accumulating values
+ in HASH. */
repeat:
+
code = GET_CODE (x);
switch (code)
{
*************** insert_set_in_table (rtx x, rtx insn, st
*** 2045,2051 ****
struct occr *cur_occr, *last_occr = NULL;
if (GET_CODE (x) != SET
! || GET_CODE (SET_DEST (x)) != REG)
abort ();
hash = hash_set (REGNO (SET_DEST (x)), table->size);
--- 2040,2046 ----
struct occr *cur_occr, *last_occr = NULL;
if (GET_CODE (x) != SET
! || ! REG_P (SET_DEST (x)))
abort ();
hash = hash_set (REGNO (SET_DEST (x)), table->size);
*************** gcse_constant_p (rtx x)
*** 2129,2140 ****
&& GET_CODE (XEXP (x, 1)) == CONST_INT)
return true;
-
/* Consider a COMPARE of the same registers is a constant
! if they are not floating point registers. */
if (GET_CODE(x) == COMPARE
! && GET_CODE (XEXP (x, 0)) == REG
! && GET_CODE (XEXP (x, 1)) == REG
&& REGNO (XEXP (x, 0)) == REGNO (XEXP (x, 1))
&& ! FLOAT_MODE_P (GET_MODE (XEXP (x, 0)))
&& ! FLOAT_MODE_P (GET_MODE (XEXP (x, 1))))
--- 2124,2133 ----
&& GET_CODE (XEXP (x, 1)) == CONST_INT)
return true;
/* Consider a COMPARE of the same registers is a constant
! if they are not floating point registers. */
if (GET_CODE(x) == COMPARE
! && REG_P (XEXP (x, 0)) && REG_P (XEXP (x, 1))
&& REGNO (XEXP (x, 0)) == REGNO (XEXP (x, 1))
&& ! FLOAT_MODE_P (GET_MODE (XEXP (x, 0)))
&& ! FLOAT_MODE_P (GET_MODE (XEXP (x, 1))))
*************** hash_scan_set (rtx pat, rtx insn, struct
*** 2156,2162 ****
if (GET_CODE (src) == CALL)
hash_scan_call (src, insn, table);
! else if (GET_CODE (dest) == REG)
{
unsigned int regno = REGNO (dest);
rtx tmp;
--- 2149,2155 ----
if (GET_CODE (src) == CALL)
hash_scan_call (src, insn, table);
! else if (REG_P (dest))
{
unsigned int regno = REGNO (dest);
rtx tmp;
*************** hash_scan_set (rtx pat, rtx insn, struct
*** 2186,2192 ****
explicitly, it means address of parameter has been taken,
so we should not extend the lifetime of the pseudo. */
&& ((note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) == 0
! || GET_CODE (XEXP (note, 0)) != MEM))
{
/* An expression is not anticipatable if its operands are
modified before this insn or if this is not the only SET in
--- 2179,2185 ----
explicitly, it means address of parameter has been taken,
so we should not extend the lifetime of the pseudo. */
&& ((note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) == 0
! || ! MEM_P (XEXP (note, 0))))
{
/* An expression is not anticipatable if its operands are
modified before this insn or if this is not the only SET in
*************** hash_scan_set (rtx pat, rtx insn, struct
*** 2205,2211 ****
/* Record sets for constant/copy propagation. */
else if (table->set_p
&& regno >= FIRST_PSEUDO_REGISTER
! && ((GET_CODE (src) == REG
&& REGNO (src) >= FIRST_PSEUDO_REGISTER
&& can_copy_p (GET_MODE (dest))
&& REGNO (src) != regno)
--- 2198,2204 ----
/* Record sets for constant/copy propagation. */
else if (table->set_p
&& regno >= FIRST_PSEUDO_REGISTER
! && ((REG_P (src)
&& REGNO (src) >= FIRST_PSEUDO_REGISTER
&& can_copy_p (GET_MODE (dest))
&& REGNO (src) != regno)
*************** hash_scan_set (rtx pat, rtx insn, struct
*** 2221,2227 ****
/* In case of store we want to consider the memory value as available in
the REG stored in that memory. This makes it possible to remove
redundant loads from due to stores to the same location. */
! else if (flag_gcse_las && GET_CODE (src) == REG && GET_CODE (dest) == MEM)
{
unsigned int regno = REGNO (src);
--- 2214,2220 ----
/* In case of store we want to consider the memory value as available in
the REG stored in that memory. This makes it possible to remove
redundant loads from due to stores to the same location. */
! else if (flag_gcse_las && REG_P (src) && MEM_P (dest))
{
unsigned int regno = REGNO (src);
*************** hash_scan_set (rtx pat, rtx insn, struct
*** 2245,2251 ****
explicitly, it means address of parameter has been taken,
so we should not extend the lifetime of the pseudo. */
&& ((note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) == 0
! || GET_CODE (XEXP (note, 0)) != MEM))
{
/* Stores are never anticipatable. */
int antic_p = 0;
--- 2238,2244 ----
explicitly, it means address of parameter has been taken,
so we should not extend the lifetime of the pseudo. */
&& ((note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) == 0
! || ! MEM_P (XEXP (note, 0))))
{
/* Stores are never anticipatable. */
int antic_p = 0;
*************** canon_list_insert (rtx dest ATTRIBUTE_UN
*** 2412,2418 ****
that function calls are assumed to clobber memory, but are handled
elsewhere. */
! if (GET_CODE (dest) != MEM)
return;
dest_addr = get_addr (XEXP (dest, 0));
--- 2405,2411 ----
that function calls are assumed to clobber memory, but are handled
elsewhere. */
! if (! MEM_P (dest))
return;
dest_addr = get_addr (XEXP (dest, 0));
*************** record_last_mem_set_info (rtx insn)
*** 2441,2447 ****
modify_mem_list[bb] = alloc_INSN_LIST (insn, modify_mem_list[bb]);
bitmap_set_bit (modify_mem_list_set, bb);
! if (GET_CODE (insn) == CALL_INSN)
{
/* Note that traversals of this loop (other than for free-ing)
will break after encountering a CALL_INSN. So, there's no
--- 2434,2440 ----
modify_mem_list[bb] = alloc_INSN_LIST (insn, modify_mem_list[bb]);
bitmap_set_bit (modify_mem_list_set, bb);
! if (CALL_P (insn))
{
/* Note that traversals of this loop (other than for free-ing)
will break after encountering a CALL_INSN. So, there's no
*************** record_last_set_info (rtx dest, rtx sett
*** 2466,2474 ****
if (GET_CODE (dest) == SUBREG)
dest = SUBREG_REG (dest);
! if (GET_CODE (dest) == REG)
record_last_reg_set_info (last_set_insn, REGNO (dest));
! else if (GET_CODE (dest) == MEM
/* Ignore pushes, they clobber nothing. */
&& ! push_operand (dest, GET_MODE (dest)))
record_last_mem_set_info (last_set_insn);
--- 2459,2467 ----
if (GET_CODE (dest) == SUBREG)
dest = SUBREG_REG (dest);
! if (REG_P (dest))
record_last_reg_set_info (last_set_insn, REGNO (dest));
! else if (MEM_P (dest)
/* Ignore pushes, they clobber nothing. */
&& ! push_operand (dest, GET_MODE (dest)))
record_last_mem_set_info (last_set_insn);
*************** compute_hash_table_work (struct hash_tab
*** 2527,2533 ****
if (! INSN_P (insn))
continue;
! if (GET_CODE (insn) == CALL_INSN)
{
bool clobbers_all = false;
#ifdef NON_SAVING_SETJMP
--- 2520,2526 ----
if (! INSN_P (insn))
continue;
! if (CALL_P (insn))
{
bool clobbers_all = false;
#ifdef NON_SAVING_SETJMP
*************** mark_set (rtx pat, rtx insn)
*** 2822,2830 ****
|| GET_CODE (dest) == STRICT_LOW_PART)
dest = XEXP (dest, 0);
! if (GET_CODE (dest) == REG)
SET_REGNO_REG_SET (reg_set_bitmap, REGNO (dest));
! else if (GET_CODE (dest) == MEM)
record_last_mem_set_info (insn);
if (GET_CODE (SET_SRC (pat)) == CALL)
--- 2815,2823 ----
|| GET_CODE (dest) == STRICT_LOW_PART)
dest = XEXP (dest, 0);
! if (REG_P (dest))
SET_REGNO_REG_SET (reg_set_bitmap, REGNO (dest));
! else if (MEM_P (dest))
record_last_mem_set_info (insn);
if (GET_CODE (SET_SRC (pat)) == CALL)
*************** mark_clobber (rtx pat, rtx insn)
*** 2841,2847 ****
while (GET_CODE (clob) == SUBREG || GET_CODE (clob) == STRICT_LOW_PART)
clob = XEXP (clob, 0);
! if (GET_CODE (clob) == REG)
SET_REGNO_REG_SET (reg_set_bitmap, REGNO (clob));
else
record_last_mem_set_info (insn);
--- 2834,2840 ----
while (GET_CODE (clob) == SUBREG || GET_CODE (clob) == STRICT_LOW_PART)
clob = XEXP (clob, 0);
! if (REG_P (clob))
SET_REGNO_REG_SET (reg_set_bitmap, REGNO (clob));
else
record_last_mem_set_info (insn);
*************** compute_kill_rd (void)
*** 2946,2952 ****
rtx insn = CUID_INSN (cuid);
rtx pat = PATTERN (insn);
! if (GET_CODE (insn) == CALL_INSN)
{
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
if (TEST_HARD_REG_BIT (regs_invalidated_by_call, regno))
--- 2939,2945 ----
rtx insn = CUID_INSN (cuid);
rtx pat = PATTERN (insn);
! if (CALL_P (insn))
{
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
if (TEST_HARD_REG_BIT (regs_invalidated_by_call, regno))
*************** compute_kill_rd (void)
*** 2960,2972 ****
enum rtx_code code = GET_CODE (XVECEXP (pat, 0, i));
if ((code == SET || code == CLOBBER)
! && GET_CODE (XEXP (XVECEXP (pat, 0, i), 0)) == REG)
handle_rd_kill_set (insn,
REGNO (XEXP (XVECEXP (pat, 0, i), 0)),
bb);
}
}
! else if (GET_CODE (pat) == SET && GET_CODE (SET_DEST (pat)) == REG)
/* Each setting of this register outside of this block
must be marked in the set of kills in this block. */
handle_rd_kill_set (insn, REGNO (SET_DEST (pat)), bb);
--- 2953,2965 ----
enum rtx_code code = GET_CODE (XVECEXP (pat, 0, i));
if ((code == SET || code == CLOBBER)
! && REG_P (XEXP (XVECEXP (pat, 0, i), 0)))
handle_rd_kill_set (insn,
REGNO (XEXP (XVECEXP (pat, 0, i), 0)),
bb);
}
}
! else if (GET_CODE (pat) == SET && REG_P (SET_DEST (pat)))
/* Each setting of this register outside of this block
must be marked in the set of kills in this block. */
handle_rd_kill_set (insn, REGNO (SET_DEST (pat)), bb);
*************** handle_avail_expr (rtx insn, struct expr
*** 3402,3408 ****
/* At this point we know only one computation of EXPR outside of this
block reaches this insn. Now try to find a register that the
expression is computed into. */
! if (GET_CODE (SET_SRC (expr_set)) == REG)
{
/* This is the case when the available expression that reaches
here has already been handled as an available expression. */
--- 3395,3401 ----
/* At this point we know only one computation of EXPR outside of this
block reaches this insn. Now try to find a register that the
expression is computed into. */
! if (REG_P (SET_SRC (expr_set)))
{
/* This is the case when the available expression that reaches
here has already been handled as an available expression. */
*************** classic_gcse (void)
*** 3558,3566 ****
insn = NEXT_INSN (insn))
{
/* Is insn of form (set (pseudo-reg) ...)? */
! if (GET_CODE (insn) == INSN
&& GET_CODE (PATTERN (insn)) == SET
! && GET_CODE (SET_DEST (PATTERN (insn))) == REG
&& REGNO (SET_DEST (PATTERN (insn))) >= FIRST_PSEUDO_REGISTER)
{
rtx pat = PATTERN (insn);
--- 3551,3559 ----
insn = NEXT_INSN (insn))
{
/* Is insn of form (set (pseudo-reg) ...)? */
! if (NONJUMP_INSN_P (insn)
&& GET_CODE (PATTERN (insn)) == SET
! && REG_P (SET_DEST (PATTERN (insn)))
&& REGNO (SET_DEST (PATTERN (insn))) >= FIRST_PSEUDO_REGISTER)
{
rtx pat = PATTERN (insn);
*************** compute_transp (rtx x, int indx, sbitmap
*** 3733,3739 ****
{
rtx dest, dest_addr;
! if (GET_CODE (XEXP (list_entry, 0)) == CALL_INSN)
{
if (set_p)
SET_BIT (bmap[bb->index], indx);
--- 3726,3732 ----
{
rtx dest, dest_addr;
! if (CALL_P (XEXP (list_entry, 0)))
{
if (set_p)
SET_BIT (bmap[bb->index], indx);
*************** find_avail_set (int regno, rtx insn)
*** 3992,3998 ****
/* If the source of the set is anything except a register, then
we have reached the end of the copy chain. */
! if (GET_CODE (src) != REG)
break;
/* Follow the copy chain, ie start another iteration of the loop
--- 3985,3991 ----
/* If the source of the set is anything except a register, then
we have reached the end of the copy chain. */
! if (! REG_P (src))
break;
/* Follow the copy chain, ie start another iteration of the loop
*************** constprop_register (rtx insn, rtx from,
*** 4130,4136 ****
}
/* Handle normal insns next. */
! if (GET_CODE (insn) == INSN
&& try_replace_reg (from, to, insn))
return 1;
--- 4123,4129 ----
}
/* Handle normal insns next. */
! if (NONJUMP_INSN_P (insn)
&& try_replace_reg (from, to, insn))
return 1;
*************** cprop_insn (rtx insn, int alter_jumps)
*** 4215,4221 ****
return 1;
}
}
! else if (GET_CODE (src) == REG
&& REGNO (src) >= FIRST_PSEUDO_REGISTER
&& REGNO (src) != regno)
{
--- 4208,4214 ----
return 1;
}
}
! else if (REG_P (src)
&& REGNO (src) >= FIRST_PSEUDO_REGISTER
&& REGNO (src) != regno)
{
*************** do_local_cprop (rtx x, rtx insn, int alt
*** 4297,4303 ****
/* Rule out USE instructions and ASM statements as we don't want to
change the hard registers mentioned. */
! if (GET_CODE (x) == REG
&& (REGNO (x) >= FIRST_PSEUDO_REGISTER
|| (GET_CODE (PATTERN (insn)) != USE
&& asm_noperands (PATTERN (insn)) < 0)))
--- 4290,4296 ----
/* Rule out USE instructions and ASM statements as we don't want to
change the hard registers mentioned. */
! if (REG_P (x)
&& (REGNO (x) >= FIRST_PSEUDO_REGISTER
|| (GET_CODE (PATTERN (insn)) != USE
&& asm_noperands (PATTERN (insn)) < 0)))
*************** do_local_cprop (rtx x, rtx insn, int alt
*** 4324,4330 ****
explicitly, it means address of parameter has been taken,
so we should not extend the lifetime of the pseudo. */
&& (!(note = find_reg_note (l->setting_insn, REG_EQUIV, NULL_RTX))
! || GET_CODE (XEXP (note, 0)) != MEM))
newreg = this_rtx;
}
if (newcnst && constprop_register (insn, x, newcnst, alter_jumps))
--- 4317,4323 ----
explicitly, it means address of parameter has been taken,
so we should not extend the lifetime of the pseudo. */
&& (!(note = find_reg_note (l->setting_insn, REG_EQUIV, NULL_RTX))
! || ! MEM_P (XEXP (note, 0))))
newreg = this_rtx;
}
if (newcnst && constprop_register (insn, x, newcnst, alter_jumps))
*************** cprop (int alter_jumps)
*** 4500,4506 ****
/* Keep track of everything modified by this insn. */
/* ??? Need to be careful w.r.t. mods done to INSN. Don't
call mark_oprs_set if we turned the insn into a NOTE. */
! if (GET_CODE (insn) != NOTE)
mark_oprs_set (insn);
}
}
--- 4493,4499 ----
/* Keep track of everything modified by this insn. */
/* ??? Need to be careful w.r.t. mods done to INSN. Don't
call mark_oprs_set if we turned the insn into a NOTE. */
! if (! NOTE_P (insn))
mark_oprs_set (insn);
}
}
*************** find_implicit_sets (void)
*** 4627,4633 ****
if (cond
&& (GET_CODE (cond) == EQ || GET_CODE (cond) == NE)
! && GET_CODE (XEXP (cond, 0)) == REG
&& REGNO (XEXP (cond, 0)) >= FIRST_PSEUDO_REGISTER
&& implicit_set_cond_p (cond))
{
--- 4620,4626 ----
if (cond
&& (GET_CODE (cond) == EQ || GET_CODE (cond) == NE)
! && REG_P (XEXP (cond, 0))
&& REGNO (XEXP (cond, 0)) >= FIRST_PSEUDO_REGISTER
&& implicit_set_cond_p (cond))
{
*************** find_bypass_set (int regno, int bb)
*** 4749,4755 ****
if (gcse_constant_p (src))
result = set;
! if (GET_CODE (src) != REG)
break;
regno = REGNO (src);
--- 4742,4748 ----
if (gcse_constant_p (src))
result = set;
! if (! REG_P (src))
break;
regno = REGNO (src);
*************** bypass_conditional_jumps (void)
*** 4964,4970 ****
for (insn = BB_HEAD (bb);
insn != NULL && insn != NEXT_INSN (BB_END (bb));
insn = NEXT_INSN (insn))
! if (GET_CODE (insn) == INSN)
{
if (setcc)
break;
--- 4957,4963 ----
for (insn = BB_HEAD (bb);
insn != NULL && insn != NEXT_INSN (BB_END (bb));
insn = NEXT_INSN (insn))
! if (NONJUMP_INSN_P (insn))
{
if (setcc)
break;
*************** bypass_conditional_jumps (void)
*** 4977,4990 ****
else
break;
}
! else if (GET_CODE (insn) == JUMP_INSN)
{
if ((any_condjump_p (insn) || computed_jump_p (insn))
&& onlyjump_p (insn))
changed |= bypass_block (bb, setcc, insn);
break;
}
! else if (INSN_P (insn))
break;
}
}
--- 4970,4983 ----
else
break;
}
! else if (JUMP_P (insn))
{
if ((any_condjump_p (insn) || computed_jump_p (insn))
&& onlyjump_p (insn))
changed |= bypass_block (bb, setcc, insn);
break;
}
! else if (CALL_P (insn))
break;
}
}
*************** insert_insn_end_bb (struct expr *expr, b
*** 5271,5278 ****
handle cc0, etc. properly]. Similarly we need to care trapping
instructions in presence of non-call exceptions. */
! if (GET_CODE (insn) == JUMP_INSN
! || (GET_CODE (insn) == INSN
&& (bb->succ->succ_next || (bb->succ->flags & EDGE_ABNORMAL))))
{
#ifdef HAVE_cc0
--- 5264,5271 ----
handle cc0, etc. properly]. Similarly we need to care trapping
instructions in presence of non-call exceptions. */
! if (JUMP_P (insn)
! || (NONJUMP_INSN_P (insn)
&& (bb->succ->succ_next || (bb->succ->flags & EDGE_ABNORMAL))))
{
#ifdef HAVE_cc0
*************** insert_insn_end_bb (struct expr *expr, b
*** 5281,5287 ****
/* It should always be the case that we can put these instructions
anywhere in the basic block with performing PRE optimizations.
Check this. */
! if (GET_CODE (insn) == INSN && pre
&& !TEST_BIT (antloc[bb->index], expr->bitmap_index)
&& !TEST_BIT (transp[bb->index], expr->bitmap_index))
abort ();
--- 5274,5280 ----
/* It should always be the case that we can put these instructions
anywhere in the basic block with performing PRE optimizations.
Check this. */
! if (NONJUMP_INSN_P (insn) && pre
&& !TEST_BIT (antloc[bb->index], expr->bitmap_index)
&& !TEST_BIT (transp[bb->index], expr->bitmap_index))
abort ();
*************** insert_insn_end_bb (struct expr *expr, b
*** 5289,5296 ****
/* If this is a jump table, then we can't insert stuff here. Since
we know the previous real insn must be the tablejump, we insert
the new instruction just before the tablejump. */
! if (GET_CODE (PATTERN (insn)) == ADDR_VEC
! || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC)
insn = prev_real_insn (insn);
#ifdef HAVE_cc0
--- 5282,5288 ----
/* If this is a jump table, then we can't insert stuff here. Since
we know the previous real insn must be the tablejump, we insert
the new instruction just before the tablejump. */
! if (JUMP_TABLE_DATA_P (insn))
insn = prev_real_insn (insn);
#ifdef HAVE_cc0
*************** insert_insn_end_bb (struct expr *expr, b
*** 5314,5320 ****
/* Likewise if the last insn is a call, as will happen in the presence
of exception handling. */
! else if (GET_CODE (insn) == CALL_INSN
&& (bb->succ->succ_next || (bb->succ->flags & EDGE_ABNORMAL)))
{
/* Keeping in mind SMALL_REGISTER_CLASSES and parameters in registers,
--- 5306,5312 ----
/* Likewise if the last insn is a call, as will happen in the presence
of exception handling. */
! else if (CALL_P (insn)
&& (bb->succ->succ_next || (bb->succ->flags & EDGE_ABNORMAL)))
{
/* Keeping in mind SMALL_REGISTER_CLASSES and parameters in registers,
*************** insert_insn_end_bb (struct expr *expr, b
*** 5344,5351 ****
If we inserted before the CODE_LABEL, then we would be putting
the insn in the wrong basic block. In that case, put the insn
after the CODE_LABEL. Also, respect NOTE_INSN_BASIC_BLOCK. */
! while (GET_CODE (insn) == CODE_LABEL
! || NOTE_INSN_BASIC_BLOCK_P (insn))
insn = NEXT_INSN (insn);
new_insn = emit_insn_before (pat, insn);
--- 5336,5342 ----
If we inserted before the CODE_LABEL, then we would be putting
the insn in the wrong basic block. In that case, put the insn
after the CODE_LABEL. Also, respect NOTE_INSN_BASIC_BLOCK. */
! while (LABEL_P (insn) || NOTE_INSN_BASIC_BLOCK_P (insn))
insn = NEXT_INSN (insn);
new_insn = emit_insn_before (pat, insn);
*************** pre_insert_copy_insn (struct expr *expr,
*** 5507,5513 ****
else
abort ();
! if (GET_CODE (SET_DEST (set)) == REG)
{
old_reg = SET_DEST (set);
/* Check if we can modify the set destination in the original insn. */
--- 5498,5504 ----
else
abort ();
! if (REG_P (SET_DEST (set)))
{
old_reg = SET_DEST (set);
/* Check if we can modify the set destination in the original insn. */
*************** compute_transpout (void)
*** 5894,5905 ****
/* Note that flow inserted a nop a the end of basic blocks that
end in call instructions for reasons other than abnormal
control flow. */
! if (GET_CODE (BB_END (bb)) != CALL_INSN)
continue;
for (i = 0; i < expr_hash_table.size; i++)
for (expr = expr_hash_table.table[i]; expr ; expr = expr->next_same_hash)
! if (GET_CODE (expr->expr) == MEM)
{
if (GET_CODE (XEXP (expr->expr, 0)) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (XEXP (expr->expr, 0)))
--- 5885,5896 ----
/* Note that flow inserted a nop a the end of basic blocks that
end in call instructions for reasons other than abnormal
control flow. */
! if (! CALL_P (BB_END (bb)))
continue;
for (i = 0; i < expr_hash_table.size; i++)
for (expr = expr_hash_table.table[i]; expr ; expr = expr->next_same_hash)
! if (MEM_P (expr->expr))
{
if (GET_CODE (XEXP (expr->expr, 0)) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (XEXP (expr->expr, 0)))
*************** invalidate_nonnull_info (rtx x, rtx sett
*** 5931,5937 ****
x = SUBREG_REG (x);
/* Ignore anything that is not a register or is a hard register. */
! if (GET_CODE (x) != REG
|| REGNO (x) < npi->min_reg
|| REGNO (x) >= npi->max_reg)
return;
--- 5922,5928 ----
x = SUBREG_REG (x);
/* Ignore anything that is not a register or is a hard register. */
! if (! REG_P (x)
|| REGNO (x) < npi->min_reg
|| REGNO (x) >= npi->max_reg)
return;
*************** delete_null_pointer_checks_1 (unsigned i
*** 6001,6008 ****
/* See if we've got a usable memory load. We handle it first
in case it uses its address register as a dest (which kills
the nonnull property). */
! if (GET_CODE (SET_SRC (set)) == MEM
! && GET_CODE ((reg = XEXP (SET_SRC (set), 0))) == REG
&& REGNO (reg) >= npi->min_reg
&& REGNO (reg) < npi->max_reg)
SET_BIT (nonnull_local[current_block->index],
--- 5992,5999 ----
/* See if we've got a usable memory load. We handle it first
in case it uses its address register as a dest (which kills
the nonnull property). */
! if (MEM_P (SET_SRC (set))
! && REG_P ((reg = XEXP (SET_SRC (set), 0)))
&& REGNO (reg) >= npi->min_reg
&& REGNO (reg) < npi->max_reg)
SET_BIT (nonnull_local[current_block->index],
*************** delete_null_pointer_checks_1 (unsigned i
*** 6014,6021 ****
/* And handle stores, we do these last since any sets in INSN can
not kill the nonnull property if it is derived from a MEM
appearing in a SET_DEST. */
! if (GET_CODE (SET_DEST (set)) == MEM
! && GET_CODE ((reg = XEXP (SET_DEST (set), 0))) == REG
&& REGNO (reg) >= npi->min_reg
&& REGNO (reg) < npi->max_reg)
SET_BIT (nonnull_local[current_block->index],
--- 6005,6012 ----
/* And handle stores, we do these last since any sets in INSN can
not kill the nonnull property if it is derived from a MEM
appearing in a SET_DEST. */
! if (MEM_P (SET_DEST (set))
! && REG_P ((reg = XEXP (SET_DEST (set), 0)))
&& REGNO (reg) >= npi->min_reg
&& REGNO (reg) < npi->max_reg)
SET_BIT (nonnull_local[current_block->index],
*************** delete_null_pointer_checks (rtx f ATTRIB
*** 6154,6160 ****
rtx condition, earliest, reg;
/* We only want conditional branches. */
! if (GET_CODE (last_insn) != JUMP_INSN
|| !any_condjump_p (last_insn)
|| !onlyjump_p (last_insn))
continue;
--- 6145,6151 ----
rtx condition, earliest, reg;
/* We only want conditional branches. */
! if (! JUMP_P (last_insn)
|| !any_condjump_p (last_insn)
|| !onlyjump_p (last_insn))
continue;
*************** delete_null_pointer_checks (rtx f ATTRIB
*** 6173,6179 ****
/* We must be checking a register against zero. */
reg = XEXP (condition, 0);
! if (GET_CODE (reg) != REG)
continue;
block_reg[bb->index] = REGNO (reg);
--- 6164,6170 ----
/* We must be checking a register against zero. */
reg = XEXP (condition, 0);
! if (! REG_P (reg))
continue;
block_reg[bb->index] = REGNO (reg);
*************** next_ls_expr (struct ls_expr * ptr)
*** 6724,6730 ****
static int
simple_mem (rtx x)
{
! if (GET_CODE (x) != MEM)
return 0;
if (MEM_VOLATILE_P (x))
--- 6715,6721 ----
static int
simple_mem (rtx x)
{
! if (! MEM_P (x))
return 0;
if (MEM_VOLATILE_P (x))
*************** invalidate_any_buried_refs (rtx x)
*** 6768,6774 ****
struct ls_expr * ptr;
/* Invalidate it in the list. */
! if (GET_CODE (x) == MEM && simple_mem (x))
{
ptr = ldst_entry (x);
ptr->invalid = 1;
--- 6759,6765 ----
struct ls_expr * ptr;
/* Invalidate it in the list. */
! if (MEM_P (x) && simple_mem (x))
{
ptr = ldst_entry (x);
ptr->invalid = 1;
*************** compute_ld_motion_mems (void)
*** 6818,6827 ****
rtx dest = SET_DEST (PATTERN (insn));
/* Check for a simple LOAD... */
! if (GET_CODE (src) == MEM && simple_mem (src))
{
ptr = ldst_entry (src);
! if (GET_CODE (dest) == REG)
ptr->loads = alloc_INSN_LIST (insn, ptr->loads);
else
ptr->invalid = 1;
--- 6809,6818 ----
rtx dest = SET_DEST (PATTERN (insn));
/* Check for a simple LOAD... */
! if (MEM_P (src) && simple_mem (src))
{
ptr = ldst_entry (src);
! if (REG_P (dest))
ptr->loads = alloc_INSN_LIST (insn, ptr->loads);
else
ptr->invalid = 1;
*************** compute_ld_motion_mems (void)
*** 6836,6846 ****
will block any movement we might do later. We only care
about this exact pattern since those are the only
circumstance that we will ignore the aliasing info. */
! if (GET_CODE (dest) == MEM && simple_mem (dest))
{
ptr = ldst_entry (dest);
! if (GET_CODE (src) != MEM
&& GET_CODE (src) != ASM_OPERANDS
/* Check for REG manually since want_to_gcse_p
returns 0 for all REGs. */
--- 6827,6837 ----
will block any movement we might do later. We only care
about this exact pattern since those are the only
circumstance that we will ignore the aliasing info. */
! if (MEM_P (dest) && simple_mem (dest))
{
ptr = ldst_entry (dest);
! if (! MEM_P (src)
&& GET_CODE (src) != ASM_OPERANDS
/* Check for REG manually since want_to_gcse_p
returns 0 for all REGs. */
*************** reg_set_info (rtx dest, rtx setter ATTRI
*** 6993,6999 ****
if (GET_CODE (dest) == SUBREG)
dest = SUBREG_REG (dest);
! if (GET_CODE (dest) == REG)
{
regvec[REGNO (dest)] = INSN_UID (compute_store_table_current_insn);
if (bb_reg)
--- 6984,6990 ----
if (GET_CODE (dest) == SUBREG)
dest = SUBREG_REG (dest);
! if (REG_P (dest))
{
regvec[REGNO (dest)] = INSN_UID (compute_store_table_current_insn);
if (bb_reg)
*************** reg_clear_last_set (rtx dest, rtx setter
*** 7013,7020 ****
if (GET_CODE (dest) == SUBREG)
dest = SUBREG_REG (dest);
! if (GET_CODE (dest) == REG &&
! dead_vec[REGNO (dest)] == INSN_UID (compute_store_table_current_insn))
dead_vec[REGNO (dest)] = 0;
}
--- 7004,7011 ----
if (GET_CODE (dest) == SUBREG)
dest = SUBREG_REG (dest);
! if (REG_P (dest)
! && dead_vec[REGNO (dest)] == INSN_UID (compute_store_table_current_insn))
dead_vec[REGNO (dest)] = 0;
}
*************** find_moveable_store (rtx insn, int *regs
*** 7158,7164 ****
dest = SET_DEST (set);
! if (GET_CODE (dest) != MEM || MEM_VOLATILE_P (dest)
|| GET_MODE (dest) == BLKmode)
return;
--- 7149,7155 ----
dest = SET_DEST (set);
! if (! MEM_P (dest) || MEM_VOLATILE_P (dest)
|| GET_MODE (dest) == BLKmode)
return;
*************** compute_store_table (void)
*** 7270,7276 ****
if (! INSN_P (insn))
continue;
! if (GET_CODE (insn) == CALL_INSN)
{
bool clobbers_all = false;
#ifdef NON_SAVING_SETJMP
--- 7261,7267 ----
if (! INSN_P (insn))
continue;
! if (CALL_P (insn))
{
bool clobbers_all = false;
#ifdef NON_SAVING_SETJMP
*************** compute_store_table (void)
*** 7303,7309 ****
if (! INSN_P (insn))
continue;
! if (GET_CODE (insn) == CALL_INSN)
{
bool clobbers_all = false;
#ifdef NON_SAVING_SETJMP
--- 7294,7300 ----
if (! INSN_P (insn))
continue;
! if (CALL_P (insn))
{
bool clobbers_all = false;
#ifdef NON_SAVING_SETJMP
*************** compute_store_table (void)
*** 7327,7333 ****
/* Unmark regs that are no longer set. */
compute_store_table_current_insn = insn;
note_stores (pat, reg_clear_last_set, last_set_in);
! if (GET_CODE (insn) == CALL_INSN)
{
bool clobbers_all = false;
#ifdef NON_SAVING_SETJMP
--- 7318,7324 ----
/* Unmark regs that are no longer set. */
compute_store_table_current_insn = insn;
note_stores (pat, reg_clear_last_set, last_set_in);
! if (CALL_P (insn))
{
bool clobbers_all = false;
#ifdef NON_SAVING_SETJMP
*************** find_loads (rtx x, rtx store_pattern, in
*** 7421,7427 ****
if (GET_CODE (x) == SET)
x = SET_SRC (x);
! if (GET_CODE (x) == MEM)
{
if (load_kills_store (x, store_pattern, after))
return true;
--- 7412,7418 ----
if (GET_CODE (x) == SET)
x = SET_SRC (x);
! if (MEM_P (x))
{
if (load_kills_store (x, store_pattern, after))
return true;
*************** store_killed_in_insn (rtx x, rtx x_regs,
*** 7453,7459 ****
if (!INSN_P (insn))
return false;
! if (GET_CODE (insn) == CALL_INSN)
{
/* A normal or pure call might read from pattern,
but a const call will not. */
--- 7444,7450 ----
if (!INSN_P (insn))
return false;
! if (CALL_P (insn))
{
/* A normal or pure call might read from pattern,
but a const call will not. */
*************** store_killed_in_insn (rtx x, rtx x_regs,
*** 7485,7491 ****
dest = XEXP (dest, 0);
/* Check for memory stores to aliased objects. */
! if (GET_CODE (dest) == MEM
&& !expr_equiv_p (dest, x))
{
if (after)
--- 7476,7482 ----
dest = XEXP (dest, 0);
/* Check for memory stores to aliased objects. */
! if (MEM_P (dest)
&& !expr_equiv_p (dest, x))
{
if (after)
*************** insert_insn_start_bb (rtx insn, basic_bl
*** 7670,7677 ****
rtx before = BB_HEAD (bb);
while (before != 0)
{
! if (GET_CODE (before) != CODE_LABEL
! && (GET_CODE (before) != NOTE
|| NOTE_LINE_NUMBER (before) != NOTE_INSN_BASIC_BLOCK))
break;
prev = before;
--- 7661,7668 ----
rtx before = BB_HEAD (bb);
while (before != 0)
{
! if (! LABEL_P (before)
! && (! NOTE_P (before)
|| NOTE_LINE_NUMBER (before) != NOTE_INSN_BASIC_BLOCK))
break;
prev = before;
*************** reg_set_between_after_reload_p (rtx reg,
*** 8164,8171 ****
rtx insn;
int regno;
! if (GET_CODE (reg) != REG)
abort ();
regno = REGNO (reg);
/* We are called after register allocation. */
--- 8155,8165 ----
rtx insn;
int regno;
! #ifdef ENABLE_CHECKING
! if (! REG_P (reg))
abort ();
+ #endif
+
regno = REGNO (reg);
/* We are called after register allocation. */
*************** reg_set_between_after_reload_p (rtx reg,
*** 8182,8189 ****
if (INSN_P (insn))
{
if (FIND_REG_INC_NOTE (insn, reg)
! || (GET_CODE (insn) == CALL_INSN
! && call_used_regs[regno])
|| find_reg_fusage (insn, CLOBBER, reg))
return insn;
}
--- 8176,8182 ----
if (INSN_P (insn))
{
if (FIND_REG_INC_NOTE (insn, reg)
! || (CALL_P (insn) && call_used_regs[regno])
|| find_reg_fusage (insn, CLOBBER, reg))
return insn;
}
*************** reg_used_between_after_reload_p (rtx reg
*** 8203,8209 ****
rtx insn;
int regno;
! if (GET_CODE (reg) != REG)
return to_insn;
regno = REGNO (reg);
--- 8196,8202 ----
rtx insn;
int regno;
! if (! REG_P (reg))
return to_insn;
regno = REGNO (reg);
*************** reg_used_between_after_reload_p (rtx reg
*** 8218,8225 ****
insn = NEXT_INSN (insn))
if (INSN_P (insn)
&& (reg_overlap_mentioned_p (reg, PATTERN (insn))
! || (GET_CODE (insn) == CALL_INSN
! && call_used_regs[regno])
|| find_reg_fusage (insn, USE, reg)
|| find_reg_fusage (insn, CLOBBER, reg)))
return insn;
--- 8211,8217 ----
insn = NEXT_INSN (insn))
if (INSN_P (insn)
&& (reg_overlap_mentioned_p (reg, PATTERN (insn))
! || (CALL_P (insn) && call_used_regs[regno])
|| find_reg_fusage (insn, USE, reg)
|| find_reg_fusage (insn, CLOBBER, reg)))
return insn;
*************** reg_used_between_after_reload_p (rtx reg
*** 8231,8239 ****
static rtx
get_avail_load_store_reg (rtx insn)
{
! if (GET_CODE (SET_DEST (PATTERN (insn))) == REG) /* A load. */
return SET_DEST(PATTERN(insn));
! if (GET_CODE (SET_SRC (PATTERN (insn))) == REG) /* A store. */
return SET_SRC (PATTERN (insn));
abort ();
}
--- 8223,8231 ----
static rtx
get_avail_load_store_reg (rtx insn)
{
! if (REG_P (SET_DEST (PATTERN (insn)))) /* A load. */
return SET_DEST(PATTERN(insn));
! if (REG_P (SET_SRC (PATTERN (insn)))) /* A store. */
return SET_SRC (PATTERN (insn));
abort ();
}
*************** static bool
*** 8244,8255 ****
is_jump_table_basic_block (basic_block bb)
{
rtx insn = BB_END (bb);
!
! if (GET_CODE (insn) == JUMP_INSN &&
! (GET_CODE (PATTERN (insn)) == ADDR_VEC
! || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC))
! return true;
! return false;
}
/* Return nonzero if the predecessors of BB are "well behaved". */
--- 8236,8242 ----
is_jump_table_basic_block (basic_block bb)
{
rtx insn = BB_END (bb);
! return (JUMP_TABLE_DATA_P (insn));
}
/* Return nonzero if the predecessors of BB are "well behaved". */
*************** gcse_after_reload (void)
*** 8496,8505 ****
insn = NEXT_INSN (insn))
{
/* Is it a load - of the form (set (reg) (mem))? */
! if (GET_CODE (insn) == INSN
&& GET_CODE (PATTERN (insn)) == SET
! && GET_CODE (SET_DEST (PATTERN (insn))) == REG
! && GET_CODE (SET_SRC (PATTERN (insn))) == MEM)
{
rtx pat = PATTERN (insn);
rtx src = SET_SRC (pat);
--- 8483,8492 ----
insn = NEXT_INSN (insn))
{
/* Is it a load - of the form (set (reg) (mem))? */
! if (NONJUMP_INSN_P (insn)
&& GET_CODE (PATTERN (insn)) == SET
! && REG_P (SET_DEST (PATTERN (insn)))
! && MEM_P (SET_SRC (PATTERN (insn))))
{
rtx pat = PATTERN (insn);
rtx src = SET_SRC (pat);
*************** hash_scan_set_after_reload (rtx pat, rtx
*** 8553,8562 ****
rtx src = SET_SRC (pat);
rtx dest = SET_DEST (pat);
! if (GET_CODE (src) != MEM && GET_CODE (dest) != MEM)
return;
! if (GET_CODE (dest) == REG)
{
if (/* Don't GCSE something if we can't do a reg/reg copy. */
can_copy_p (GET_MODE (dest))
--- 8540,8549 ----
rtx src = SET_SRC (pat);
rtx dest = SET_DEST (pat);
! if (! MEM_P (src) && ! MEM_P (dest))
return;
! if (REG_P (dest))
{
if (/* Don't GCSE something if we can't do a reg/reg copy. */
can_copy_p (GET_MODE (dest))
*************** hash_scan_set_after_reload (rtx pat, rtx
*** 8576,8582 ****
insert_expr_in_table (src, GET_MODE (dest), insn, 0, 1, table);
}
}
! else if ((GET_CODE (src) == REG))
{
/* Only record sets of pseudo-regs in the hash table. */
if (/* Don't GCSE something if we can't do a reg/reg copy. */
--- 8563,8569 ----
insert_expr_in_table (src, GET_MODE (dest), insn, 0, 1, table);
}
}
! else if (REG_P (src))
{
/* Only record sets of pseudo-regs in the hash table. */
if (/* Don't GCSE something if we can't do a reg/reg copy. */
*************** compute_hash_table_after_reload (struct
*** 8646,8652 ****
if (! INSN_P (insn))
continue;
! if (GET_CODE (insn) == CALL_INSN)
{
bool clobbers_all = false;
--- 8633,8639 ----
if (! INSN_P (insn))
continue;
! if (CALL_P (insn))
{
bool clobbers_all = false;
*************** compute_hash_table_after_reload (struct
*** 8673,8684 ****
src = SET_SRC (PATTERN (insn));
dest = SET_DEST (PATTERN (insn));
! if (GET_CODE (src) == MEM && auto_inc_p (XEXP (src, 0)))
{
regno = REGNO (XEXP (XEXP (src, 0), 0));
record_last_reg_set_info (insn, regno);
}
! if (GET_CODE (dest) == MEM && auto_inc_p (XEXP (dest, 0)))
{
regno = REGNO (XEXP (XEXP (dest, 0), 0));
record_last_reg_set_info (insn, regno);
--- 8660,8671 ----
src = SET_SRC (PATTERN (insn));
dest = SET_DEST (PATTERN (insn));
! if (MEM_P (src) && auto_inc_p (XEXP (src, 0)))
{
regno = REGNO (XEXP (XEXP (src, 0), 0));
record_last_reg_set_info (insn, regno);
}
! if (MEM_P (dest) && auto_inc_p (XEXP (dest, 0)))
{
regno = REGNO (XEXP (XEXP (dest, 0), 0));
record_last_reg_set_info (insn, regno);
Index: rtl.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.def,v
retrieving revision 1.57.2.18
diff -c -3 -p -r1.57.2.18 rtl.def
*** rtl.def 17 Mar 2004 07:58:06 -0000 1.57.2.18
--- rtl.def 9 May 2004 21:21:47 -0000
*************** DEF_RTL_EXPR(SS_TRUNCATE, "ss_truncate",
*** 1216,1223 ****
/* Unsigned saturating truncate. */
DEF_RTL_EXPR(US_TRUNCATE, "us_truncate", "e", RTX_UNARY)
! /* Information about the variable and its location. */
! DEF_RTL_EXPR(VAR_LOCATION, "var_location", "te", 'x')
/*
Local variables:
--- 1216,1231 ----
/* Unsigned saturating truncate. */
DEF_RTL_EXPR(US_TRUNCATE, "us_truncate", "e", RTX_UNARY)
!
! /* ----------------------------------------------------------------------
! Miscellaneous objects.
! ---------------------------------------------------------------------- */
!
! /* Information about a variable and its location in the insn stream.
! The first operand points to the tree with the declaration of the variable.
! The second operand is the RTX object that represents the variable at the
! point where this VAR_LOCATION RTX appears. */
! DEF_RTL_EXPR(VAR_LOCATION, "var_location", "te", RTX_EXTRA)
/*
Local variables:
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.h,v
retrieving revision 1.362.2.46
diff -c -3 -p -r1.362.2.46 rtl.h
*** rtl.h 29 Apr 2004 19:44:31 -0000 1.362.2.46
--- rtl.h 9 May 2004 21:21:47 -0000
*************** struct rtvec_def GTY(()) {
*** 311,325 ****
#define GET_NUM_ELEM(RTVEC) ((RTVEC)->num_elem)
#define PUT_NUM_ELEM(RTVEC, NUM) ((RTVEC)->num_elem = (NUM))
! /* Predicate yielding nonzero iff X is an rtl for a register. */
#define REG_P(X) (GET_CODE (X) == REG)
/* Predicate yielding nonzero iff X is a label insn. */
#define LABEL_P(X) (GET_CODE (X) == CODE_LABEL)
/* Predicate yielding nonzero iff X is a jump insn. */
#define JUMP_P(X) (GET_CODE (X) == JUMP_INSN)
/* Predicate yielding nonzero iff X is a note insn. */
#define NOTE_P(X) (GET_CODE (X) == NOTE)
--- 305,332 ----
#define GET_NUM_ELEM(RTVEC) ((RTVEC)->num_elem)
#define PUT_NUM_ELEM(RTVEC, NUM) ((RTVEC)->num_elem = (NUM))
! /* Predicate yielding nonzero iff X is an rtx for a register. */
#define REG_P(X) (GET_CODE (X) == REG)
+ /* Predicate yielding nonzero iff X is an rtx for a memory location. */
+ #define MEM_P(X) (GET_CODE (X) == MEM)
+
/* Predicate yielding nonzero iff X is a label insn. */
#define LABEL_P(X) (GET_CODE (X) == CODE_LABEL)
/* Predicate yielding nonzero iff X is a jump insn. */
#define JUMP_P(X) (GET_CODE (X) == JUMP_INSN)
+ /* Predicate yielding nonzero iff X is a call insn. */
+ #define CALL_P(X) (GET_CODE (X) == CALL_INSN)
+
+ /* Predicate yielding nonzero iff X is an insn that cannot jump. */
+ #define NONJUMP_INSN_P(X) (GET_CODE (X) == INSN)
+
+ /* Predicate yielding nonzero iff X is a real insn. */
+ #define INSN_P(X) \
+ (NONJUMP_INSN_P (X) || JUMP_P (X) || CALL_P (X))
+
/* Predicate yielding nonzero iff X is a note insn. */
#define NOTE_P(X) (GET_CODE (X) == NOTE)
*************** struct rtvec_def GTY(()) {
*** 330,340 ****
#define JUMP_TABLE_DATA_P(INSN) \
(JUMP_P (INSN) && (GET_CODE (PATTERN (INSN)) == ADDR_VEC || \
GET_CODE (PATTERN (INSN)) == ADDR_DIFF_VEC))
-
-
- /* 1 if X is an insn. */
- #define INSN_P(X) \
- (GET_RTX_CLASS (GET_CODE(X)) == RTX_INSN)
/* 1 if X is a unary operator. */
--- 337,342 ----