From f6e0013a3c08b4a6a8d4dade8f842a2e4ae3f495 Mon Sep 17 00:00:00 2001
From: Wilco Dijkstra <wdijkstr@arm.com>
Date: Fri, 27 May 2016 12:15:47 +0000
Subject: [PATCH] Remove aarch64_cannot_change_mode_class as the underlying
 issue (PR67609) has been resolved.

Remove aarch64_cannot_change_mode_class as the underlying issue
(PR67609) has been resolved.  This avoids a few unnecessary lane
widening operations like:

faddp   d18, v18.2d
mov     d18, v18.d[0]

    gcc/
	PR67609
	* config/aarch64/aarch64.h (CANNOT_CHANGE_MODE_CLASS): Remove.
	* config/aarch64/aarch64.c
	(aarch64_cannot_change_mode_class): Remove function.
	* config/aarch64/aarch64-protos.h
	(aarch64_cannot_change_mode_class): Remove.

From-SVN: r236817
---
 gcc/ChangeLog                       |  9 +++++++++
 gcc/config/aarch64/aarch64-protos.h |  3 ---
 gcc/config/aarch64/aarch64.c        | 18 ------------------
 gcc/config/aarch64/aarch64.h        |  3 ---
 4 files changed, 9 insertions(+), 24 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index eb34a284658a..dd7328ba2764 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2016-05-27  Wilco Dijkstra  <wdijkstr@arm.com>
+
+	PR67609
+	* config/aarch64/aarch64.h (CANNOT_CHANGE_MODE_CLASS): Remove.
+	* config/aarch64/aarch64.c
+	(aarch64_cannot_change_mode_class): Remove function.
+	* config/aarch64/aarch64-protos.h
+	(aarch64_cannot_change_mode_class): Remove.
+
 2016-05-27  Jan Hubicka  <hubicka@ucw.cz>
 
 	* cfgloop.c (record_niter_bound): Record likely upper bounds.
diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h
index 6a8a85067385..1b20cf9da9ef 100644
--- a/gcc/config/aarch64/aarch64-protos.h
+++ b/gcc/config/aarch64/aarch64-protos.h
@@ -282,9 +282,6 @@ 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);
-bool aarch64_cannot_change_mode_class (machine_mode,
-				       machine_mode,
-				       enum reg_class);
 bool aarch64_const_vec_all_same_int_p (rtx, HOST_WIDE_INT);
 bool aarch64_constant_address_p (rtx);
 bool aarch64_expand_movmem (rtx *);
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 51d2d5096007..3f9034e3da07 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -12615,24 +12615,6 @@ aarch64_vectorize_vec_perm_const_ok (machine_mode vmode,
   return ret;
 }
 
-/* Implement target hook CANNOT_CHANGE_MODE_CLASS.  */
-bool
-aarch64_cannot_change_mode_class (machine_mode from,
-				  machine_mode to,
-				  enum reg_class rclass)
-{
-  /* We cannot allow word_mode subregs of full vector modes.
-     Otherwise the middle-end will assume it's ok to store to
-     (subreg:DI (reg:TI 100) 0) in order to modify only the low 64 bits
-     of the 128-bit register.  However, after reload the subreg will
-     be dropped leaving a plain DImode store.  See PR67609 for a more
-     detailed dicussion.  In all other cases, we want to be permissive
-     and return false.  */
-  return (reg_classes_intersect_p (FP_REGS, rclass)
-	  && GET_MODE_SIZE (to) == UNITS_PER_WORD
-	  && GET_MODE_SIZE (from) > UNITS_PER_WORD);
-}
-
 rtx
 aarch64_reverse_mask (enum machine_mode mode)
 {
diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
index fa941b6c9f13..b15c23f056d6 100644
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
@@ -832,9 +832,6 @@ typedef struct
   extern void  __aarch64_sync_cache_range (void *, void *);	\
   __aarch64_sync_cache_range (beg, end)
 
-#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS)	\
-  aarch64_cannot_change_mode_class (FROM, TO, CLASS)
-
 #define SHIFT_COUNT_TRUNCATED (!TARGET_SIMD)
 
 /* Choose appropriate mode for caller saves, so we do the minimum
-- 
GitLab