emit-rtl.c (copy_delay_slot_insn): New function.

2012-10-20  Joern Rennecke  <joern.rennecke@embecosm.com>
            Richard Sandiford  <rdsandiford@googlemail.com>

        * emit-rtl.c (copy_delay_slot_insn): New function.
        * emit-rtl.h (copy_delay_slot_insn): Declare.
        * reorg.c: Include "emit-rtl.h".
        (steal_delay_list_from_target): Use copy_delay_slot_insn.
        (fill_slots_from_thread, fill_simple_delay_slots): Likewise.

Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com>

From-SVN: r192633
This commit is contained in:
Joern Rennecke 2012-10-20 11:37:27 +00:00 committed by Joern Rennecke
parent 4d84e22c4b
commit 8e38384964
4 changed files with 31 additions and 10 deletions

View file

@ -1,3 +1,12 @@
2012-10-20 Joern Rennecke <joern.rennecke@embecosm.com>
Richard Sandiford <rdsandiford@googlemail.com>
* emit-rtl.c (copy_delay_slot_insn): New function.
* emit-rtl.h (copy_delay_slot_insn): Declare.
* reorg.c: Include "emit-rtl.h".
(steal_delay_list_from_target): Use copy_delay_slot_insn.
(fill_slots_from_thread, fill_simple_delay_slots): Likewise.
2012-10-19 Jan Hubicka <jh@suse.cz>
* builtins.def (BUILT_IN_UNREACHABLE): Make ATTR_CONST_NORETURN_NOTHROW_LEAF_LIST.

View file

@ -1,8 +1,5 @@
/* Emit RTL for the GCC expander.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010, 2011
Free Software Foundation, Inc.
Copyright (C) 1987, 1988, 1992-2012 Free Software Foundation, Inc.
This file is part of GCC.
@ -5378,6 +5375,18 @@ copy_insn (rtx insn)
return copy_insn_1 (insn);
}
/* Return a copy of INSN that can be used in a SEQUENCE delay slot,
on that assumption that INSN itself remains in its original place. */
rtx
copy_delay_slot_insn (rtx insn)
{
/* Copy INSN with its rtx_code, all its notes, location etc. */
insn = copy_rtx (insn);
INSN_UID (insn) = cur_insn_uid++;
return insn;
}
/* Initialize data structures and variables in this file
before generating rtl for each function. */

View file

@ -1,5 +1,5 @@
/* Exported functions from emit-rtl.c
Copyright (C) 2004, 2007, 2008, 2010 Free Software Foundation, Inc.
Copyright (C) 2004, 2007, 2008, 2010, 2012 Free Software Foundation, Inc.
This file is part of GCC.
@ -61,6 +61,7 @@ extern rtx gen_blockage (void);
extern rtvec gen_rtvec (int, ...);
extern rtx copy_insn_1 (rtx);
extern rtx copy_insn (rtx);
extern rtx copy_delay_slot_insn (rtx);
extern rtx gen_int_mode (HOST_WIDE_INT, enum machine_mode);
extern rtx emit_copy_of_insn_after (rtx, rtx);
extern void set_reg_attrs_from_value (rtx, rtx);

View file

@ -1,6 +1,6 @@
/* Perform instruction reorganizations for delay slot filling.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012
Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu).
Hacked by Michael Tiemann (tiemann@cygnus.com).
@ -134,6 +134,7 @@ along with GCC; see the file COPYING3. If not see
#include "params.h"
#include "target.h"
#include "tree-pass.h"
#include "emit-rtl.h"
#ifdef DELAY_SLOTS
@ -1297,7 +1298,7 @@ steal_delay_list_from_target (rtx insn, rtx condition, rtx seq,
{
if (must_annul)
used_annul = 1;
temp = copy_rtx (trial);
temp = copy_delay_slot_insn (trial);
INSN_FROM_TARGET_P (temp) = 1;
new_delay_list = add_to_delay_list (temp, new_delay_list);
total_slots_filled++;
@ -2369,7 +2370,8 @@ fill_simple_delay_slots (int non_jumps_p)
if (new_label)
{
delay_list
= add_to_delay_list (copy_rtx (next_trial), delay_list);
= add_to_delay_list (copy_delay_slot_insn (next_trial),
delay_list);
slots_filled++;
reorg_redirect_jump (trial, new_label);
@ -2793,7 +2795,7 @@ fill_slots_from_thread (rtx insn, rtx condition, rtx thread,
else
new_thread = next_active_insn (trial);
temp = own_thread ? trial : copy_rtx (trial);
temp = own_thread ? trial : copy_delay_slot_insn (trial);
if (thread_if_true)
INSN_FROM_TARGET_P (temp) = 1;
@ -2974,7 +2976,7 @@ fill_slots_from_thread (rtx insn, rtx condition, rtx thread,
else
new_thread = next_active_insn (trial);
ninsn = own_thread ? trial : copy_rtx (trial);
ninsn = own_thread ? trial : copy_delay_slot_insn (trial);
if (thread_if_true)
INSN_FROM_TARGET_P (ninsn) = 1;