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]

[PATCH 2/4] rs6000: Remove "length 4" from branch insns


Now that it is the default for branch insns like for all other insns,
we don't need to set it explicitly so often anymore.


2018-08-16  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/altivec.md: Don't set length attribute to the default
	value, for branch instructions.
	* config/rs6000/darwin.md: Ditto.
	* config/rs6000/rs6000.md: Ditto.

---
 gcc/config/rs6000/altivec.md | 15 +++------
 gcc/config/rs6000/darwin.md  | 12 +++----
 gcc/config/rs6000/rs6000.md  | 74 ++++++++++++++------------------------------
 3 files changed, 33 insertions(+), 68 deletions(-)

diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md
index 8ee42ae..1af9687 100644
--- a/gcc/config/rs6000/altivec.md
+++ b/gcc/config/rs6000/altivec.md
@@ -413,8 +413,7 @@ (define_insn "*save_world"
                    (use (match_operand:SI 1 "call_operand" "s"))])]
  "TARGET_MACHO && (DEFAULT_ABI == ABI_DARWIN) && TARGET_32BIT"         
  "bl %z1"
-  [(set_attr "type" "branch")
-   (set_attr "length" "4")])
+  [(set_attr "type" "branch")])
 
 (define_insn "*restore_world"
  [(match_parallel 0 "restore_world_operation"
@@ -441,8 +440,7 @@ (define_insn "*save_vregs_<mode>_r11"
 	   (match_operand:V4SI 4 "altivec_register_operand" "v"))])]
   "TARGET_ALTIVEC"
   "bl %1"
-  [(set_attr "type" "branch")
-   (set_attr "length" "4")])
+  [(set_attr "type" "branch")])
 
 (define_insn "*save_vregs_<mode>_r12"
   [(match_parallel 0 "any_parallel_operand"
@@ -455,8 +453,7 @@ (define_insn "*save_vregs_<mode>_r12"
 	   (match_operand:V4SI 4 "altivec_register_operand" "v"))])]
   "TARGET_ALTIVEC"
   "bl %1"
-  [(set_attr "type" "branch")
-   (set_attr "length" "4")])
+  [(set_attr "type" "branch")])
 
 (define_insn "*restore_vregs_<mode>_r11"
   [(match_parallel 0 "any_parallel_operand"
@@ -469,8 +466,7 @@ (define_insn "*restore_vregs_<mode>_r11"
 			     (match_operand:P 4 "short_cint_operand" "I"))))])]
   "TARGET_ALTIVEC"
   "bl %1"
-  [(set_attr "type" "branch")
-   (set_attr "length" "4")])
+  [(set_attr "type" "branch")])
 
 (define_insn "*restore_vregs_<mode>_r12"
   [(match_parallel 0 "any_parallel_operand"
@@ -483,8 +479,7 @@ (define_insn "*restore_vregs_<mode>_r12"
 			     (match_operand:P 4 "short_cint_operand" "I"))))])]
   "TARGET_ALTIVEC"
   "bl %1"
-  [(set_attr "type" "branch")
-   (set_attr "length" "4")])
+  [(set_attr "type" "branch")])
 
 ;; Simple binary operations.
 
diff --git a/gcc/config/rs6000/darwin.md b/gcc/config/rs6000/darwin.md
index 48fd5b96..7c429a5 100644
--- a/gcc/config/rs6000/darwin.md
+++ b/gcc/config/rs6000/darwin.md
@@ -263,8 +263,7 @@ (define_insn "load_macho_picbase_si"
   return "bcl 20,31,%0\n%0:";
 }
   [(set_attr "type" "branch")
-   (set_attr "cannot_copy" "yes")
-   (set_attr "length" "4")])
+   (set_attr "cannot_copy" "yes")])
 
 (define_insn "load_macho_picbase_di"
   [(set (reg:DI LR_REGNO)
@@ -280,8 +279,7 @@ (define_insn "load_macho_picbase_di"
   return "bcl 20,31,%0\n%0:";
 }
   [(set_attr "type" "branch")
-   (set_attr "cannot_copy" "yes")
-   (set_attr "length" "4")])
+   (set_attr "cannot_copy" "yes")])
 
 (define_expand "macho_correct_pic"
   [(set (match_operand 0 "")
@@ -416,8 +414,7 @@ (define_insn "reload_macho_picbase_si"
     return "bcl 20,31,%0\n%0:";
 }
   [(set_attr "type" "branch")
-   (set_attr "cannot_copy" "yes")
-   (set_attr "length" "4")])
+   (set_attr "cannot_copy" "yes")])
 
 (define_insn "reload_macho_picbase_di"
   [(set (reg:DI LR_REGNO)
@@ -440,8 +437,7 @@ (define_insn "reload_macho_picbase_di"
     return "bcl 20,31,%0\n%0:";
 }
   [(set_attr "type" "branch")
-   (set_attr "cannot_copy" "yes")
-   (set_attr "length" "4")])
+   (set_attr "cannot_copy" "yes")])
 
 ;; We need to restore the PIC register, at the site of nonlocal label.
 
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 45e42ff..c066bae 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -9450,8 +9450,7 @@ (define_insn "*tls_gd_call_sysv<TLSmode:tls_abi_suffix>"
     }
   return "bl %z1(%3@tlsgd)";
 }
-  [(set_attr "type" "branch")
-   (set_attr "length" "4")])
+  [(set_attr "type" "branch")])
 
 (define_insn_and_split "tls_ld_aix<TLSmode:tls_abi_suffix>"
   [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b")
@@ -9584,8 +9583,7 @@ (define_insn "*tls_ld_call_sysv<TLSmode:tls_abi_suffix>"
     }
   return "bl %z1(%&@tlsld)";
 }
-  [(set_attr "type" "branch")
-   (set_attr "length" "4")])
+  [(set_attr "type" "branch")])
 
 (define_insn "tls_dtprel_<TLSmode:tls_abi_suffix>"
   [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=r")
@@ -10028,8 +10026,7 @@ (define_insn "load_toc_v4_pic_si"
 	(unspec:SI [(const_int 0)] UNSPEC_TOC))]
   "DEFAULT_ABI == ABI_V4 && flag_pic == 1 && TARGET_32BIT"
   "bl _GLOBAL_OFFSET_TABLE_@local-4"
-  [(set_attr "type" "branch")
-   (set_attr "length" "4")])
+  [(set_attr "type" "branch")])
 
 (define_expand "load_toc_v4_PIC_1"
   [(parallel [(set (reg:SI LR_REGNO)
@@ -10047,7 +10044,6 @@ (define_insn "load_toc_v4_PIC_1_normal"
    && (flag_pic == 2 || (flag_pic && TARGET_SECURE_PLT))"
   "bcl 20,31,%0\n%0:"
   [(set_attr "type" "branch")
-   (set_attr "length" "4")
    (set_attr "cannot_copy" "yes")])
 
 (define_insn "load_toc_v4_PIC_1_476"
@@ -10065,7 +10061,6 @@ (define_insn "load_toc_v4_PIC_1_476"
   return templ;
 }
   [(set_attr "type" "branch")
-   (set_attr "length" "4")
    (set_attr "cannot_copy" "yes")])
 
 (define_expand "load_toc_v4_PIC_1b"
@@ -10649,8 +10644,7 @@ (define_insn "*call_local_aix<mode>"
    (clobber (reg:P LR_REGNO))]
   "DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2"
   "bl %z0"
-  [(set_attr "type" "branch")
-   (set_attr "length" "4")])
+  [(set_attr "type" "branch")])
 
 (define_insn "*call_value_local_aix<mode>"
   [(set (match_operand 0 "" "")
@@ -10659,8 +10653,7 @@ (define_insn "*call_value_local_aix<mode>"
    (clobber (reg:P LR_REGNO))]
   "DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2"
   "bl %z1"
-  [(set_attr "type" "branch")
-   (set_attr "length" "4")])
+  [(set_attr "type" "branch")])
 
 ;; Call to AIX abi function which may be in another module.
 ;; Restore the TOC pointer (r2) after the call.
@@ -11043,8 +11036,7 @@ (define_insn "*sibcall_aix<mode>"
   "@
    b %z0
    b%T0"
-  [(set_attr "type" "branch")
-   (set_attr "length" "4")])
+  [(set_attr "type" "branch")])
 
 (define_insn "*sibcall_value_aix<mode>"
   [(set (match_operand 0 "" "")
@@ -11055,8 +11047,7 @@ (define_insn "*sibcall_value_aix<mode>"
   "@
    b %z1
    b%T1"
-  [(set_attr "type" "branch")
-   (set_attr "length" "4")])
+  [(set_attr "type" "branch")])
 
 (define_expand "sibcall_epilogue"
   [(use (const_int 0))]
@@ -12985,8 +12976,7 @@ (define_insn "*save_gpregs_<mode>_r11"
 			 (match_operand:P 3 "gpc_reg_operand" "r"))])]
   ""
   "bl %1"
-  [(set_attr "type" "branch")
-   (set_attr "length" "4")])
+  [(set_attr "type" "branch")])
 
 (define_insn "*save_gpregs_<mode>_r12"
   [(match_parallel 0 "any_parallel_operand"
@@ -12997,8 +12987,7 @@ (define_insn "*save_gpregs_<mode>_r12"
 			 (match_operand:P 3 "gpc_reg_operand" "r"))])]
   ""
   "bl %1"
-  [(set_attr "type" "branch")
-   (set_attr "length" "4")])
+  [(set_attr "type" "branch")])
 
 (define_insn "*save_gpregs_<mode>_r1"
   [(match_parallel 0 "any_parallel_operand"
@@ -13009,8 +12998,7 @@ (define_insn "*save_gpregs_<mode>_r1"
 			 (match_operand:P 3 "gpc_reg_operand" "r"))])]
   ""
   "bl %1"
