Split X86_TUNE_AVX128_OPTIMAL into X86_TUNE_AVX256_SPLIT_REGS
authorHongtao Liu <hongtao.liu@intel.com>
Mon, 18 Nov 2019 02:22:55 +0000 (02:22 +0000)
committerHongtao Liu <liuhongt@gcc.gnu.org>
Mon, 18 Nov 2019 02:22:55 +0000 (02:22 +0000)
and X86_TUNE_AVX128_OPTIMAL.

Changelog
gcc/
PR target/92448
* config/i386/i386-expand.c (ix86_expand_set_or_cpymem):
Replace TARGET_AVX128_OPTIMAL with TARGET_AVX256_SPLIT_REGS.
* config/i386/i386-option.c (ix86_vec_cost): Ditto.
(ix86_reassociation_width): Ditto.
* config/i386/i386-options.c (ix86_option_override_internal):
Replace TARGET_AVX128_OPTIAML with
ix86_tune_features[X86_TUNE_AVX128_OPTIMAL]
* config/i386/i386.h (TARGET_AVX256_SPLIT_REGS): New macro.
(TARGET_AVX128_OPTIMAL): Deleted.
* config/i386/x86-tune.def (X86_TUNE_AVX256_SPLIT_REGS): New
DEF_TUNE.

From-SVN: r278385

gcc/ChangeLog
gcc/config/i386/i386-expand.c
gcc/config/i386/i386-options.c
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/i386/x86-tune.def

index 14fefbc3338810fe2a9c3b4937bbe2e9722f0a54..20eae0487b719495bf22ff4416f76f40c1dbf6f4 100644 (file)
@@ -1,3 +1,18 @@
+2019-11-18  Hongtao Liu  <hongtao.liu@intel.com>
+
+       PR target/92448
+       * config/i386/i386-expand.c (ix86_expand_set_or_cpymem):
+       Replace TARGET_AVX128_OPTIMAL with TARGET_AVX256_SPLIT_REGS.
+       * config/i386/i386-option.c (ix86_vec_cost): Ditto.
+       (ix86_reassociation_width): Ditto.
+       * config/i386/i386-options.c (ix86_option_override_internal):
+       Replace TARGET_AVX128_OPTIAML with
+       ix86_tune_features[X86_TUNE_AVX128_OPTIMAL]
+       * config/i386/i386.h (TARGET_AVX256_SPLIT_REGS): New macro.
+       (TARGET_AVX128_OPTIMAL): Deleted.
+       * config/i386/x86-tune.def (X86_TUNE_AVX256_SPLIT_REGS): New
+       DEF_TUNE.
+
 2019-11-16  Segher Boessenkool  <segher@kernel.crashing.org>
 
        * config/rs6000/rs6000.md (cceq_ior_compare): Rename to...
index dd31c57a529277634ac9d177d549f62a18a61933..1ff1153e105307d8094f05c49f8e79ac92748fd0 100644 (file)
@@ -7347,7 +7347,7 @@ ix86_expand_set_or_cpymem (rtx dst, rtx src, rtx count_exp, rtx val_exp,
             && optab_handler (mov_optab, wider_mode) != CODE_FOR_nothing)
        move_mode = wider_mode;
 
-      if (TARGET_AVX128_OPTIMAL && GET_MODE_BITSIZE (move_mode) > 128)
+      if (TARGET_AVX256_SPLIT_REGS && GET_MODE_BITSIZE (move_mode) > 128)
        move_mode = TImode;
 
       /* Find the corresponding vector mode with the same size as MOVE_MODE.
index 7470013437fcfc105a53bc510ab305d47c80ff0e..128511ecfe28a9a9f3ced3241bae009eb3c0e8bd 100644 (file)
@@ -2674,7 +2674,7 @@ ix86_option_override_internal (bool main_args_p,
 
   /* Enable 128-bit AVX instruction generation
      for the auto-vectorizer.  */
