This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] RTL docs update


On 7/2/07, Richard Sandiford <richard@codesourcery.com> wrote:
""Seongbae Park (박성배, 朴成培)"" <seongbae.park@gmail.com> writes:
> @@ -212,8 +212,15 @@ DEF_RTL_EXPR(ASM_OPERANDS, "asm_operands
>       operations is to be performed.
>     (Note that the vector must be the first operand because of the way that
>     genrecog.c record positions within an insn.)
> -   This can occur all by itself in a PATTERN, as a component of a PARALLEL,
> -   or inside an expression.  */
> +
> +   UNSPEC can occur all by itself in a PATTERN, as a component of a PARALLEL,
> +   or inside an expression.
> +   UNSPEC by itself or as a component of a PARALLEL
> +   is currently considered not deletable.
> +
> +   FIXME: Replace all uses of UNSPEC that appears by itself or as a component
> +   of a PARALLEL with USE.
> +   */

Do we actually want to do that?  Some of the current uses of UNSPECs are
for things that are supposed to be less severe than an UNSPEC_VOLATILE.
The MIPS case was an example of that.  The SPU ifetch pattern is another.

Before further to into this discussion, let me define some terms I'll use:


I'll call an rtx sppearing as "top-level" if the rtx
appears either an INSN itself or as the operand of PARALLEL
but not as operands of other rtx.

The longer term direction I was thinking we wanted, was to use top-level USE
to indicate the value is used by something,
and make it invalid to use UNSPEC as top-level
(or even if it is not invalid, it would essentially be a dead code,
just like e.g. "PLUS" as top-level would be a dead code).

I don't understand why UNSPEC_VOLATILE has anything to do with
this discussion though.

> @@ -273,12 +280,20 @@ DEF_RTL_EXPR(SET, "set", "ee", RTX_EXTRA
>
>  /* Indicate something is used in a way that we don't want to explain.
>     For example, subroutine calls will use the register
> -   in which the static chain is passed.  */
> +   in which the static chain is passed.
> +
> +   USE can not be used as an operand of other rtx.
> +   USE is not deletable, as it indicates that the operand
> +   is used in some unknown way.  */
>  DEF_RTL_EXPR(USE, "use", "e", RTX_EXTRA)
>
>  /* Indicate something is clobbered in a way that we don't want to explain.
>     For example, subroutine calls will clobber some physical registers
> -   (the ones that are by convention not saved).  */
> +   (the ones that are by convention not saved).
> +
> +   CLOBBER can not be used as an operand of any other rtx, other than PARALLEL.
> +   CLOBBER of a hard register appearing by itself (not within PARALLEL)
> +   is considered undeletable before reload.  */
>  DEF_RTL_EXPR(CLOBBER, "clobber", "e", RTX_EXTRA)

This implies that USEs can't appear inside a PARALLEL, but they can.
The two are very similar in that respect.

Richard

Attached is the updated patch. Thanks for the comments ! -- #pragma ident "Seongbae Park, compiler, http://seongbae.blogspot.com";
Index: rtl.def
===================================================================
--- rtl.def	(revision 126222)
+++ rtl.def	(working copy)
@@ -212,8 +212,15 @@ DEF_RTL_EXPR(ASM_OPERANDS, "asm_operands
      operations is to be performed.
    (Note that the vector must be the first operand because of the way that
    genrecog.c record positions within an insn.)
-   This can occur all by itself in a PATTERN, as a component of a PARALLEL,
-   or inside an expression.  */
+
+   UNSPEC can occur all by itself in a PATTERN, as a component of a PARALLEL,
+   or inside an expression.  
+   UNSPEC by itself or as a component of a PARALLEL
+   is currently considered not deletable.
+
+   FIXME: Replace all uses of UNSPEC that appears by itself or as a component
+   of a PARALLEL with USE.
+   */
 DEF_RTL_EXPR(UNSPEC, "unspec", "Ei", RTX_EXTRA)
 
 /* Similar, but a volatile operation and one which may trap.  */
@@ -273,12 +280,20 @@ DEF_RTL_EXPR(SET, "set", "ee", RTX_EXTRA
 
 /* Indicate something is used in a way that we don't want to explain.
    For example, subroutine calls will use the register
-   in which the static chain is passed.  */
+   in which the static chain is passed.  
+
+   USE can not appear as an operand of other rtx except for PARALLEL.
+   USE is not deletable, as it indicates that the operand
+   is used in some unknown way.  */
 DEF_RTL_EXPR(USE, "use", "e", RTX_EXTRA)
 
 /* Indicate something is clobbered in a way that we don't want to explain.
    For example, subroutine calls will clobber some physical registers
-   (the ones that are by convention not saved).  */
+   (the ones that are by convention not saved).  
+
+   CLOBBER can not be used as an operand of any other rtx, except for PARALLEL.
+   CLOBBER of a hard register appearing by itself (not within PARALLEL)
+   is considered undeletable before reload.  */
 DEF_RTL_EXPR(CLOBBER, "clobber", "e", RTX_EXTRA)
 
 /* Call a subroutine.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]