diff mbox series

[avr] Recognize more opportunities for skip

Message ID a790f63f-0118-436c-b170-d855e2c232c0@gjlay.de
State New
Headers show
Series [avr] Recognize more opportunities for skip | expand

Commit Message

Georg-Johann Lay Sept. 13, 2024, 4:41 p.m. UTC
The transparent call insns like "*parityhi2.libgcc" output a single
[R]CALL instruction that can be skipped by the skip instructions.
Such insns have attribute "type" of "xcall" and can therefore
be easily recognized.

Ok for trunk?

Johann

--
     AVR: Detect more skip opportunities.

     The transparent call insns like "*parityhi2.libgcc" output a single
     [R]CALL instruction that can be skipped by the skip instructions.
     Such insns have attribute "type" of "xcall" and can therefore
     be easily recognized.  Same applies when "adjust_len" is "call".

     gcc/
             * config/avr/avr.cc (avr_2word_insn_p): Return true for
             transparent calls: When insn attribute "type" is "xcall"
             or when "adjust_len" is "call".

Comments

Denis Chertykov Sept. 13, 2024, 6:18 p.m. UTC | #1
пт, 13 сент. 2024 г. в 20:41, Georg-Johann Lay <avr@gjlay.de>:
>
> The transparent call insns like "*parityhi2.libgcc" output a single
> [R]CALL instruction that can be skipped by the skip instructions.
> Such insns have attribute "type" of "xcall" and can therefore
> be easily recognized.
>
> Ok for trunk?

Please, apply.

Denis.

>
> Johann
>
> --
>      AVR: Detect more skip opportunities.
>
>      The transparent call insns like "*parityhi2.libgcc" output a single
>      [R]CALL instruction that can be skipped by the skip instructions.
>      Such insns have attribute "type" of "xcall" and can therefore
>      be easily recognized.  Same applies when "adjust_len" is "call".
>
>      gcc/
>              * config/avr/avr.cc (avr_2word_insn_p): Return true for
>              transparent calls: When insn attribute "type" is "xcall"
>              or when "adjust_len" is "call".
>
> diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc
> index 48d1d0e7646..ef7e94dde2b 100644
> --- a/gcc/config/avr/avr.cc
> +++ b/gcc/config/avr/avr.cc
> @@ -12986,7 +12986,10 @@ avr_2word_insn_p (rtx_insn *insn)
>     switch (INSN_CODE (insn))
>       {
>       default:
> -      return false;
> +      return (recog_memoized (insn) >= 0
> +             // Transparent calls may be skipped.
> +             && (get_attr_type (insn) == TYPE_XCALL
> +                 || get_attr_adjust_len (insn) == ADJUST_LEN_CALL));
>
>       case CODE_FOR_movqi_insn:
>       case CODE_FOR_movuqq_insn:
diff mbox series

Patch

diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc
index 48d1d0e7646..ef7e94dde2b 100644
--- a/gcc/config/avr/avr.cc
+++ b/gcc/config/avr/avr.cc
@@ -12986,7 +12986,10 @@  avr_2word_insn_p (rtx_insn *insn)
    switch (INSN_CODE (insn))
      {
      default:
-      return false;
+      return (recog_memoized (insn) >= 0
+             // Transparent calls may be skipped.
+             && (get_attr_type (insn) == TYPE_XCALL
+                 || get_attr_adjust_len (insn) == ADJUST_LEN_CALL));

      case CODE_FOR_movqi_insn:
      case CODE_FOR_movuqq_insn: