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]

[AArch64] Delete aarch64_symbol_context which is not used


The concept of aarch64_symbol_context is not used in AArch64, this patch
remove it and all relevant code.

ok for trunk?

2015-09-08  Jiong. Wang  <jiong.wang@arm.com>

gcc/
  * config/aarch64/aarch64-protos.h (aarch64_symbol_context): Delete.
  * config/aarch64/aarch64.c (aarch64_expand_mov_immediate): Likewise.
  (aarch64_cannot_force_const_mem): Likewise.
  (aarch64_classify_address): Likewise.
  (aarch64_classify_symbolic_expression): Likewise.
  (aarch64_print_operand): Likewise.
  (aarch64_classify_symbol): Likewise.
  (aarch64_mov_operand_p): Likewise.
  * config/aarch64/predicates.md (aarch64_valid_symref): Likewise.
  (aarch64_mov_operand): Likewise.
-- 
Regards,
Jiong

diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h
index a834027..8035ae1 100644
--- a/gcc/config/aarch64/aarch64-protos.h
+++ b/gcc/config/aarch64/aarch64-protos.h
@@ -24,18 +24,6 @@

 #include "input.h"

-/*
-  SYMBOL_CONTEXT_ADR
-  The symbol is used in a load-address operation.
-  SYMBOL_CONTEXT_MEM
-  The symbol is used as the address in a MEM.
- */
-enum aarch64_symbol_context
-{
-  SYMBOL_CONTEXT_MEM,
-  SYMBOL_CONTEXT_ADR
-};
-
 /* SYMBOL_SMALL_ABSOLUTE: Generate symbol accesses through
    high and lo relocs that calculate the base address using a PC
    relative reloc.
@@ -262,8 +250,7 @@ HOST_WIDE_INT aarch64_initial_elimination_offset (unsigned, unsigned);
 int aarch64_get_condition_code (rtx);
 bool aarch64_bitmask_imm (HOST_WIDE_INT val, machine_mode);
 int aarch64_branch_cost (bool, bool);
-enum aarch64_symbol_type
-aarch64_classify_symbolic_expression (rtx, enum aarch64_symbol_context);
+enum aarch64_symbol_type aarch64_classify_symbolic_expression (rtx);
 bool aarch64_const_vec_all_same_int_p (rtx, HOST_WIDE_INT);
 bool aarch64_constant_address_p (rtx);
 bool aarch64_expand_movmem (rtx *);
@@ -282,8 +269,7 @@ bool aarch64_legitimate_pic_operand_p (rtx);
 bool aarch64_modes_tieable_p (machine_mode mode1,
 			      machine_mode mode2);
 bool aarch64_move_imm (HOST_WIDE_INT, machine_mode);
-bool aarch64_mov_operand_p (rtx, enum aarch64_symbol_context,
-			    machine_mode);
+bool aarch64_mov_operand_p (rtx, machine_mode);
 int aarch64_simd_attr_length_rglist (enum machine_mode);
 rtx aarch64_reverse_mask (enum machine_mode);
 bool aarch64_offset_7bit_signed_scaled_p (machine_mode, HOST_WIDE_INT);
@@ -308,8 +294,7 @@ const char *aarch64_mangle_builtin_type (const_tree);
 const char *aarch64_output_casesi (rtx *);
 const char *aarch64_rewrite_selected_cpu (const char *name);

-enum aarch64_symbol_type aarch64_classify_symbol (rtx, rtx,
-						  enum aarch64_symbol_context);
+enum aarch64_symbol_type aarch64_classify_symbol (rtx, rtx);
 enum aarch64_symbol_type aarch64_classify_tls_symbol (rtx);
 enum reg_class aarch64_regno_regclass (unsigned);
 int aarch64_asm_preferred_eh_data_format (int, int);
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 3cd5196..a76832f 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -1735,7 +1735,7 @@ aarch64_expand_mov_immediate (rtx dest, rtx imm)
 	 before we start classifying the symbol.  */
       split_const (imm, &base, &offset);