-  [(set_attr "type" "branch")
-   (set_attr "length" "4")])
+  [(set_attr "type" "branch")])
 
 (define_insn "*save_fpregs_<mode>_r11"
   [(match_parallel 0 "any_parallel_operand"
@@ -13021,8 +13009,7 @@ (define_insn "*save_fpregs_<mode>_r11"
 			 (match_operand:DF 3 "gpc_reg_operand" "d"))])]
   ""
   "bl %1"
-  [(set_attr "type" "branch")
-   (set_attr "length" "4")])
+  [(set_attr "type" "branch")])
 
 (define_insn "*save_fpregs_<mode>_r12"
   [(match_parallel 0 "any_parallel_operand"
@@ -13033,8 +13020,7 @@ (define_insn "*save_fpregs_<mode>_r12"
 			 (match_operand:DF 3 "gpc_reg_operand" "d"))])]
   ""
   "bl %1"
-  [(set_attr "type" "branch")
-   (set_attr "length" "4")])
+  [(set_attr "type" "branch")])
 
 (define_insn "*save_fpregs_<mode>_r1"
   [(match_parallel 0 "any_parallel_operand"
@@ -13045,8 +13031,7 @@ (define_insn "*save_fpregs_<mode>_r1"
 			 (match_operand:DF 3 "gpc_reg_operand" "d"))])]
   ""
   "bl %1"
-  [(set_attr "type" "branch")
-   (set_attr "length" "4")])
+  [(set_attr "type" "branch")])
 
 ; This is to explain that changes to the stack pointer should
 ; not be moved over loads from or stores to stack memory.
@@ -13163,8 +13148,7 @@ (define_insn "*restore_gpregs_<mode>_r11"
 			(match_operand:P 3 "memory_operand" "m"))])]
  ""
  "bl %1"
- [(set_attr "type" "branch")
-  (set_attr "length" "4")])
+ [(set_attr "type" "branch")])
 
 (define_insn "*restore_gpregs_<mode>_r12"
  [(match_parallel 0 "any_parallel_operand"
@@ -13175,8 +13159,7 @@ (define_insn "*restore_gpregs_<mode>_r12"
 			(match_operand:P 3 "memory_operand" "m"))])]
  ""
  "bl %1"
- [(set_attr "type" "branch")
-  (set_attr "length" "4")])
+ [(set_attr "type" "branch")])
 
 (define_insn "*restore_gpregs_<mode>_r1"
  [(match_parallel 0 "any_parallel_operand"
@@ -13187,8 +13170,7 @@ (define_insn "*restore_gpregs_<mode>_r1"
 			(match_operand:P 3 "memory_operand" "m"))])]
  ""
  "bl %1"
