]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
LoongArch: Increase cost of vector aligned store/load.
authorJiahao Xu <xujiahao@loongson.cn>
Thu, 16 Nov 2023 08:44:36 +0000 (16:44 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Fri, 17 Nov 2023 02:18:45 +0000 (10:18 +0800)
Based on SPEC2017 performance evaluation results, it's better to make them equal
to the cost of unaligned store/load so as to avoid odd alignment peeling.

gcc/ChangeLog:

* config/loongarch/loongarch.cc
(loongarch_builtin_vectorization_cost): Adjust.

gcc/config/loongarch/loongarch.cc

index 738911661d74ba0e0ac2a42ad832569d1bc2fc41..d05743bec874633deb5419c07605d1da22d9170c 100644 (file)
@@ -3893,11 +3893,9 @@ loongarch_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
       case scalar_stmt:
       case scalar_load:
       case vector_stmt:
-      case vector_load:
       case vec_to_scalar:
       case scalar_to_vec:
       case scalar_store:
-      case vector_store:
        return 1;
 
       case vec_promote_demote:
@@ -3905,6 +3903,8 @@ loongarch_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
        return LASX_SUPPORTED_MODE_P (mode)
          && !LSX_SUPPORTED_MODE_P (mode) ? 2 : 1;
 
+      case vector_load:
+      case vector_store:
       case unaligned_load:
       case unaligned_store:
        return 2;