Commit 0d446150 by Jan Hubicka Committed by Jan Hubicka

objc-act.c: Include cgraph.h

	* objc-act.c: Include cgraph.h
	(mark_referenced_methods): New function.
	(objc_init): Call it.
	* objc-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Set.

	* c-decl.c (finish_function): Honor can_defer_p even in unit-at-a-time
	mode.

	* optabs.c (expand_fix): Do not widen the input operand.

	* expr.c (emit_group_store):  Fix crash when converting single
	register into complex register.

	* Makefile.in (jump.o, regclass.o, alias.o): Add dependency on timevar.h
	* alias.c: Include timevar.h
	(init_alias_analysis):  Set timevar
	* jump.c: Include timevar.h
	(rebuild_jump_labels):  Set timevar
	* regcalss.c: Include timevar.h
	(reg_scan):  Set timevar
	* timevar.def (TV_ALIAS_ANALYSIS, TV_REG_SCAN, TV_REBUILD_JUMP): New

From-SVN: r63464
parent 9541e2e3
Tue Feb 25 22:46:27 CET 2003 Jan Hubicka <jh@suse.cz>
* objc-act.c: Include cgraph.h
(mark_referenced_methods): New function.
(objc_init): Call it.
* objc-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Set.
* c-decl.c (finish_function): Honor can_defer_p even in unit-at-a-time
mode.
* optabs.c (expand_fix): Do not widen the input operand.
* expr.c (emit_group_store): Fix crash when converting single
register into complex register.
* Makefile.in (jump.o, regclass.o, alias.o): Add dependency on timevar.h
* alias.c: Include timevar.h
(init_alias_analysis): Set timevar
* jump.c: Include timevar.h
(rebuild_jump_labels): Set timevar
* regcalss.c: Include timevar.h
(reg_scan): Set timevar
* timevar.def (TV_ALIAS_ANALYSIS, TV_REG_SCAN, TV_REBUILD_JUMP): New
2003-02-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> 2003-02-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
* cse.c (count_reg_usage): Fix handling of REG_EQUAL notes. * cse.c (count_reg_usage): Fix handling of REG_EQUAL notes.
......
...@@ -1526,7 +1526,7 @@ integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $ ...@@ -1526,7 +1526,7 @@ integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $
$(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h gt-integrate.h $(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h gt-integrate.h
jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \ jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
hard-reg-set.h $(REGS_H) insn-config.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \ hard-reg-set.h $(REGS_H) insn-config.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \
toplev.h $(INSN_ATTR_H) $(TM_P_H) reload.h $(PREDICT_H) toplev.h $(INSN_ATTR_H) $(TM_P_H) reload.h $(PREDICT_H) $(TIMEVAR_H)
simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(REGS_H) hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \ $(REGS_H) hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
...@@ -1623,7 +1623,7 @@ combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags ...@@ -1623,7 +1623,7 @@ combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags
$(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h $(TM_P_H) $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h $(TM_P_H)
regclass.o : regclass.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ regclass.o : regclass.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
hard-reg-set.h flags.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h \ hard-reg-set.h flags.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h \
real.h toplev.h function.h output.h $(GGC_H) $(TM_P_H) $(EXPR_H) real.h toplev.h function.h output.h $(GGC_H) $(TM_P_H) $(EXPR_H) $(TIMEVAR_H)
local-alloc.o : local-alloc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ local-alloc.o : local-alloc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
flags.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \ flags.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
output.h function.h $(INSN_ATTR_H) toplev.h except.h $(TM_P_H) output.h function.h $(INSN_ATTR_H) toplev.h except.h $(TM_P_H)
...@@ -1664,7 +1664,7 @@ reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) condition ...@@ -1664,7 +1664,7 @@ reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) condition
alias.o : alias.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \ alias.o : alias.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h $(EXPR_H) \ hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h $(EXPR_H) \
$(GGC_H) function.h cselib.h $(TREE_H) $(TM_P_H) langhooks.h $(TARGET_H) \ $(GGC_H) function.h cselib.h $(TREE_H) $(TM_P_H) langhooks.h $(TARGET_H) \
gt-alias.h gt-alias.h $(TIMEVAR_H)
regmove.o : regmove.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) insn-config.h \ regmove.o : regmove.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) insn-config.h \
$(RECOG_H) output.h $(REGS_H) hard-reg-set.h flags.h function.h \ $(RECOG_H) output.h $(REGS_H) hard-reg-set.h flags.h function.h \
$(EXPR_H) $(BASIC_BLOCK_H) toplev.h $(TM_P_H) except.h reload.h $(EXPR_H) $(BASIC_BLOCK_H) toplev.h $(TM_P_H) except.h reload.h
......
...@@ -39,6 +39,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -39,6 +39,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "splay-tree.h" #include "splay-tree.h"
#include "ggc.h" #include "ggc.h"
#include "langhooks.h" #include "langhooks.h"
#include "timevar.h"
#include "target.h" #include "target.h"
/* The alias sets assigned to MEMs assist the back-end in determining /* The alias sets assigned to MEMs assist the back-end in determining
...@@ -2745,6 +2746,8 @@ init_alias_analysis () ...@@ -2745,6 +2746,8 @@ init_alias_analysis ()
unsigned int ui; unsigned int ui;
rtx insn; rtx insn;
timevar_push (TV_ALIAS_ANALYSIS);
reg_known_value_size = maxreg; reg_known_value_size = maxreg;
reg_known_value reg_known_value
...@@ -2950,6 +2953,7 @@ init_alias_analysis () ...@@ -2950,6 +2953,7 @@ init_alias_analysis ()
new_reg_base_value = 0; new_reg_base_value = 0;
free (reg_seen); free (reg_seen);
reg_seen = 0; reg_seen = 0;
timevar_pop (TV_ALIAS_ANALYSIS);
} }
void void
......
...@@ -6413,7 +6413,7 @@ finish_function (nested, can_defer_p) ...@@ -6413,7 +6413,7 @@ finish_function (nested, can_defer_p)
free_after_compilation (cfun); free_after_compilation (cfun);
cfun = NULL; cfun = NULL;
if (flag_unit_at_a_time) if (flag_unit_at_a_time && can_defer_p)
{ {
cgraph_finalize_function (fndecl, DECL_SAVED_TREE (fndecl)); cgraph_finalize_function (fndecl, DECL_SAVED_TREE (fndecl));
current_function_decl = NULL; current_function_decl = NULL;
......
...@@ -2477,6 +2477,15 @@ emit_group_store (orig_dst, src, ssize) ...@@ -2477,6 +2477,15 @@ emit_group_store (orig_dst, src, ssize)
bytepos -= GET_MODE_SIZE (GET_MODE (XEXP (dst, 0))); bytepos -= GET_MODE_SIZE (GET_MODE (XEXP (dst, 0)));
dest = XEXP (dst, 1); dest = XEXP (dst, 1);
} }
else if (bytepos == 0 && XVECLEN (src, 0))
{
dest = assign_stack_temp (GET_MODE (dest),
GET_MODE_SIZE (GET_MODE (dest)), 0);
emit_move_insn (adjust_address (dest, GET_MODE (tmps[i]), bytepos),
tmps[i]);
dst = dest;
break;
}
else else
abort (); abort ();
} }
...@@ -2495,7 +2504,7 @@ emit_group_store (orig_dst, src, ssize) ...@@ -2495,7 +2504,7 @@ emit_group_store (orig_dst, src, ssize)
emit_queue (); emit_queue ();
/* Copy from the pseudo into the (probable) hard reg. */ /* Copy from the pseudo into the (probable) hard reg. */
if (GET_CODE (dst) == REG) if (orig_dst != dst)
emit_move_insn (orig_dst, dst); emit_move_insn (orig_dst, dst);
} }
......
...@@ -53,6 +53,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -53,6 +53,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "toplev.h" #include "toplev.h"
#include "reload.h" #include "reload.h"
#include "predict.h" #include "predict.h"
#include "timevar.h"
/* Optimize jump y; x: ... y: jumpif... x? /* Optimize jump y; x: ... y: jumpif... x?
Don't know if it is worth bothering with. */ Don't know if it is worth bothering with. */
...@@ -82,6 +83,7 @@ rebuild_jump_labels (f) ...@@ -82,6 +83,7 @@ rebuild_jump_labels (f)
{ {
rtx insn; rtx insn;
timevar_push (TV_REBUILD_JUMP);
init_label_info (f); init_label_info (f);
mark_all_labels (f); mark_all_labels (f);
...@@ -92,6 +94,7 @@ rebuild_jump_labels (f) ...@@ -92,6 +94,7 @@ rebuild_jump_labels (f)
for (insn = forced_labels; insn; insn = XEXP (insn, 1)) for (insn = forced_labels; insn; insn = XEXP (insn, 1))
if (GET_CODE (XEXP (insn, 0)) == CODE_LABEL) if (GET_CODE (XEXP (insn, 0)) == CODE_LABEL)
LABEL_NUSES (XEXP (insn, 0))++; LABEL_NUSES (XEXP (insn, 0))++;
timevar_pop (TV_REBUILD_JUMP);
} }
/* Some old code expects exactly one BARRIER as the NEXT_INSN of a /* Some old code expects exactly one BARRIER as the NEXT_INSN of a
......
...@@ -60,6 +60,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -60,6 +60,7 @@ Boston, MA 02111-1307, USA. */
#include "debug.h" #include "debug.h"
#include "target.h" #include "target.h"
#include "diagnostic.h" #include "diagnostic.h"
#include "cgraph.h"
/* This is the default way of generating a method name. */ /* This is the default way of generating a method name. */
/* I am not sure it is really correct. /* I am not sure it is really correct.
...@@ -294,6 +295,7 @@ static void handle_class_ref PARAMS ((tree)); ...@@ -294,6 +295,7 @@ static void handle_class_ref PARAMS ((tree));
static void generate_struct_by_value_array PARAMS ((void)) static void generate_struct_by_value_array PARAMS ((void))
ATTRIBUTE_NORETURN; ATTRIBUTE_NORETURN;
static void encode_complete_bitfield PARAMS ((int, tree, int)); static void encode_complete_bitfield PARAMS ((int, tree, int));
static void mark_referenced_methods PARAMS ((void));
/*** Private Interface (data) ***/ /*** Private Interface (data) ***/
...@@ -486,6 +488,7 @@ objc_init (filename) ...@@ -486,6 +488,7 @@ objc_init (filename)
void void
finish_file () finish_file ()
{ {
mark_referenced_methods ();
c_objc_common_finish_file (); c_objc_common_finish_file ();
/* Finalize Objective-C runtime data. No need to generate tables /* Finalize Objective-C runtime data. No need to generate tables
...@@ -4028,6 +4031,29 @@ generate_dispatch_table (type, name, size, list) ...@@ -4028,6 +4031,29 @@ generate_dispatch_table (type, name, size, list)
} }
static void static void
mark_referenced_methods ()
{
struct imp_entry *impent;
tree chain;
for (impent = imp_list; impent; impent = impent->next)
{
chain = CLASS_CLS_METHODS (impent->imp_context);
while (chain)
{
cgraph_mark_needed_node (cgraph_node (METHOD_DEFINITION (chain)));
chain = TREE_CHAIN (chain);
}
chain = CLASS_NST_METHODS (impent->imp_context);
while (chain)
{
cgraph_mark_needed_node (cgraph_node (METHOD_DEFINITION (chain)));
chain = TREE_CHAIN (chain);
}
}
}
static void
generate_dispatch_tables () generate_dispatch_tables ()
{ {
tree initlist, chain, method_list_template; tree initlist, chain, method_list_template;
......
...@@ -99,6 +99,9 @@ static void objc_init_options PARAMS ((void)); ...@@ -99,6 +99,9 @@ static void objc_init_options PARAMS ((void));
#define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \ #define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \
c_convert_parm_for_inlining c_convert_parm_for_inlining
#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION c_expand_body
#undef LANG_HOOKS_TYPE_FOR_MODE #undef LANG_HOOKS_TYPE_FOR_MODE
#define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode #define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode
#undef LANG_HOOKS_TYPE_FOR_SIZE #undef LANG_HOOKS_TYPE_FOR_SIZE
......
...@@ -5119,14 +5119,25 @@ expand_fix (to, from, unsignedp) ...@@ -5119,14 +5119,25 @@ expand_fix (to, from, unsignedp)
one plus the highest signed number, convert, and add it back. one plus the highest signed number, convert, and add it back.
We only need to check all real modes, since we know we didn't find We only need to check all real modes, since we know we didn't find
anything with a wider integer mode. */ anything with a wider integer mode.
This code used to extend FP value into mode wider than the destination.
This is not needed. Consider, for instance conversion from SFmode
into DImode.
The hot path trought the code is dealing with inputs smaller than 2^63
and doing just the conversion, so there is no bits to lose.
In the other path we know the value is positive in the range 2^63..2^64-1
inclusive. (as for other imput overflow happens and result is undefined)
So we know that the most important bit set in mantisa corresponds to
2^63. The subtraction of 2^63 should not generate any rounding as it
simply clears out that bit. The rest is trivial. */
if (unsignedp && GET_MODE_BITSIZE (GET_MODE (to)) <= HOST_BITS_PER_WIDE_INT) if (unsignedp && GET_MODE_BITSIZE (GET_MODE (to)) <= HOST_BITS_PER_WIDE_INT)
for (fmode = GET_MODE (from); fmode != VOIDmode; for (fmode = GET_MODE (from); fmode != VOIDmode;
fmode = GET_MODE_WIDER_MODE (fmode)) fmode = GET_MODE_WIDER_MODE (fmode))
/* Make sure we won't lose significant bits doing this. */ if (CODE_FOR_nothing != can_fix_p (GET_MODE (to), fmode, 0,
if (GET_MODE_BITSIZE (fmode) > GET_MODE_BITSIZE (GET_MODE (to))
&& CODE_FOR_nothing != can_fix_p (GET_MODE (to), fmode, 0,
&must_trunc)) &must_trunc))
{ {
int bitsize; int bitsize;
......
...@@ -43,6 +43,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -43,6 +43,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "toplev.h" #include "toplev.h"
#include "output.h" #include "output.h"
#include "ggc.h" #include "ggc.h"
#include "timevar.h"
#ifndef REGISTER_MOVE_COST #ifndef REGISTER_MOVE_COST
#define REGISTER_MOVE_COST(m, x, y) 2 #define REGISTER_MOVE_COST(m, x, y) 2
...@@ -2338,6 +2339,8 @@ reg_scan (f, nregs, repeat) ...@@ -2338,6 +2339,8 @@ reg_scan (f, nregs, repeat)
max_parallel = 3; max_parallel = 3;
max_set_parallel = 0; max_set_parallel = 0;
timevar_push (TV_REG_SCAN);
for (insn = f; insn; insn = NEXT_INSN (insn)) for (insn = f; insn; insn = NEXT_INSN (insn))
if (GET_CODE (insn) == INSN if (GET_CODE (insn) == INSN
|| GET_CODE (insn) == CALL_INSN || GET_CODE (insn) == CALL_INSN
...@@ -2353,6 +2356,8 @@ reg_scan (f, nregs, repeat) ...@@ -2353,6 +2356,8 @@ reg_scan (f, nregs, repeat)
} }
max_parallel += max_set_parallel; max_parallel += max_set_parallel;
timevar_pop (TV_REG_SCAN);
} }
/* Update 'regscan' information by looking at the insns /* Update 'regscan' information by looking at the insns
......
...@@ -47,6 +47,10 @@ DEFTIMEVAR (TV_DELETE_TRIVIALLY_DEAD , "trivially dead code") ...@@ -47,6 +47,10 @@ DEFTIMEVAR (TV_DELETE_TRIVIALLY_DEAD , "trivially dead code")
/* Time spent by life analysis. */ /* Time spent by life analysis. */
DEFTIMEVAR (TV_LIFE , "life analysis") DEFTIMEVAR (TV_LIFE , "life analysis")
DEFTIMEVAR (TV_LIFE_UPDATE , "life info update") DEFTIMEVAR (TV_LIFE_UPDATE , "life info update")
DEFTIMEVAR (TV_ALIAS_ANALYSIS , "alias analysis")
DEFTIMEVAR (TV_REG_SCAN , "register scan")
DEFTIMEVAR (TV_REBUILD_JUMP , "rebuild jump labels")
/* Timing in various stages of the compiler. */ /* Timing in various stages of the compiler. */
DEFTIMEVAR (TV_CPP , "preprocessing") DEFTIMEVAR (TV_CPP , "preprocessing")
DEFTIMEVAR (TV_LEX , "lexical analysis") DEFTIMEVAR (TV_LEX , "lexical analysis")
......
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