-  if (TARGET_AVX128_OPTIMAL
+  if (ix86_tune_features[X86_TUNE_AVX128_OPTIMAL]
       && (opts_set->x_prefer_vector_width_type == PVW_NONE))
     opts->x_prefer_vector_width_type = PVW_AVX128;
 
index bb5dc1441753ce39968d1142d5b8bf1d2fcf3a46..7115ec44c2a41c5a22bbdedc08dfadb5b8386e55 100644 (file)
@@ -18959,7 +18959,7 @@ ix86_vec_cost (machine_mode mode, int cost)
       && TARGET_SSE_SPLIT_REGS)
     return cost * 2;
   if (GET_MODE_BITSIZE (mode) > 128
-      && TARGET_AVX128_OPTIMAL)
+      && TARGET_AVX256_SPLIT_REGS)
     return cost * GET_MODE_BITSIZE (mode) / 128;
   return cost;
 }
@@ -21297,7 +21297,7 @@ ix86_reassociation_width (unsigned int op, machine_mode mode)
        return 1;
 
       /* Account for targets that splits wide vectors into multiple parts.  */
-      if (TARGET_AVX128_OPTIMAL && GET_MODE_BITSIZE (mode) > 128)
+      if (TARGET_AVX256_SPLIT_REGS && GET_MODE_BITSIZE (mode) > 128)
        div = GET_MODE_BITSIZE (mode) / 128;
       else if (TARGET_SSE_SPLIT_REGS && GET_MODE_BITSIZE (mode) > 64)
        div = GET_MODE_BITSIZE (mode) / 64;
index b042324cfd17e4ed9d86abef646351d905d5fd1d..108456b14d4c54d9059e9950c64be16426c11ffd 100644 (file)
@@ -578,8 +578,8 @@ extern unsigned char ix86_tune_features[X86_TUNE_LAST];
        ix86_tune_features[X86_TUNE_AVOID_LEA_FOR_ADDR]
 #define TARGET_SOFTWARE_PREFETCHING_BENEFICIAL \
        ix86_tune_features[X86_TUNE_SOFTWARE_PREFETCHING_BENEFICIAL]
-#define TARGET_AVX128_OPTIMAL \
-       ix86_tune_features[X86_TUNE_AVX128_OPTIMAL]
+#define TARGET_AVX256_SPLIT_REGS \
+       ix86_tune_features[X86_TUNE_AVX256_SPLIT_REGS]
 #define TARGET_GENERAL_REGS_SSE_SPILL \
        ix86_tune_features[X86_TUNE_GENERAL_REGS_SSE_SPILL]
 #define TARGET_AVOID_MEM_OPND_FOR_CMOVE \
index e289efdf2e0c34b856566807efd3a9625628d237..328535d38d78e5ac66b00311366b21c970a25651 100644 (file)
@@ -453,6 +453,10 @@ DEF_TUNE (X86_TUNE_AVX256_UNALIGNED_LOAD_OPTIMAL, "256_unaligned_load_optimal",
 DEF_TUNE (X86_TUNE_AVX256_UNALIGNED_STORE_OPTIMAL, "256_unaligned_store_optimal",
          ~(m_NEHALEM | m_SANDYBRIDGE | m_BDVER | m_ZNVER1 | m_GENERIC))
 
+/* X86_TUNE_AVX256_SPLIT_REGS: if true, AVX256 ops are split into two AVX128 ops.  */
+DEF_TUNE (X86_TUNE_AVX256_SPLIT_REGS, "avx256_split_regs",m_BDVER | m_BTVER2
+         | m_ZNVER1)
+
 /* X86_TUNE_AVX128_OPTIMAL: Enable 128-bit AVX instruction generation for
    the auto-vectorizer.  */
 DEF_TUNE (X86_TUNE_AVX128_OPTIMAL, "avx128_optimal", m_BDVER | m_BTVER2