/* Register Transfer Language (RTL) definitions for GCC
Copyright (C) 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GCC.
#ifndef GCC_RTL_H
#define GCC_RTL_H
+#include "statistics.h"
struct function;
#define NUM_RTX_CODE ((int) LAST_AND_UNUSED_RTX_CODE)
/* The cast here, saves many elsewhere. */
+/* Register Transfer Language EXPRESSIONS CODE CLASSES */
+
+enum rtx_class {
+ /* We check bit 0-1 of some rtx class codes in the predicates below. */
+
+ /* Bit 0 = comparison if 0, arithmetic is 1
+ Bit 1 = 1 if commutative. */
+ RTX_COMPARE, /* 0 */
+ RTX_COMM_COMPARE,
+ RTX_BIN_ARITH,
+ RTX_COMM_ARITH,
+
+ /* Must follow the four preceding values. */
+ RTX_UNARY, /* 4 */
+
+ RTX_EXTRA,
+ RTX_MATCH,
+ RTX_INSN,
+
+ /* Bit 0 = 1 if constant. */
+ RTX_OBJ, /* 8 */
+ RTX_CONST_OBJ,
+
+ RTX_TERNARY,
+ RTX_BITFIELD_OPS,
+ RTX_AUTOINC
+};
+
+#define RTX_OBJ_MASK (~1)
+#define RTX_OBJ_RESULT (RTX_OBJ & RTX_OBJ_MASK)
+#define RTX_COMPARE_MASK (~1)
+#define RTX_COMPARE_RESULT (RTX_COMPARE & RTX_COMPARE_MASK)
+#define RTX_ARITHMETIC_MASK (~1)
+#define RTX_ARITHMETIC_RESULT (RTX_COMM_ARITH & RTX_ARITHMETIC_MASK)
+#define RTX_BINARY_MASK (~3)
+#define RTX_BINARY_RESULT (RTX_COMPARE & RTX_BINARY_MASK)
+#define RTX_COMMUTATIVE_MASK (~2)
+#define RTX_COMMUTATIVE_RESULT (RTX_COMM_COMPARE & RTX_COMMUTATIVE_MASK)
+#define RTX_NON_COMMUTATIVE_RESULT (RTX_COMPARE & RTX_COMMUTATIVE_MASK)
+#define RTX_EXPR_FIRST (RTX_COMPARE)
+#define RTX_EXPR_LAST (RTX_UNARY)
+
extern const unsigned char rtx_length[NUM_RTX_CODE];
#define GET_RTX_LENGTH(CODE) (rtx_length[(int) (CODE)])
extern const char * const rtx_format[NUM_RTX_CODE];
#define GET_RTX_FORMAT(CODE) (rtx_format[(int) (CODE)])
-extern const char rtx_class[NUM_RTX_CODE];
+extern const enum rtx_class rtx_class[NUM_RTX_CODE];
#define GET_RTX_CLASS(CODE) (rtx_class[(int) (CODE)])
+extern const unsigned char rtx_size[NUM_RTX_CODE];
extern const unsigned char rtx_next[NUM_RTX_CODE];
\f
/* The flags and bitfields of an ADDR_DIFF_VEC. BASE is the base label
union rtunion_def
{
- HOST_WIDE_INT rtwint;
int rtint;
unsigned int rtuint;
const char *rtstr;
/* Nonzero if this rtx came from procedure integration.
1 in a REG or PARALLEL means this rtx refers to the return value
of the current function.
- 1 in a SYMBOL_REF if the symbol is weak. */
+ 1 in a SYMBOL_REF if the symbol is weak.
+ 1 in a MEM if the MEM refers to a scalar, rather than a member of
+ an aggregate. */
unsigned integrated : 1;
/* 1 in an INSN or a SET if this rtx is related to the call frame,
either changing how we compute the frame address or saving and
restoring registers in the prologue and epilogue.
- 1 in a MEM if the MEM refers to a scalar, rather than a member of
- an aggregate.
- 1 in a REG if the register is a pointer.
+ 1 in a REG or MEM if it is a pointer.
1 in a SYMBOL_REF if it addresses something in the per-function
constant string pool. */
unsigned frame_related : 1;
/* The first element of the operands of this rtx.
The number of operands and their types are controlled
by the `code' field, according to rtl.def. */
- rtunion GTY ((special ("rtx_def"),
- desc ("GET_CODE (&%0)"))) fld[1];
+ union u {
+ rtunion fld[1];
+ HOST_WIDE_INT hwint[1];
+ } GTY ((special ("rtx_def"), desc ("GET_CODE (&%0)"))) u;
};
+/* The size in bytes of an rtx header (code, mode and flags). */
+#define RTX_HDR_SIZE offsetof (struct rtx_def, u)
+
+/* The size in bytes of an rtx with code CODE. */
+#define RTX_SIZE(CODE) rtx_size[CODE]
+
#define NULL_RTX (rtx) 0
/* The "next" and "previous" RTX, relative to this one. */
/* Define macros to access the `code' field of the rtx. */
#define GET_CODE(RTX) ((enum rtx_code) (RTX)->code)
-#define PUT_CODE(RTX, CODE) ((RTX)->code = (ENUM_BITFIELD(rtx_code)) (CODE))
+#define PUT_CODE(RTX, CODE) ((RTX)->code = (CODE))
#define GET_MODE(RTX) ((enum machine_mode) (RTX)->mode)
-#define PUT_MODE(RTX, MODE) ((RTX)->mode = (ENUM_BITFIELD(machine_mode)) (MODE))
+#define PUT_MODE(RTX, MODE) ((RTX)->mode = (MODE))
/* RTL vector. These appear inside RTX's when there is a need
for a variable number of things. The principle use is inside
(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. */
+
+#define UNARY_P(X) \
+ (GET_RTX_CLASS (GET_CODE (X)) == RTX_UNARY)
+
+/* 1 if X is a binary operator. */
+
+#define BINARY_P(X) \
+ ((GET_RTX_CLASS (GET_CODE (X)) & RTX_BINARY_MASK) == RTX_BINARY_RESULT)
+
+/* 1 if X is an arithmetic operator. */
+
+#define ARITHMETIC_P(X) \
+ ((GET_RTX_CLASS (GET_CODE (X)) & RTX_ARITHMETIC_MASK) \
+ == RTX_ARITHMETIC_RESULT)
+
+/* 1 if X is an arithmetic operator. */
+
+#define COMMUTATIVE_ARITH_P(X) \
+ (GET_RTX_CLASS (GET_CODE (X)) == RTX_COMM_ARITH)
+
+/* 1 if X is a commutative arithmetic operator or a comparison operator.
+ These two are sometimes selected together because it is possible to
+ swap the two operands. */
+
+#define SWAPPABLE_OPERANDS_P(X) \
+ ((1 << GET_RTX_CLASS (GET_CODE (X))) \
+ & ((1 << RTX_COMM_ARITH) | (1 << RTX_COMM_COMPARE) \
+ | (1 << RTX_COMPARE)))
+
+/* 1 if X is a non-commutative operator. */
+
+#define NON_COMMUTATIVE_P(X) \
+ ((GET_RTX_CLASS (GET_CODE (X)) & RTX_COMMUTATIVE_MASK) \
+ == RTX_NON_COMMUTATIVE_RESULT)
+
+/* 1 if X is a commutative operator on integers. */
+
+#define COMMUTATIVE_P(X) \
+ ((GET_RTX_CLASS (GET_CODE (X)) & RTX_COMMUTATIVE_MASK) \
+ == RTX_COMMUTATIVE_RESULT)
+
+/* 1 if X is a relational operator. */
+
+#define COMPARISON_P(X) \
+ ((GET_RTX_CLASS (GET_CODE (X)) & RTX_COMPARE_MASK) == RTX_COMPARE_RESULT)
+
/* 1 if X is a constant value that is an integer. */
#define CONSTANT_P(X) \
- (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
- || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST_DOUBLE \
- || GET_CODE (X) == CONST || GET_CODE (X) == HIGH \
+ (GET_RTX_CLASS (GET_CODE (X)) == RTX_CONST_OBJ \
|| GET_CODE (X) == CONST_VECTOR \
|| GET_CODE (X) == CONSTANT_P_RTX)
+/* 1 if X can be used to represent an object. */
+#define OBJECT_P(X) \
+ ((GET_RTX_CLASS (GET_CODE (X)) & RTX_OBJ_MASK) == RTX_OBJ_RESULT)
+
/* General accessor macros for accessing the fields of an rtx. */
#if defined ENABLE_RTL_CHECKING && (GCC_VERSION >= 2007)
if (GET_RTX_FORMAT(_code)[_n] != C1) \
rtl_check_failed_type1 (_rtx, _n, C1, __FILE__, __LINE__, \
__FUNCTION__); \
- &_rtx->fld[_n]; }))
+ &_rtx->u.fld[_n]; }))
#define RTL_CHECK2(RTX, N, C1, C2) __extension__ \
(*({ rtx const _rtx = (RTX); const int _n = (N); \
&& GET_RTX_FORMAT(_code)[_n] != C2) \
rtl_check_failed_type2 (_rtx, _n, C1, C2, __FILE__, __LINE__, \
__FUNCTION__); \
- &_rtx->fld[_n]; }))
+ &_rtx->u.fld[_n]; }))
#define RTL_CHECKC1(RTX, N, C) __extension__ \
(*({ rtx const _rtx = (RTX); const int _n = (N); \
if (GET_CODE (_rtx) != (C)) \
rtl_check_failed_code1 (_rtx, (C), __FILE__, __LINE__, \
__FUNCTION__); \
- &_rtx->fld[_n]; }))
+ &_rtx->u.fld[_n]; }))
#define RTL_CHECKC2(RTX, N, C1, C2) __extension__ \
(*({ rtx const _rtx = (RTX); const int _n = (N); \
if (_code != (C1) && _code != (C2)) \
rtl_check_failed_code2 (_rtx, (C1), (C2), __FILE__, __LINE__, \
__FUNCTION__); \
- &_rtx->fld[_n]; }))
+ &_rtx->u.fld[_n]; }))
#define RTVEC_ELT(RTVEC, I) __extension__ \
(*({ rtvec const _rtvec = (RTVEC); const int _i = (I); \
__FUNCTION__); \
&_rtvec->elem[_i]; }))
+#define XWINT(RTX, N) __extension__ \
+(*({ rtx const _rtx = (RTX); const int _n = (N); \
+ const enum rtx_code _code = GET_CODE (_rtx); \
+ if (_n < 0 || _n >= GET_RTX_LENGTH (_code)) \
+ rtl_check_failed_bounds (_rtx, _n, __FILE__, __LINE__, \
+ __FUNCTION__); \
+ if (GET_RTX_FORMAT(_code)[_n] != 'w') \
+ rtl_check_failed_type1 (_rtx, _n, 'w', __FILE__, __LINE__, \
+ __FUNCTION__); \
+ &_rtx->u.hwint[_n]; }))
+
+#define XCWINT(RTX, N, C) __extension__ \
+(*({ rtx const _rtx = (RTX); \
+ if (GET_CODE (_rtx) != (C)) \
+ rtl_check_failed_code1 (_rtx, (C), __FILE__, __LINE__, \
+ __FUNCTION__); \
+ &_rtx->u.hwint[N]; }))
+
extern void rtl_check_failed_bounds (rtx, int, const char *, int,
const char *)
ATTRIBUTE_NORETURN;
#else /* not ENABLE_RTL_CHECKING */
-#define RTL_CHECK1(RTX, N, C1) ((RTX)->fld[N])
-#define RTL_CHECK2(RTX, N, C1, C2) ((RTX)->fld[N])
-#define RTL_CHECKC1(RTX, N, C) ((RTX)->fld[N])
-#define RTL_CHECKC2(RTX, N, C1, C2) ((RTX)->fld[N])
+#define RTL_CHECK1(RTX, N, C1) ((RTX)->u.fld[N])
+#define RTL_CHECK2(RTX, N, C1, C2) ((RTX)->u.fld[N])
+#define RTL_CHECKC1(RTX, N, C) ((RTX)->u.fld[N])
+#define RTL_CHECKC2(RTX, N, C1, C2) ((RTX)->u.fld[N])
#define RTVEC_ELT(RTVEC, I) ((RTVEC)->elem[I])
+#define XWINT(RTX, N) ((RTX)->u.hwint[N])
+#define XCWINT(RTX, N, C) ((RTX)->u.hwint[N])
#endif
_rtx->volatil = 0; \
} while (0)
-#define XWINT(RTX, N) (RTL_CHECK1 (RTX, N, 'w').rtwint)
#define XINT(RTX, N) (RTL_CHECK2 (RTX, N, 'i', 'n').rtint)
#define XSTR(RTX, N) (RTL_CHECK2 (RTX, N, 's', 'S').rtstr)
#define XEXP(RTX, N) (RTL_CHECK2 (RTX, N, 'e', 'u').rtx)
#define XVECEXP(RTX, N, M) RTVEC_ELT (XVEC (RTX, N), M)
#define XVECLEN(RTX, N) GET_NUM_ELEM (XVEC (RTX, N))
-/* These are like XWINT, etc. except that they expect a '0' field instead
+/* These are like XINT, etc. except that they expect a '0' field instead
of the normal type code. */
-#define X0WINT(RTX, N) (RTL_CHECK1 (RTX, N, '0').rtwint)
#define X0INT(RTX, N) (RTL_CHECK1 (RTX, N, '0').rtint)
#define X0UINT(RTX, N) (RTL_CHECK1 (RTX, N, '0').rtuint)
#define X0STR(RTX, N) (RTL_CHECK1 (RTX, N, '0').rtstr)
#define X0MEMATTR(RTX, N) (RTL_CHECKC1 (RTX, N, MEM).rtmem)
#define X0REGATTR(RTX, N) (RTL_CHECKC1 (RTX, N, REG).rtreg)
-#define XCWINT(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rtwint)
+/* Access a '0' field with any type. */
+#define X0ANY(RTX, N) RTL_CHECK1 (RTX, N, '0')
+
#define XCINT(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rtint)
#define XCUINT(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rtuint)
#define XCSTR(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rtstr)
\f
/* ACCESS MACROS for particular fields of insns. */
-/* Determines whether X is an insn. */
-#define INSN_P(X) (GET_RTX_CLASS (GET_CODE(X)) == 'i')
-
/* Holds a unique number for each insn.
These are not necessarily sequentially increasing. */
#define INSN_UID(INSN) XINT (INSN, 0)
return. */
REG_BR_PROB,
+ /* REG_VALUE_PROFILE is attached when the profile is read in to an insn
+ before that the code to profile the value is inserted. It contains
+ the results of profiling. */
+ REG_VALUE_PROFILE,
+
/* Attached to a call insn; indicates that the call is malloc-like and
that the pointer returned cannot alias anything else. */
REG_NOALIAS,
#define NOTE_EXPECTED_VALUE(INSN) XCEXP (INSN, 4, NOTE)
#define NOTE_PREDICTION(INSN) XCINT (INSN, 4, NOTE)
#define NOTE_PRECONDITIONED(INSN) XCINT (INSN, 4, NOTE)
+#define NOTE_VAR_LOCATION(INSN) XCEXP (INSN, 4, NOTE)
/* In a NOTE that is a line number, this is the line number.
Other kinds of NOTEs are identified by negative numbers here. */
#define NOTE_PREDICTION_FLAGS(INSN) (XCINT(INSN, 4, NOTE)&0xff)
#define NOTE_PREDICT(ALG,FLAGS) ((ALG<<8)+(FLAGS))
+/* Variable declaration and the location of a variable. */
+#define NOTE_VAR_LOCATION_DECL(INSN) (XCTREE (XCEXP (INSN, 4, NOTE), \
+ 0, VAR_LOCATION))
+#define NOTE_VAR_LOCATION_LOC(INSN) (XCEXP (XCEXP (INSN, 4, NOTE), \
+ 1, VAR_LOCATION))
+
/* Codes that appear in the NOTE_LINE_NUMBER field
for kinds of notes that are not line numbers.
/* Record a prediction. Uses NOTE_PREDICTION. */
NOTE_INSN_PREDICTION,
+ /* The location of a variable. */
+ NOTE_INSN_VAR_LOCATION,
+
NOTE_INSN_MAX
};
#define REG_POINTER(RTX) \
(RTL_FLAG_CHECK1("REG_POINTER", (RTX), REG)->frame_related)
+/* 1 if RTX is a mem that holds a pointer value. */
+#define MEM_POINTER(RTX) \
+ (RTL_FLAG_CHECK1("MEM_POINTER", (RTX), MEM)->frame_related)
+
/* 1 if the given register REG corresponds to a hard register. */
#define HARD_REGISTER_P(REG) (HARD_REGISTER_NUM_P (REGNO (REG)))
#define SUBREG_BYTE(RTX) XCUINT (RTX, 1, SUBREG)
/* in rtlanal.c */
+/* Return the right cost to give to an operation
+ to make the cost of the corresponding register-to-register instruction
+ N times that of a fast register-to-register instruction. */
+#define COSTS_N_INSNS(N) ((N) * 4)
+
+/* Maximum cost of an rtl expression. This value has the special meaning
+ not to use an rtx with this cost under any circumstances. */
+#define MAX_COST INT_MAX
+
+extern int rtx_cost (rtx, enum rtx_code);
+extern int address_cost (rtx, enum machine_mode);
extern unsigned int subreg_lsb (rtx);
+extern unsigned int subreg_lsb_1 (enum machine_mode, enum machine_mode,
+ unsigned int);
extern unsigned int subreg_regno_offset (unsigned int, enum machine_mode,
unsigned int, enum machine_mode);
extern bool subreg_offset_representable_p (unsigned int, enum machine_mode,
/* 1 if RTX is a mem that refers to a scalar. If zero, RTX may or may
not refer to a scalar. */
#define MEM_SCALAR_P(RTX) \
- (RTL_FLAG_CHECK1("MEM_SCALAR_P", (RTX), MEM)->frame_related)
+ (RTL_FLAG_CHECK1("MEM_SCALAR_P", (RTX), MEM)->integrated)
/* 1 if RTX is a mem that cannot trap. */
#define MEM_NOTRAP_P(RTX) \
extern void optimize_save_area_alloca (rtx);
/* In emit-rtl.c */
-extern rtx gen_rtx (enum rtx_code, enum machine_mode, ...);
extern rtvec gen_rtvec (int, ...);
extern rtx copy_insn_1 (rtx);
extern rtx copy_insn (rtx);
extern void set_reg_attrs_from_mem (rtx, rtx);
extern void set_mem_attrs_from_reg (rtx, rtx);
extern void set_reg_attrs_for_parm (rtx, rtx);
+extern void set_reg_pointer_align (rtx, unsigned int);
+extern int mem_expr_equal_p (tree, tree);
/* In rtl.c */
-extern rtx rtx_alloc (RTX_CODE);
+extern rtx rtx_alloc_stat (RTX_CODE MEM_STAT_DECL);
+#define rtx_alloc(c) rtx_alloc_stat (c MEM_STAT_INFO)
+
extern rtvec rtvec_alloc (int);
extern rtx copy_rtx (rtx);
+extern void dump_rtx_statistics (void);
/* In emit-rtl.c */
extern rtx copy_rtx_if_shared (rtx);
/* In rtl.c */
extern rtx copy_most_rtx (rtx, rtx);
-extern rtx shallow_copy_rtx (rtx);
+extern rtx shallow_copy_rtx_stat (rtx MEM_STAT_DECL);
+#define shallow_copy_rtx(a) shallow_copy_rtx_stat (a MEM_STAT_INFO)
extern int rtx_equal_p (rtx, rtx);
/* In emit-rtl.c */
extern rtx gen_label_rtx (void);
extern int subreg_hard_regno (rtx, int);
extern rtx gen_lowpart_common (enum machine_mode, rtx);
-extern rtx gen_lowpart (enum machine_mode, rtx);
+extern rtx gen_lowpart_general (enum machine_mode, rtx);
+extern rtx (*gen_lowpart) (enum machine_mode mode, rtx x);
+
/* In cse.c */
extern rtx gen_lowpart_if_possible (enum machine_mode, rtx);
extern rtx gen_realpart (enum machine_mode, rtx);
extern rtx gen_imagpart (enum machine_mode, rtx);
extern rtx operand_subword (rtx, unsigned int, int, enum machine_mode);
-extern rtx constant_subword (rtx, int, enum machine_mode);
/* In emit-rtl.c */
extern rtx operand_subword_force (rtx, unsigned int, enum machine_mode);
extern void push_to_sequence (rtx);
extern void end_sequence (void);
extern void push_to_full_sequence (rtx, rtx);
-extern void end_full_sequence (rtx*, rtx*);
-
-/* In varasm.c */
extern rtx immed_double_const (HOST_WIDE_INT, HOST_WIDE_INT,
enum machine_mode);
-extern rtx mem_for_const_double (rtx);
+
+/* In varasm.c */
extern rtx force_const_mem (enum machine_mode, rtx);
/* In varasm.c */
extern rtx emit_barrier (void);
extern rtx emit_note (int);
extern rtx emit_note_copy (rtx);
-extern rtx emit_line_note (const char *, int);
-extern rtx emit_line_note_force (const char *, int);
+extern rtx emit_line_note (location_t);
extern rtx make_insn_raw (rtx);
extern void add_function_usage_to (rtx, rtx);
extern rtx last_call_insn (void);
extern rtx next_cc0_user (rtx);
extern rtx prev_cc0_setter (rtx);
+#define emit_insn_before_sameloc(INSN, BEFORE) \
+ emit_insn_before_setloc (INSN, BEFORE, INSN_LOCATOR (BEFORE))
+#define emit_jump_insn_before_sameloc(INSN, BEFORE) \
+ emit_jump_insn_before_setloc (INSN, BEFORE, INSN_LOCATOR (BEFORE))
+#define emit_call_insn_before_sameloc(INSN, BEFORE) \
+ emit_call_insn_before_setloc (INSN, BEFORE, INSN_LOCATOR (BEFORE))
+#define emit_insn_after_sameloc(INSN, AFTER) \
+ emit_insn_after_setloc (INSN, AFTER, INSN_LOCATOR (AFTER))
+#define emit_jump_insn_after_sameloc(INSN, AFTER) \
+ emit_jump_insn_after_setloc (INSN, AFTER, INSN_LOCATOR (AFTER))
+#define emit_call_insn_after_sameloc(INSN, AFTER) \
+ emit_call_insn_after_setloc (INSN, AFTER, INSN_LOCATOR (AFTER))
+
/* In cfglayout.c */
extern tree choose_inner_scope (tree, tree);
extern int insn_line (rtx);
extern const char * insn_file (rtx);
+extern int locator_line (int);
+extern const char * locator_file (int);
extern int prologue_locator, epilogue_locator;
/* In jump.c */
rtx);
extern rtx simplify_ternary_operation (enum rtx_code, enum machine_mode,
enum machine_mode, rtx, rtx, rtx);
+extern rtx simplify_const_relational_operation (enum rtx_code,
+ enum machine_mode, rtx, rtx);
extern rtx simplify_relational_operation (enum rtx_code, enum machine_mode,
- rtx, rtx);
+ enum machine_mode, rtx, rtx);
extern rtx simplify_gen_binary (enum rtx_code, enum machine_mode, rtx, rtx);
extern rtx simplify_gen_unary (enum rtx_code, enum machine_mode, rtx,
enum machine_mode);
extern rtx gen_mem_addressof (rtx, tree, int);
/* In regclass.c */
-extern enum machine_mode choose_hard_reg_mode (unsigned int, unsigned int);
+extern enum machine_mode choose_hard_reg_mode (unsigned int, unsigned int,
+ bool);
/* In emit-rtl.c */
extern rtx set_unique_reg_note (rtx, enum reg_note, rtx);
extern int loc_mentioned_in_p (rtx *, rtx);
extern rtx find_first_parameter_load (rtx, rtx);
extern bool keep_with_call_p (rtx);
+extern bool label_is_jump_target_p (rtx, rtx);
/* flow.c */
/* regclass.c */
/* Maximum number of parallel sets and clobbers in any insn in this fn.
- Always at least 3, since the combiner could put that many togetherm
+ Always at least 3, since the combiner could put that many together
and we want this to remain correct for all the remaining passes. */
extern int max_parallel;
#define arg_pointer_rtx (global_rtl[GR_ARG_POINTER])
extern GTY(()) rtx pic_offset_table_rtx;
-extern GTY(()) rtx struct_value_rtx;
-extern GTY(()) rtx struct_value_incoming_rtx;
extern GTY(()) rtx static_chain_rtx;
extern GTY(()) rtx static_chain_incoming_rtx;
extern GTY(()) rtx return_address_pointer_rtx;
/* There are some RTL codes that require special attention; the
generation functions included above do the raw handling. If you
- add to this list, modify special_rtx in gengenrtl.c as well. You
- should also modify gen_rtx to use the special function. */
+ add to this list, modify special_rtx in gengenrtl.c as well. */
extern rtx gen_rtx_CONST_INT (enum machine_mode, HOST_WIDE_INT);
extern rtx gen_rtx_CONST_VECTOR (enum machine_mode, rtvec);
extern rtx gen_rtx_SUBREG (enum machine_mode, rtx, int);
extern rtx gen_rtx_MEM (enum machine_mode, rtx);
-extern rtx gen_lowpart_SUBREG (enum machine_mode, rtx);
-
/* We need the cast here to ensure that we get the same result both with
and without prototypes. */
#define GEN_INT(N) gen_rtx_CONST_INT (VOIDmode, (HOST_WIDE_INT) (N))
#define INVALID_REGNUM (~(unsigned int) 0)
extern rtx output_constant_def (tree, int);
+extern rtx lookup_constant_def (tree);
/* Called from integrate.c when a deferred constant is inlined. */
extern void notice_rtl_inlining_of_deferred_constant (void);
extern int rtx_to_tree_code (enum rtx_code);
/* In cse.c */
-struct cse_basic_block_data;
-
-/* Return the right cost to give to an operation
- to make the cost of the corresponding register-to-register instruction
- N times that of a fast register-to-register instruction. */
-#define COSTS_N_INSNS(N) ((N) * 4)
-
-/* Maximum cost of a rtl expression. This value has the special meaning
- not to use an rtx with this cost under any circumstances. */
-#define MAX_COST INT_MAX
-
-extern int rtx_cost (rtx, enum rtx_code);
-extern int address_cost (rtx, enum machine_mode);
extern int delete_trivially_dead_insns (rtx, int);
#ifdef BUFSIZ
extern int cse_main (rtx, int, int, FILE *);
#endif
-extern void cse_end_of_basic_block (rtx, struct cse_basic_block_data *,
- int, int, int);
+extern void cse_condition_code_reg (void);
/* In jump.c */
extern int comparison_dominates_p (enum rtx_code, enum rtx_code);
extern void mark_reg_pointer (rtx, int);
extern void mark_user_reg (rtx);
extern void reset_used_flags (rtx);
+extern void set_used_flags (rtx);
extern void reorder_insns (rtx, rtx, rtx);
extern void reorder_insns_nobb (rtx, rtx, rtx);
extern int get_max_uid (void);
extern void init_emit_once (int);
extern void push_topmost_sequence (void);
extern void pop_topmost_sequence (void);
-extern int subreg_realpart_p (rtx);
extern void reverse_comparison (rtx);
extern void set_new_first_and_last_insn (rtx, rtx);
-extern void set_new_first_and_last_label_num (int, int);
extern void set_new_last_label_num (int);
extern void unshare_all_rtl_again (rtx);
+extern void unshare_all_rtl_in_chain (rtx);
+extern void verify_rtl_sharing (void);
extern void set_first_insn (rtx);
extern void set_last_insn (rtx);
extern void link_cc0_insns (rtx);
extern void add_insn_before (rtx, rtx);
extern void add_insn_after (rtx, rtx);
extern void remove_insn (rtx);
-extern void reorder_insns_with_line_notes (rtx, rtx, rtx);
extern void emit_insn_after_with_line_notes (rtx, rtx, rtx);
extern enum rtx_code classify_insn (rtx);
extern rtx emit (rtx);
extern rtx unlink_insn_chain (rtx, rtx);
extern rtx delete_insn_and_edges (rtx);
extern void delete_insn_chain_and_edges (rtx, rtx);
+extern rtx gen_lowpart_SUBREG (enum machine_mode, rtx);
/* In combine.c */
extern int combine_instructions (rtx, unsigned int);
extern void dump_combine_stats (FILE *);
extern void dump_combine_total_stats (FILE *);
#endif
+/* In web.c */
+extern void web_main (void);
-/* In sched.c. */
+/* In sched-rgn.c. */
#ifdef BUFSIZ
extern void schedule_insns (FILE *);
+#endif
+
+/* In sched-ebb.c. */
+#ifdef BUFSIZ
extern void schedule_ebbs (FILE *);
#endif
+
+/* In haifa-sched.c. */
extern void fix_sched_param (const char *, const char *);
/* In print-rtl.c */
/* In loop.c */
extern void init_loop (void);
-extern rtx libcall_other_reg (rtx, rtx);
#ifdef BUFSIZ
extern void loop_optimize (rtx, FILE *, int);
#endif
extern void branch_target_load_optimize (rtx, bool);
-extern void record_excess_regs (rtx, rtx, rtx *);
/* In function.c */
extern void reposition_prologue_and_epilogue_notes (rtx);
extern void purge_hard_subreg_sets (rtx);
/* In stmt.c */
-extern void set_file_and_line_for_stmt (const char *, int);
+extern void set_file_and_line_for_stmt (location_t);
extern void expand_null_return (void);
+extern void expand_naked_return (void);
extern void emit_jump (rtx);
extern int preserve_subexpressions_p (void);
#ifdef BUFSIZ
extern int gcse_main (rtx, FILE *);
extern int bypass_jumps (FILE *);
+extern void gcse_after_reload_main (rtx, FILE *);
#endif
/* In global.c */
extern int reg_classes_intersect_p (enum reg_class, enum reg_class);
extern int reg_class_subset_p (enum reg_class, enum reg_class);
extern void globalize_reg (int);
+extern void init_reg_modes_once (void);
extern void init_regs (void);
extern void init_fake_stack_mems (void);
extern void init_reg_sets (void);
extern void dump_local_alloc (FILE *);
#endif
extern int local_alloc (void);
-extern int function_invariant_p (rtx);
/* In profile.c */
extern void init_branch_prob (void);
extern int read_dependence (rtx, rtx);
extern int anti_dependence (rtx, rtx);
extern int output_dependence (rtx, rtx);
+extern int unchanging_anti_dependence (rtx, rtx);
extern void mark_constant_function (void);
extern void init_alias_once (void);
extern void init_alias_analysis (void);
extern rtx addr_side_effect_eval (rtx, int, int);
extern bool memory_modified_in_insn_p (rtx, rtx);
extern rtx find_base_term (rtx);
+extern rtx gen_hard_reg_clobber (enum machine_mode, unsigned int);
+extern rtx get_reg_known_value (unsigned int);
+extern bool get_reg_known_equiv_p (unsigned int);
/* In sibcall.c */
typedef enum {
/* In tracer.c */
extern void tracer (void);
+/* In var-tracking.c */
+extern void variable_tracking_main (void);
+
+/* In stor-layout.c. */
+extern void get_mode_bounds (enum machine_mode, int, rtx *, rtx *);
+
+/* In loop-unswitch.c */
+extern rtx reversed_condition (rtx);
+extern rtx compare_and_jump_seq (rtx, rtx, enum rtx_code, rtx, int, rtx);
+
+/* In loop-iv.c */
+extern rtx canon_condition (rtx);
+extern void simplify_using_condition (rtx, rtx *, struct bitmap_head_def *);
+
+/* In ra.c. */
+extern void reg_alloc (void);
+
#endif /* ! GCC_RTL_H */