-      sty = aarch64_classify_symbol (base, offset, SYMBOL_CONTEXT_ADR);
+      sty = aarch64_classify_symbol (base, offset);
       switch (sty)
 	{
 	case SYMBOL_FORCE_TO_MEM:
@@ -3441,7 +3441,7 @@ aarch64_cannot_force_const_mem (machine_mode mode ATTRIBUTE_UNUSED, rtx x)
   split_const (x, &base, &offset);
   if (GET_CODE (base) == SYMBOL_REF || GET_CODE (base) == LABEL_REF)
     {
-      if (aarch64_classify_symbol (base, offset, SYMBOL_CONTEXT_ADR)
+      if (aarch64_classify_symbol (base, offset)
 	  != SYMBOL_FORCE_TO_MEM)
 	return true;
       else
@@ -3886,8 +3886,7 @@ aarch64_classify_address (struct aarch64_address_info *info,
 	  rtx sym, offs;
 	  split_const (info->offset, &sym, &offs);
 	  if (GET_CODE (sym) == SYMBOL_REF
-	      && (aarch64_classify_symbol (sym, offs, SYMBOL_CONTEXT_MEM)
-		  == SYMBOL_SMALL_ABSOLUTE))
+	      && (aarch64_classify_symbol (sym, offs) == SYMBOL_SMALL_ABSOLUTE))
 	    {
 	      /* The symbol and offset must be aligned to the access size.  */
 	      unsigned int align;
@@ -3933,17 +3932,15 @@ aarch64_symbolic_address_p (rtx x)
   return GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF;
 }

-/* Classify the base of symbolic expression X, given that X appears in
-   context CONTEXT.  */
+/* Classify the base of symbolic expression X.  */

 enum aarch64_symbol_type
-aarch64_classify_symbolic_expression (rtx x,
-				      enum aarch64_symbol_context context)
+aarch64_classify_symbolic_expression (rtx x)
 {
   rtx offset;

   split_const (x, &x, &offset);
-  return aarch64_classify_symbol (x, offset, context);
+  return aarch64_classify_symbol (x, offset);
 }


@@ -4631,7 +4628,7 @@ aarch64_print_operand (FILE *f, rtx x, char code)
       if (GET_CODE (x) == HIGH)
 	x = XEXP (x, 0);

-      switch (aarch64_classify_symbolic_expression (x, SYMBOL_CONTEXT_ADR))
+      switch (aarch64_classify_symbolic_expression (x))
 	{
 	case SYMBOL_SMALL_GOT_4G:
 	  asm_fprintf (asm_out_file, ":got:");
@@ -4666,7 +4663,7 @@ aarch64_print_operand (FILE *f, rtx x, char code)
       break;

     case 'L':
-      switch (aarch64_classify_symbolic_expression (x, SYMBOL_CONTEXT_ADR))
+      switch (aarch64_classify_symbolic_expression (x))
 	{
 	case SYMBOL_SMALL_GOT_4G:
 	  asm_fprintf (asm_out_file, ":lo12:");
@@ -4708,7 +4705,7 @@ aarch64_print_operand (FILE *f, rtx x, char code)

     case 'G':

-      switch (aarch64_classify_symbolic_expression (x, SYMBOL_CONTEXT_ADR))
+      switch (aarch64_classify_symbolic_expression (x))
 	{
 	case SYMBOL_TLSLE24:
 	  asm_fprintf (asm_out_file, ":tprel_hi12:");
@@ -8872,11 +8869,10 @@ aarch64_classify_tls_symbol (rtx x)
 }

 /* Return the method that should be used to access SYMBOL_REF or
-   LABEL_REF X in context CONTEXT.  */
+   LABEL_REF X.  */

 enum aarch64_symbol_type
-aarch64_classify_symbol (rtx x, rtx offset,
-			 enum aarch64_symbol_context context ATTRIBUTE_UNUSED)
+aarch64_classify_symbol (rtx x, rtx offset)
 {
   if (GET_CODE (x) == LABEL_REF)
     {
@@ -10294,9 +10290,7 @@ aarch64_simd_imm_scalar_p (rtx x, machine_mode mode ATTRIBUTE_UNUSED)
 }

 bool
-aarch64_mov_operand_p (rtx x,
-		       enum aarch64_symbol_context context,
-		       machine_mode mode)
+aarch64_mov_operand_p (rtx x, machine_mode mode)
 {
   if (GET_CODE (x) == HIGH
       && aarch64_valid_symref (XEXP (x, 0), GET_MODE (XEXP (x, 0))))
@@ -10308,7 +10302,7 @@ aarch64_mov_operand_p (rtx x,
   if (GET_CODE (x) == SYMBOL_REF && mode == DImode && CONSTANT_ADDRESS_P (x))
     return true;

-  return aarch64_classify_symbolic_expression (x, context)
+  return aarch64_classify_symbolic_expression (x)
     == SYMBOL_TINY_ABSOLUTE;
 }

diff --git a/gcc/config/aarch64/predicates.md b/gcc/config/aarch64/predicates.md
index 3979209..ee16dc8 100644
--- a/gcc/config/aarch64/predicates.md
+++ b/gcc/config/aarch64/predicates.md
@@ -165,7 +165,7 @@
 (define_predicate "aarch64_valid_symref"
   (match_code "const, symbol_ref, label_ref")
 {
-  return (aarch64_classify_symbolic_expression (op, SYMBOL_CONTEXT_ADR)
+  return (aarch64_classify_symbolic_expression (op)
 	  != SYMBOL_FORCE_TO_MEM);
 })

@@ -215,7 +215,7 @@
   (and (match_code "reg,subreg,mem,const,const_int,symbol_ref,label_ref,high")
        (ior (match_operand 0 "register_operand")
 	    (ior (match_operand 0 "memory_operand")
-		 (match_test "aarch64_mov_operand_p (op, SYMBOL_CONTEXT_ADR, mode)")))))
+		 (match_test "aarch64_mov_operand_p (op, mode)")))))

 (define_predicate "aarch64_movti_operand"
   (and (match_code "reg,subreg,mem,const_int")

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