- [(set_attr "type" "branch")
-  (set_attr "length" "4")])
+ [(set_attr "type" "branch")])
 
 (define_insn "*return_and_restore_gpregs_<mode>_r11"
  [(match_parallel 0 "any_parallel_operand"
@@ -13200,8 +13182,7 @@ (define_insn "*return_and_restore_gpregs_<mode>_r11"
 			(match_operand:P 3 "memory_operand" "m"))])]
  ""
  "b %1"
- [(set_attr "type" "branch")
-  (set_attr "length" "4")])
+ [(set_attr "type" "branch")])
 
 (define_insn "*return_and_restore_gpregs_<mode>_r12"
  [(match_parallel 0 "any_parallel_operand"
@@ -13213,8 +13194,7 @@ (define_insn "*return_and_restore_gpregs_<mode>_r12"
 			(match_operand:P 3 "memory_operand" "m"))])]
  ""
  "b %1"
- [(set_attr "type" "branch")
-  (set_attr "length" "4")])
+ [(set_attr "type" "branch")])
 
 (define_insn "*return_and_restore_gpregs_<mode>_r1"
  [(match_parallel 0 "any_parallel_operand"
@@ -13226,8 +13206,7 @@ (define_insn "*return_and_restore_gpregs_<mode>_r1"
 			(match_operand:P 3 "memory_operand" "m"))])]
  ""
  "b %1"
- [(set_attr "type" "branch")
-  (set_attr "length" "4")])
+ [(set_attr "type" "branch")])
 
 (define_insn "*return_and_restore_fpregs_<mode>_r11"
  [(match_parallel 0 "any_parallel_operand"
@@ -13239,8 +13218,7 @@ (define_insn "*return_and_restore_fpregs_<mode>_r11"
 			(match_operand:DF 3 "memory_operand" "m"))])]
  ""
  "b %1"
- [(set_attr "type" "branch")
-  (set_attr "length" "4")])
+ [(set_attr "type" "branch")])
 
 (define_insn "*return_and_restore_fpregs_<mode>_r12"
  [(match_parallel 0 "any_parallel_operand"
@@ -13252,8 +13230,7 @@ (define_insn "*return_and_restore_fpregs_<mode>_r12"
 			(match_operand:DF 3 "memory_operand" "m"))])]
  ""
  "b %1"
- [(set_attr "type" "branch")
-  (set_attr "length" "4")])
+ [(set_attr "type" "branch")])
 
 (define_insn "*return_and_restore_fpregs_<mode>_r1"
  [(match_parallel 0 "any_parallel_operand"
@@ -13265,8 +13242,7 @@ (define_insn "*return_and_restore_fpregs_<mode>_r1"
 			(match_operand:DF 3 "memory_operand" "m"))])]
  ""
  "b %1"
- [(set_attr "type" "branch")
-  (set_attr "length" "4")])
+ [(set_attr "type" "branch")])
 
 (define_insn "*return_and_restore_fpregs_aix_<mode>_r11"
  [(match_parallel 0 "any_parallel_operand"
@@ -13277,8 +13253,7 @@ (define_insn "*return_and_restore_fpregs_aix_<mode>_r11"
 			(match_operand:DF 3 "memory_operand" "m"))])]
  ""
  "b %1"
- [(set_attr "type" "branch")
-  (set_attr "length" "4")])
+ [(set_attr "type" "branch")])
 
 (define_insn "*return_and_restore_fpregs_aix_<mode>_r1"
  [(match_parallel 0 "any_parallel_operand"
@@ -13289,8 +13264,7 @@ (define_insn "*return_and_restore_fpregs_aix_<mode>_r1"
 			(match_operand:DF 3 "memory_operand" "m"))])]
  ""
  "b %1"
- [(set_attr "type" "branch")
-  (set_attr "length" "4")])
+ [(set_attr "type" "branch")])
 
 ; This is used in compiling the unwind routines.
 (define_expand "eh_return"
-- 
1.8.3.1


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