* [PATCH] use cfglayout mode for instatiate_virtual_regs
@ 2011-03-24 11:47 Nathan Froyd
2011-03-24 20:35 ` Richard Henderson
2011-03-25 4:12 ` H.J. Lu
0 siblings, 2 replies; 4+ messages in thread
From: Nathan Froyd @ 2011-03-24 11:47 UTC (permalink / raw)
To: gcc-patches
As $SUBJECT suggests. The patch looks much bigger than it actually is
due to re-indentation.
Tested on x86_64-unknown-linux-gnu. OK to commit?
-Nathan
* function.c (instantiate_virtual_regs): Use FOR_EACH_BB and
FOR_BB_INSNS_SAFE to iterate through insns. Re-indent.
* passes.c (init_optimization_passes): Move
pass_instantiate_virtual_regs after pass_into_cfg_layout_mode.
diff --git a/gcc/function.c b/gcc/function.c
index a1ea482..49404c8 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -1883,7 +1883,7 @@ instantiate_decls (tree fndecl)
static unsigned int
instantiate_virtual_regs (void)
{
- rtx insn;
+ basic_block bb;
/* Compute the offsets to use for this function. */
in_arg_offset = FIRST_PARM_OFFSET (current_function_decl);
@@ -1901,33 +1901,40 @@ instantiate_virtual_regs (void)
/* Scan through all the insns, instantiating every virtual register still
present. */
- for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
- if (INSN_P (insn))
- {
- /* These patterns in the instruction stream can never be recognized.
- Fortunately, they shouldn't contain virtual registers either. */
- if (GET_CODE (PATTERN (insn)) == USE
- || GET_CODE (PATTERN (insn)) == CLOBBER
- || GET_CODE (PATTERN (insn)) == ADDR_VEC
- || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC
- || GET_CODE (PATTERN (insn)) == ASM_INPUT)
- continue;
- else if (DEBUG_INSN_P (insn))
- for_each_rtx (&INSN_VAR_LOCATION (insn),
- instantiate_virtual_regs_in_rtx, NULL);
- else
- instantiate_virtual_regs_in_insn (insn);
+ FOR_EACH_BB (bb)
+ {
+ rtx insn, curr;
- if (INSN_DELETED_P (insn))
- continue;
+ FOR_BB_INSNS_SAFE (bb, insn, curr)
+ {
+ if (INSN_P (insn))
+ {
+ /* These patterns in the instruction stream can never be recognized.
+ Fortunately, they shouldn't contain virtual registers either. */
+ if (GET_CODE (PATTERN (insn)) == USE
+ || GET_CODE (PATTERN (insn)) == CLOBBER
+ || GET_CODE (PATTERN (insn)) == ADDR_VEC
+ || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC
+ || GET_CODE (PATTERN (insn)) == ASM_INPUT)
+ continue;
+ else if (DEBUG_INSN_P (insn))
+ for_each_rtx (&INSN_VAR_LOCATION (insn),
+ instantiate_virtual_regs_in_rtx, NULL);
+ else
+ instantiate_virtual_regs_in_insn (insn);
- for_each_rtx (®_NOTES (insn), instantiate_virtual_regs_in_rtx, NULL);
+ if (INSN_DELETED_P (insn))
+ continue;
- /* Instantiate any virtual registers in CALL_INSN_FUNCTION_USAGE. */
- if (CALL_P (insn))
- for_each_rtx (&CALL_INSN_FUNCTION_USAGE (insn),
- instantiate_virtual_regs_in_rtx, NULL);
- }
+ for_each_rtx (®_NOTES (insn), instantiate_virtual_regs_in_rtx, NULL);
+
+ /* Instantiate any virtual registers in CALL_INSN_FUNCTION_USAGE. */
+ if (CALL_P (insn))
+ for_each_rtx (&CALL_INSN_FUNCTION_USAGE (insn),
+ instantiate_virtual_regs_in_rtx, NULL);
+ }
+ }
+ }
/* Instantiate the virtual registers in the DECLs for debugging purposes. */
instantiate_decls (current_function_decl);
@@ -1963,7 +1970,7 @@ struct rtl_opt_pass pass_instantiate_virtual_regs =
NULL, /* next */
0, /* static_pass_number */
TV_NONE, /* tv_id */
- 0, /* properties_required */
+ PROP_cfglayout, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
diff --git a/gcc/passes.c b/gcc/passes.c
index 42a3239..3353557 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -956,8 +956,8 @@ init_optimization_passes (void)
NEXT_PASS (pass_rtl_eh);
NEXT_PASS (pass_initial_value_sets);
NEXT_PASS (pass_unshare_all_rtl);
- NEXT_PASS (pass_instantiate_virtual_regs);
NEXT_PASS (pass_into_cfg_layout_mode);
+ NEXT_PASS (pass_instantiate_virtual_regs);
NEXT_PASS (pass_jump2);
NEXT_PASS (pass_lower_subreg);
NEXT_PASS (pass_df_initialize_opt);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] use cfglayout mode for instatiate_virtual_regs
2011-03-24 11:47 [PATCH] use cfglayout mode for instatiate_virtual_regs Nathan Froyd
@ 2011-03-24 20:35 ` Richard Henderson
2011-03-25 4:12 ` H.J. Lu
1 sibling, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2011-03-24 20:35 UTC (permalink / raw)
To: Nathan Froyd; +Cc: gcc-patches
On 03/24/2011 04:47 AM, Nathan Froyd wrote:
> * function.c (instantiate_virtual_regs): Use FOR_EACH_BB and
> FOR_BB_INSNS_SAFE to iterate through insns. Re-indent.
> * passes.c (init_optimization_passes): Move
> pass_instantiate_virtual_regs after pass_into_cfg_layout_mode.
Ok.
r~
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] use cfglayout mode for instatiate_virtual_regs
2011-03-24 11:47 [PATCH] use cfglayout mode for instatiate_virtual_regs Nathan Froyd
2011-03-24 20:35 ` Richard Henderson
@ 2011-03-25 4:12 ` H.J. Lu
2011-03-25 5:24 ` H.J. Lu
1 sibling, 1 reply; 4+ messages in thread
From: H.J. Lu @ 2011-03-25 4:12 UTC (permalink / raw)
To: Nathan Froyd; +Cc: gcc-patches
On Thu, Mar 24, 2011 at 4:47 AM, Nathan Froyd <froydnj@codesourcery.com> wrote:
> As $SUBJECT suggests. The patch looks much bigger than it actually is
> due to re-indentation.
>
> Tested on x86_64-unknown-linux-gnu. OK to commit?
>
> -Nathan
>
> * function.c (instantiate_virtual_regs): Use FOR_EACH_BB and
> FOR_BB_INSNS_SAFE to iterate through insns. Re-indent.
> * passes.c (init_optimization_passes): Move
> pass_instantiate_virtual_regs after pass_into_cfg_layout_mode.
>
This caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48282
--
H.J.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] use cfglayout mode for instatiate_virtual_regs
2011-03-25 4:12 ` H.J. Lu
@ 2011-03-25 5:24 ` H.J. Lu
0 siblings, 0 replies; 4+ messages in thread
From: H.J. Lu @ 2011-03-25 5:24 UTC (permalink / raw)
To: Nathan Froyd; +Cc: gcc-patches
On Thu, Mar 24, 2011 at 9:11 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Mar 24, 2011 at 4:47 AM, Nathan Froyd <froydnj@codesourcery.com> wrote:
>> As $SUBJECT suggests. The patch looks much bigger than it actually is
>> due to re-indentation.
>>
>> Tested on x86_64-unknown-linux-gnu. OK to commit?
Did you run -m32 tests on Linux/x86-64? Many 32bit tests failed on Linux/x86-64:
http://gcc.gnu.org/ml/gcc-testresults/2011-03/msg02419.html
>>
>> -Nathan
>>
>> * function.c (instantiate_virtual_regs): Use FOR_EACH_BB and
>> FOR_BB_INSNS_SAFE to iterate through insns. Re-indent.
>> * passes.c (init_optimization_passes): Move
>> pass_instantiate_virtual_regs after pass_into_cfg_layout_mode.
>>
>
> This caused:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48282
>
--
H.J.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-03-25 5:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-24 11:47 [PATCH] use cfglayout mode for instatiate_virtual_regs Nathan Froyd
2011-03-24 20:35 ` Richard Henderson
2011-03-25 4:12 ` H.J. Lu
2011-03-25 5:24 ` H.J. Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).