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


""Seongbae Park (박성배, 朴成培)"" <seongbae.park@gmail.com> writes:
> +   FIXME: Replace all uses of UNSPEC that appears by itself or as a component
> +   of a PARALLEL with USE.

I'm still not convinced by this.  How should SPU's:

(define_insn "iprefetch"
  [(unspec [(const_int 0)] UNSPEC_IPREFETCH)]
  ""
  "hbrp"
  [(set_attr "type" "iprefetch")])

be written in that case?  What should it use or clobber?
I suppose ports have been known to use top-level CONST_INTs
to implement a "nop" pattern, e.g. MIPS's:

(define_insn "nop"
  [(const_int 0)]
  ""
  "%(nop%)"
  [(set_attr "type"	"nop")
   (set_attr "mode"	"none")])

but I think it would be cleaner to move _towards_ rather than
away from UNSPECs in this case.

> @@ -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 appear as an operand of other rtx except for PARALLEL.
> +   CLOBBER of a hard register appearing by itself (not within PARALLEL)
> +   is considered undeletable before reload.  */

I think the USE comment needs to be clarified to say that a "USE appearing
by itself (not within PARALLEL)" is not deletable.  It sounds to me like
the comments above are saying that USEs inside PARALLELs aren't deletable,
but CLOBBERs are.  The truth is that both are deletable in PARALLELs.

Richard


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