Compare commits
10 Commits
42df1a6543
...
29f6fff451
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29f6fff451 | ||
|
|
0f2a62f563 | ||
|
|
b510c7a5d0 | ||
|
|
06c250f7e5 | ||
|
|
7c4296a7f7 | ||
|
|
d6cb547233 | ||
|
|
b095a38ab2 | ||
|
|
4949f3fbbd | ||
|
|
0aeea23545 | ||
|
|
9884e7a3df |
@ -1,53 +1,34 @@
|
||||
diff -urpN a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
|
||||
--- a/gcc/config/aarch64/aarch64.c 2019-04-15 14:50:25.866378665 +0800
|
||||
+++ b/gcc/config/aarch64/aarch64.c 2019-04-15 14:49:21.986376983 +0800
|
||||
@@ -554,6 +554,31 @@ static const struct tune_params generic_
|
||||
(AARCH64_EXTRA_TUNE_NONE) /* tune_flags. */
|
||||
};
|
||||
From a29529542553e0c49cf1efe0808fc4a4733dc674 Mon Sep 17 00:00:00 2001
|
||||
From: xiezhiheng <xiezhiheng@huawei.com>
|
||||
Date: Wed, 22 Nov 2023 17:18:35 +0800
|
||||
Subject: [PATCH 2/4] [Backport][AArch64] Add tsv110 pipeline scheduling
|
||||
|
||||
Reference: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=8108dfde82ad6ec43613107b2c156999e6a5cbe7
|
||||
|
||||
Committed on behalf of Wu Yuan.
|
||||
---
|
||||
gcc/config/aarch64/aarch64-cores.def | 2 +-
|
||||
gcc/config/aarch64/aarch64.md | 1 +
|
||||
gcc/config/aarch64/tsv110.md | 708 +++++++++++++++++++++++++++
|
||||
3 files changed, 710 insertions(+), 1 deletion(-)
|
||||
create mode 100644 gcc/config/aarch64/tsv110.md
|
||||
|
||||
diff --git a/gcc/config/aarch64/aarch64-cores.def b/gcc/config/aarch64/aarch64-cores.def
|
||||
index ea7052388..6911f9704 100644
|
||||
--- a/gcc/config/aarch64/aarch64-cores.def
|
||||
+++ b/gcc/config/aarch64/aarch64-cores.def
|
||||
@@ -88,6 +88,6 @@ AARCH64_CORE("cortex-a73.cortex-a53", cortexa73cortexa53, cortexa53, 8A, AARCH
|
||||
/* V8.2 Architecture Processors. */
|
||||
|
||||
+static const struct tune_params tsv110_tunings =
|
||||
+{
|
||||
+ &cortexa57_extra_costs,
|
||||
+ &generic_addrcost_table,
|
||||
+ &generic_regmove_cost,
|
||||
+ &generic_vector_cost,
|
||||
+ &generic_branch_cost,
|
||||
+ &generic_approx_modes,
|
||||
+ 4, /* memmov_cost */
|
||||
+ 4, /* issue_rate */
|
||||
+ AARCH64_FUSE_NOTHING, /* fusible_ops */
|
||||
+ 16, /* function_align. */
|
||||
+ 16, /* jump_align. */
|
||||
+ 8, /* loop_align. */
|
||||
+ 2, /* int_reassoc_width. */
|
||||
+ 4, /* fp_reassoc_width. */
|
||||
+ 1, /* vec_reassoc_width. */
|
||||
+ 2, /* min_div_recip_mul_sf. */
|
||||
+ 2, /* min_div_recip_mul_df. */
|
||||
+ 0, /* max_case_values. */
|
||||
+ 0, /* cache_line_size. */
|
||||
+ tune_params::AUTOPREFETCHER_OFF, /* autoprefetcher_model. */
|
||||
+ (AARCH64_EXTRA_TUNE_NONE) /* tune_flags. */
|
||||
+};
|
||||
+
|
||||
static const struct tune_params cortexa35_tunings =
|
||||
{
|
||||
&cortexa53_extra_costs,
|
||||
diff -urpN a/gcc/config/aarch64/aarch64-cores.def b/gcc/config/aarch64/aarch64-cores.def
|
||||
--- a/gcc/config/aarch64/aarch64-cores.def 2017-02-15 08:09:28.845771000 +0800
|
||||
+++ b/gcc/config/aarch64/aarch64-cores.def 2019-04-15 14:49:21.986376983 +0800
|
||||
@@ -78,6 +78,8 @@ AARCH64_CORE("xgene1", xgene1, x
|
||||
AARCH64_CORE("thunderx2t99p1", thunderx2t99p1, thunderx2t99, 8_1A, AARCH64_FL_FOR_ARCH8_1 | AARCH64_FL_CRYPTO, thunderx2t99, 0x42, 0x516, -1)
|
||||
AARCH64_CORE("vulcan", vulcan, thunderx2t99, 8_1A, AARCH64_FL_FOR_ARCH8_1 | AARCH64_FL_CRYPTO, thunderx2t99, 0x42, 0x516, -1)
|
||||
/* HiSilicon ('H') cores. */
|
||||
-AARCH64_CORE("tsv110", tsv110, cortexa57, 8_2A, AARCH64_FL_FOR_ARCH8_2 | AARCH64_FL_CRYPTO | AARCH64_FL_F16, tsv110, 0x48, 0xd01, -1)
|
||||
+AARCH64_CORE("tsv110", tsv110, tsv110, 8_2A, AARCH64_FL_FOR_ARCH8_2 | AARCH64_FL_CRYPTO | AARCH64_FL_F16, tsv110, 0x48, 0xd01, -1)
|
||||
|
||||
+AARCH64_CORE("tsv110", tsv110, tsv110, 8A, AARCH64_FL_FOR_ARCH8 | AARCH64_FL_CRC, tsv110, 0x48, 0xd01, -1)
|
||||
+
|
||||
/* V8 big.LITTLE implementations. */
|
||||
|
||||
AARCH64_CORE("cortex-a57.cortex-a53", cortexa57cortexa53, cortexa53, 8A, AARCH64_FL_FOR_ARCH8 | AARCH64_FL_CRC, cortexa57, 0x41, AARCH64_BIG_LITTLE (0xd07, 0xd03), -1)
|
||||
diff -urpN a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
|
||||
--- a/gcc/config/aarch64/aarch64.md 2019-04-15 14:50:25.870378665 +0800
|
||||
+++ b/gcc/config/aarch64/aarch64.md 2019-04-15 14:49:21.986376983 +0800
|
||||
#undef AARCH64_CORE
|
||||
diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
|
||||
index 5b5c401f8..0d6ed8c5c 100644
|
||||
--- a/gcc/config/aarch64/aarch64.md
|
||||
+++ b/gcc/config/aarch64/aarch64.md
|
||||
@@ -226,6 +226,7 @@
|
||||
(include "thunderx.md")
|
||||
(include "../arm/xgene1.md")
|
||||
@ -56,19 +37,11 @@ diff -urpN a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
|
||||
|
||||
;; -------------------------------------------------------------------
|
||||
;; Jumps and other miscellaneous insns
|
||||
diff -urpN a/gcc/config/aarch64/aarch64-tune.md b/gcc/config/aarch64/aarch64-tune.md
|
||||
--- a/gcc/config/aarch64/aarch64-tune.md 2017-02-15 08:09:28.845771000 +0800
|
||||
+++ b/gcc/config/aarch64/aarch64-tune.md 2019-04-15 14:49:21.986376983 +0800
|
||||
@@ -1,5 +1,5 @@
|
||||
;; -*- buffer-read-only: t -*-
|
||||
;; Generated automatically by gentune.sh from aarch64-cores.def
|
||||
(define_attr "tune"
|
||||
- "cortexa35,cortexa53,cortexa57,cortexa72,cortexa73,exynosm1,falkor,qdf24xx,thunderx,thunderxt88p1,thunderxt88,thunderxt81,thunderxt83,thunderx2t99,xgene1,thunderx2t99p1,vulcan,cortexa57cortexa53,cortexa72cortexa53,cortexa73cortexa35,cortexa73cortexa53"
|
||||
+ "cortexa35,cortexa53,cortexa57,cortexa72,cortexa73,exynosm1,falkor,qdf24xx,thunderx,thunderxt88p1,thunderxt88,thunderxt81,thunderxt83,thunderx2t99,xgene1,tsv110,thunderx2t99p1,vulcan,cortexa57cortexa53,cortexa72cortexa53,cortexa73cortexa35,cortexa73cortexa53"
|
||||
(const (symbol_ref "((enum attr_tune) aarch64_tune)")))
|
||||
diff -urpN a/gcc/config/aarch64/tsv110.md b/gcc/config/aarch64/tsv110.md
|
||||
--- a/gcc/config/aarch64/tsv110.md 1970-01-01 08:00:00.000000000 +0800
|
||||
+++ b/gcc/config/aarch64/tsv110.md 2019-04-15 14:55:30.420081420 +0800
|
||||
diff --git a/gcc/config/aarch64/tsv110.md b/gcc/config/aarch64/tsv110.md
|
||||
new file mode 100644
|
||||
index 000000000..33fc72ab4
|
||||
--- /dev/null
|
||||
+++ b/gcc/config/aarch64/tsv110.md
|
||||
@@ -0,0 +1,708 @@
|
||||
+;; tsv110 pipeline description
|
||||
+;; Copyright (C) 2018 Free Software Foundation, Inc.
|
||||
@ -688,7 +661,7 @@ diff -urpN a/gcc/config/aarch64/tsv110.md b/gcc/config/aarch64/tsv110.md
|
||||
+
|
||||
+(define_insn_reservation "tsv110_fp_add_sub" 5
|
||||
+ (and (eq_attr "tune" "tsv110")
|
||||
+ (eq_attr "type" "fadds,faddd,fmuls,fmuld"))
|
||||
+ (eq_attr "type" "fadds,faddd,fmuls,fmuld"))
|
||||
+ "tsv110_fsu1|tsv110_fsu2")
|
||||
+
|
||||
+(define_insn_reservation "tsv110_fp_mac" 7
|
||||
@ -778,3 +751,6 @@ diff -urpN a/gcc/config/aarch64/tsv110.md b/gcc/config/aarch64/tsv110.md
|
||||
+;; help.
|
||||
+(define_bypass 1 "tsv110_*"
|
||||
+ "tsv110_call,tsv110_branch")
|
||||
--
|
||||
2.19.1
|
||||
|
||||
39
Backport-AArch64-Fix-longbranch-test.patch
Normal file
39
Backport-AArch64-Fix-longbranch-test.patch
Normal file
@ -0,0 +1,39 @@
|
||||
From 312e8086a6a1164e8f16aff68ca175f32b3185ee Mon Sep 17 00:00:00 2001
|
||||
From: xiezhiheng <xiezhiheng@huawei.com>
|
||||
Date: Sat, 25 Nov 2023 10:50:11 +0800
|
||||
Subject: [PATCH] [Backport][AArch64] Fix longbranch test
|
||||
|
||||
Reference: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=c7fd21762de653a19dabf837917a8ad6f9491bc0
|
||||
|
||||
Fix longbranch test so it still generates long tbz branches.
|
||||
---
|
||||
gcc/testsuite/gcc.target/aarch64/long_branch_1.c | 6 ++----
|
||||
1 file changed, 2 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/aarch64/long_branch_1.c b/gcc/testsuite/gcc.target/aarch64/long_branch_1.c
|
||||
index 46f500d36..49d8b6a22 100644
|
||||
--- a/gcc/testsuite/gcc.target/aarch64/long_branch_1.c
|
||||
+++ b/gcc/testsuite/gcc.target/aarch64/long_branch_1.c
|
||||
@@ -54,10 +54,6 @@ test_and_branch (int selector, int addend, int cond)
|
||||
{
|
||||
start0:
|
||||
return sum - 1;
|
||||
-start1:
|
||||
- return sum + 1;
|
||||
-start2:
|
||||
- return sum;
|
||||
start3:
|
||||
return sum - 2;
|
||||
}
|
||||
@@ -65,6 +61,8 @@ start3:
|
||||
{
|
||||
switch (selector)
|
||||
{
|
||||
+start1:
|
||||
+start2:
|
||||
CASE_ENTRY128 (1)
|
||||
CASE_ENTRY64 (129)
|
||||
CASE_ENTRY16 (193)
|
||||
--
|
||||
2.19.1
|
||||
|
||||
205
Backport-Learn-GIMPLE-pretty-printer-to-produce-nice.patch
Normal file
205
Backport-Learn-GIMPLE-pretty-printer-to-produce-nice.patch
Normal file
@ -0,0 +1,205 @@
|
||||
From d290efa0319b0327a6dc804a4b9ecad0e8b5a5bb Mon Sep 17 00:00:00 2001
|
||||
From: xiezhiheng <xiezhiheng@huawei.com>
|
||||
Date: Thu, 23 Nov 2023 11:01:45 +0800
|
||||
Subject: [PATCH 4/4] [Backport] Learn GIMPLE pretty printer to produce nicer
|
||||
dump output.
|
||||
|
||||
Reference: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5edb1c48f8e526a2b8f7f9d03fce9a7fdcb14b88
|
||||
|
||||
But we only port part of changes about attr-hotcold-2.c becasue
|
||||
the rest is irrelevant.
|
||||
|
||||
[Backport] Recover GOTO predictor.
|
||||
|
||||
Reference: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=7fef86d3486c9f4208a111a41a2cc66b7328b6d9
|
||||
---
|
||||
gcc/c/c-typeck.c | 1 +
|
||||
gcc/cp/constexpr.c | 1 +
|
||||
gcc/cp/pt.c | 2 ++
|
||||
gcc/cp/semantics.c | 2 ++
|
||||
gcc/gimplify.c | 4 +++-
|
||||
gcc/predict.def | 5 ++---
|
||||
gcc/testsuite/gcc.dg/predict-15.c | 17 +++++++++++++++++
|
||||
gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c | 13 ++++++-------
|
||||
gcc/testsuite/gcc.dg/tree-ssa/vrp24.c | 10 ++++------
|
||||
9 files changed, 38 insertions(+), 17 deletions(-)
|
||||
create mode 100644 gcc/testsuite/gcc.dg/predict-15.c
|
||||
|
||||
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
|
||||
index ee365313c..cf8463da7 100644
|
||||
--- a/gcc/c/c-typeck.c
|
||||
+++ b/gcc/c/c-typeck.c
|
||||
@@ -9816,6 +9816,7 @@ c_finish_goto_label (location_t loc, tree label)
|
||||
return NULL_TREE;
|
||||
TREE_USED (decl) = 1;
|
||||
{
|
||||
+ add_stmt (build_predict_expr (PRED_GOTO, NOT_TAKEN));
|
||||
tree t = build1 (GOTO_EXPR, void_type_node, decl);
|
||||
SET_EXPR_LOCATION (t, loc);
|
||||
return add_stmt (t);
|
||||
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
|
||||
index 9082230b9..adae14b4f 100644
|
||||
--- a/gcc/cp/constexpr.c
|
||||
+++ b/gcc/cp/constexpr.c
|
||||
@@ -5827,6 +5827,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict,
|
||||
|
||||
case CLEANUP_STMT:
|
||||
case EMPTY_CLASS_EXPR:
|
||||
+ case PREDICT_EXPR:
|
||||
return false;
|
||||
|
||||
case GOTO_EXPR:
|
||||
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
|
||||
index 5687bb212..b536a54af 100644
|
||||
--- a/gcc/cp/pt.c
|
||||
+++ b/gcc/cp/pt.c
|
||||
@@ -15161,6 +15161,8 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
|
||||
return tsubst_binary_left_fold (t, args, complain, in_decl);
|
||||
case BINARY_RIGHT_FOLD_EXPR:
|
||||
return tsubst_binary_right_fold (t, args, complain, in_decl);
|
||||
+ case PREDICT_EXPR:
|
||||
+ return t;
|
||||
|
||||
default:
|
||||
/* We shouldn't get here, but keep going if !flag_checking. */
|
||||
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
|
||||
index e06637646..840d193b9 100644
|
||||
--- a/gcc/cp/semantics.c
|
||||
+++ b/gcc/cp/semantics.c
|
||||
@@ -41,6 +41,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
#include "omp-general.h"
|
||||
#include "convert.h"
|
||||
#include "gomp-constants.h"
|
||||
+#include "predict.h"
|
||||
|
||||
/* There routines provide a modular interface to perform many parsing
|
||||
operations. They may therefore be used during actual parsing, or
|
||||
@@ -628,6 +629,7 @@ finish_goto_stmt (tree destination)
|
||||
|
||||
check_goto (destination);
|
||||
|
||||
+ add_stmt (build_predict_expr (PRED_GOTO, NOT_TAKEN));
|
||||
return add_stmt (build_stmt (input_location, GOTO_EXPR, destination));
|
||||
}
|
||||
|
||||
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
|
||||
index c6a06d014..dfc2fddd8 100644
|
||||
--- a/gcc/gimplify.c
|
||||
+++ b/gcc/gimplify.c
|
||||
@@ -2023,7 +2023,9 @@ should_warn_for_implicit_fallthrough (gimple_stmt_iterator *gsi_p, tree label)
|
||||
gsi = *gsi_p;
|
||||
|
||||
/* Skip all immediately following labels. */
|
||||
- while (!gsi_end_p (gsi) && gimple_code (gsi_stmt (gsi)) == GIMPLE_LABEL)
|
||||
+ while (!gsi_end_p (gsi)
|
||||
+ && (gimple_code (gsi_stmt (gsi)) == GIMPLE_LABEL
|
||||
+ || gimple_code (gsi_stmt (gsi)) == GIMPLE_PREDICT))
|
||||
gsi_next (&gsi);
|
||||
|
||||
/* { ... something; default:; } */
|
||||
diff --git a/gcc/predict.def b/gcc/predict.def
|
||||
index e96be12be..d7048e433 100644
|
||||
--- a/gcc/predict.def
|
||||
+++ b/gcc/predict.def
|
||||
@@ -141,9 +141,8 @@ DEF_PREDICTOR (PRED_RECURSIVE_CALL, "recursive call", HITRATE (75), 0)
|
||||
this from FE or retire the predictor. */
|
||||
DEF_PREDICTOR (PRED_TREE_EARLY_RETURN, "early return (on trees)", HITRATE (54), 0)
|
||||
|
||||
-/* Branch containing goto is probably not taken.
|
||||
- FIXME: Currently not used. */
|
||||
-DEF_PREDICTOR (PRED_GOTO, "goto", HITRATE (70), 0)
|
||||
+/* Branch containing goto is probably not taken. */
|
||||
+DEF_PREDICTOR (PRED_GOTO, "goto", HITRATE (66), 0)
|
||||
|
||||
/* Branch ending with return constant is probably not taken. */
|
||||
DEF_PREDICTOR (PRED_CONST_RETURN, "const return", HITRATE (69), 0)
|
||||
diff --git a/gcc/testsuite/gcc.dg/predict-15.c b/gcc/testsuite/gcc.dg/predict-15.c
|
||||
new file mode 100644
|
||||
index 000000000..2a8c3ea85
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.dg/predict-15.c
|
||||
@@ -0,0 +1,17 @@
|
||||
+/* { dg-do compile } */
|
||||
+/* { dg-options "-O2 -fdump-tree-profile_estimate" } */
|
||||
+
|
||||
+int main(int argc, char **argv)
|
||||
+{
|
||||
+ if (argc == 123)
|
||||
+ goto exit;
|
||||
+ else
|
||||
+ {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+exit:
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+/* { dg-final { scan-tree-dump "goto heuristics of edge" "profile_estimate"} } */
|
||||
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c b/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c
|
||||
index 184dd10dd..17526113d 100644
|
||||
--- a/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c
|
||||
+++ b/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c
|
||||
@@ -1,8 +1,7 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -fdump-tree-profile_estimate-blocks-details" } */
|
||||
+/* { dg-options "-O2 -fdump-tree-profile_estimate" } */
|
||||
|
||||
-void g(void);
|
||||
-void h(void);
|
||||
+int v1, v2;
|
||||
void f(int x, int y)
|
||||
{
|
||||
if (x) goto A;
|
||||
@@ -10,19 +9,19 @@ void f(int x, int y)
|
||||
return;
|
||||
|
||||
A: __attribute__((cold))
|
||||
- g();
|
||||
+ v1 = x;
|
||||
return;
|
||||
|
||||
B: __attribute__((hot))
|
||||
- h();
|
||||
+ v2 = y;
|
||||
return;
|
||||
}
|
||||
|
||||
/* { dg-final { scan-tree-dump-times "hot label heuristics" 1 "profile_estimate" } } */
|
||||
/* { dg-final { scan-tree-dump-times "cold label heuristics" 1 "profile_estimate" } } */
|
||||
-/* { dg-final { scan-tree-dump "A \\\[0\\\..*\\\]" "profile_estimate" } } */
|
||||
+/* { dg-final { scan-tree-dump-times "combined heuristics: 0\\\..*" 1 "profile_estimate" } } */
|
||||
|
||||
/* Note: we're attempting to match some number > 6000, i.e. > 60%.
|
||||
The exact number ought to be tweekable without having to juggle
|
||||
the testcase around too much. */
|
||||
-/* { dg-final { scan-tree-dump "B \\\[\[6-9\]\[0-9\]\\\..*\\\]" "profile_estimate" } } */
|
||||
+/* { dg-final { scan-tree-dump-times "combined heuristics: \[6-9\]\[0-9\]\\\..*" 1 "profile_estimate" } } */
|
||||
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp24.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp24.c
|
||||
index 853ee21bb..ed49e25f8 100644
|
||||
--- a/gcc/testsuite/gcc.dg/tree-ssa/vrp24.c
|
||||
+++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp24.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -fno-tree-forwprop -fdump-tree-vrp1-details" } */
|
||||
+/* { dg-options "-O2 -fno-tree-forwprop -fdump-tree-vrp1-details -fdump-tree-optimized" } */
|
||||
|
||||
|
||||
struct rtx_def;
|
||||
@@ -86,10 +86,8 @@ L7:
|
||||
|
||||
/* The first n_sets > 0 test can be simplfiied into n_sets == 1 since
|
||||
n_sets can only have the values [0, 1] as it's the result of a
|
||||
- boolean operation.
|
||||
+ boolean operation. */
|
||||
|
||||
- The second n_sets > 0 test can also be simplified into n_sets == 1
|
||||
- as the only way to reach the tests is when n_sets <= 1 and the only
|
||||
- value which satisfies both conditions is n_sets == 1. */
|
||||
-/* { dg-final { scan-tree-dump-times "Simplified relational" 2 "vrp1" } } */
|
||||
+/* { dg-final { scan-tree-dump-times "Simplified relational" 1 "vrp1" } } */
|
||||
+/* { dg-final { scan-tree-dump-times "if " 4 "optimized" } } */
|
||||
|
||||
--
|
||||
2.19.1
|
||||
|
||||
90
Backport-Rework-cold-and-hot-label-attributes-in-pre.patch
Normal file
90
Backport-Rework-cold-and-hot-label-attributes-in-pre.patch
Normal file
@ -0,0 +1,90 @@
|
||||
From 96b5d381d4a670fd3f2fed4ca73ded601ec779e9 Mon Sep 17 00:00:00 2001
|
||||
From: xiezhiheng <xiezhiheng@huawei.com>
|
||||
Date: Fri, 24 Nov 2023 15:47:33 +0800
|
||||
Subject: [PATCH 3/4] [Backport] Rework cold and hot label attributes in
|
||||
predict.c.
|
||||
|
||||
Reference: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=93c18375823fdd0e384f673f75e39136719135dd
|
||||
---
|
||||
gcc/gimplify.c | 10 +++++++-
|
||||
gcc/predict.c | 23 -------------------
|
||||
.../gcc.dg/tree-ssa/attr-hotcold-2.c | 4 ++--
|
||||
3 files changed, 11 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
|
||||
index 5264a4f3d..c6a06d014 100644
|
||||
--- a/gcc/gimplify.c
|
||||
+++ b/gcc/gimplify.c
|
||||
@@ -2340,10 +2340,18 @@ gimplify_label_expr (tree *expr_p, gimple_seq *pre_p)
|
||||
gcc_assert (decl_function_context (LABEL_EXPR_LABEL (*expr_p))
|
||||
== current_function_decl);
|
||||
|
||||
- glabel *label_stmt = gimple_build_label (LABEL_EXPR_LABEL (*expr_p));
|
||||
+ tree label = LABEL_EXPR_LABEL (*expr_p);
|
||||
+ glabel *label_stmt = gimple_build_label (label);
|
||||
gimple_set_location (label_stmt, EXPR_LOCATION (*expr_p));
|
||||
gimplify_seq_add_stmt (pre_p, label_stmt);
|
||||
|
||||
+ if (lookup_attribute ("cold", DECL_ATTRIBUTES (label)))
|
||||
+ gimple_seq_add_stmt (pre_p, gimple_build_predict (PRED_COLD_LABEL,
|
||||
+ NOT_TAKEN));
|
||||
+ else if (lookup_attribute ("hot", DECL_ATTRIBUTES (label)))
|
||||
+ gimple_seq_add_stmt (pre_p, gimple_build_predict (PRED_HOT_LABEL,
|
||||
+ TAKEN));
|
||||
+
|
||||
return GS_ALL_DONE;
|
||||
}
|
||||
|
||||
diff --git a/gcc/predict.c b/gcc/predict.c
|
||||
index fa4e626fa..d68fb17ba 100644
|
||||
--- a/gcc/predict.c
|
||||
+++ b/gcc/predict.c
|
||||
@@ -2701,29 +2701,6 @@ tree_estimate_probability_bb (basic_block bb)
|
||||
|
||||
FOR_EACH_EDGE (e, ei, bb->succs)
|
||||
{
|
||||
- /* Predict edges to user labels with attributes. */
|
||||
- if (e->dest != EXIT_BLOCK_PTR_FOR_FN (cfun))
|
||||
- {
|
||||
- gimple_stmt_iterator gi;
|
||||
- for (gi = gsi_start_bb (e->dest); !gsi_end_p (gi); gsi_next (&gi))
|
||||
- {
|
||||
- glabel *label_stmt = dyn_cast <glabel *> (gsi_stmt (gi));
|
||||
- tree decl;
|
||||
-
|
||||
- if (!label_stmt)
|
||||
- break;
|
||||
- decl = gimple_label_label (label_stmt);
|
||||
- if (DECL_ARTIFICIAL (decl))
|
||||
- continue;
|
||||
-
|
||||
- /* Finally, we have a user-defined label. */
|
||||
- if (lookup_attribute ("cold", DECL_ATTRIBUTES (decl)))
|
||||
- predict_edge_def (e, PRED_COLD_LABEL, NOT_TAKEN);
|
||||
- else if (lookup_attribute ("hot", DECL_ATTRIBUTES (decl)))
|
||||
- predict_edge_def (e, PRED_HOT_LABEL, TAKEN);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
/* Predict early returns to be probable, as we've already taken
|
||||
care for error returns and other cases are often used for
|
||||
fast paths through function.
|
||||
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c b/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c
|
||||
index 13d2916c4..184dd10dd 100644
|
||||
--- a/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c
|
||||
+++ b/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c
|
||||
@@ -20,9 +20,9 @@ void f(int x, int y)
|
||||
|
||||
/* { dg-final { scan-tree-dump-times "hot label heuristics" 1 "profile_estimate" } } */
|
||||
/* { dg-final { scan-tree-dump-times "cold label heuristics" 1 "profile_estimate" } } */
|
||||
-/* { dg-final { scan-tree-dump-times "block 4, loop depth 0, count 0, freq \[1-4\]\[^0-9\]" 3 "profile_estimate" } } */
|
||||
+/* { dg-final { scan-tree-dump "A \\\[0\\\..*\\\]" "profile_estimate" } } */
|
||||
|
||||
/* Note: we're attempting to match some number > 6000, i.e. > 60%.
|
||||
The exact number ought to be tweekable without having to juggle
|
||||
the testcase around too much. */
|
||||
-/* { dg-final { scan-tree-dump-times "block 5, loop depth 0, count 0, freq \[6-9\]\[0-9\]\[0-9\]\[0-9\]" 3 "profile_estimate" } } */
|
||||
+/* { dg-final { scan-tree-dump "B \\\[\[6-9\]\[0-9\]\\\..*\\\]" "profile_estimate" } } */
|
||||
--
|
||||
2.19.1
|
||||
|
||||
281
Backport-aarch64-Add-HiSilicon-tsv110-CPU-support.patch
Normal file
281
Backport-aarch64-Add-HiSilicon-tsv110-CPU-support.patch
Normal file
@ -0,0 +1,281 @@
|
||||
From a9c1a43518391483789e3b036b1d7242b7576c4e Mon Sep 17 00:00:00 2001
|
||||
From: xiezhiheng <xiezhiheng@huawei.com>
|
||||
Date: Wed, 22 Nov 2023 16:46:58 +0800
|
||||
Subject: [PATCH 1/4] [Backport][aarch64] Add HiSilicon tsv110 CPU support
|
||||
|
||||
Reference: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=910f72e78fe76993b8a9bcc9e385a788446f1f10
|
||||
|
||||
This patch adds HiSilicon's an mcpu: tsv110, which supports v8_4A.
|
||||
It has been tested on aarch64 and no regressions from this patch.
|
||||
|
||||
[aarch64] Correct architecture for tsv110.
|
||||
|
||||
Reference: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5a8d95cc43f3ff425fa58bf4025a8527320fb46c
|
||||
|
||||
For HiSilicon's tsv110 cpu core, it supports some v8_4A features, but
|
||||
some mandatory features are not implemented.
|
||||
---
|
||||
gcc/config/aarch64/aarch64-cores.def | 5 ++
|
||||
gcc/config/aarch64/aarch64-cost-tables.h | 104 +++++++++++++++++++++++
|
||||
gcc/config/aarch64/aarch64-tune.md | 2 +-
|
||||
gcc/config/aarch64/aarch64.c | 71 ++++++++++++++++
|
||||
gcc/doc/invoke.texi | 2 +-
|
||||
5 files changed, 182 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/aarch64/aarch64-cores.def b/gcc/config/aarch64/aarch64-cores.def
|
||||
index 92b57cffb..ea7052388 100644
|
||||
--- a/gcc/config/aarch64/aarch64-cores.def
|
||||
+++ b/gcc/config/aarch64/aarch64-cores.def
|
||||
@@ -85,4 +85,9 @@ AARCH64_CORE("cortex-a72.cortex-a53", cortexa72cortexa53, cortexa53, 8A, AARCH
|
||||
AARCH64_CORE("cortex-a73.cortex-a35", cortexa73cortexa35, cortexa53, 8A, AARCH64_FL_FOR_ARCH8 | AARCH64_FL_CRC, cortexa73, 0x41, AARCH64_BIG_LITTLE (0xd09, 0xd04), -1)
|
||||
AARCH64_CORE("cortex-a73.cortex-a53", cortexa73cortexa53, cortexa53, 8A, AARCH64_FL_FOR_ARCH8 | AARCH64_FL_CRC, cortexa73, 0x41, AARCH64_BIG_LITTLE (0xd09, 0xd03), -1)
|
||||
|
||||
+/* V8.2 Architecture Processors. */
|
||||
+
|
||||
+/* HiSilicon ('H') cores. */
|
||||
+AARCH64_CORE("tsv110", tsv110, cortexa57, 8_2A, AARCH64_FL_FOR_ARCH8_2 | AARCH64_FL_CRYPTO | AARCH64_FL_F16, tsv110, 0x48, 0xd01, -1)
|
||||
+
|
||||
#undef AARCH64_CORE
|
||||
diff --git a/gcc/config/aarch64/aarch64-cost-tables.h b/gcc/config/aarch64/aarch64-cost-tables.h
|
||||
index 070c083be..4595c5e71 100644
|
||||
--- a/gcc/config/aarch64/aarch64-cost-tables.h
|
||||
+++ b/gcc/config/aarch64/aarch64-cost-tables.h
|
||||
@@ -334,4 +334,108 @@ const struct cpu_cost_table thunderx2t99_extra_costs =
|
||||
}
|
||||
};
|
||||
|
||||
+const struct cpu_cost_table tsv110_extra_costs =
|
||||
+{
|
||||
+ /* ALU */
|
||||
+ {
|
||||
+ 0, /* arith. */
|
||||
+ 0, /* logical. */
|
||||
+ 0, /* shift. */
|
||||
+ 0, /* shift_reg. */
|
||||
+ COSTS_N_INSNS (1), /* arith_shift. */
|
||||
+ COSTS_N_INSNS (1), /* arith_shift_reg. */
|
||||
+ COSTS_N_INSNS (1), /* log_shift. */
|
||||
+ COSTS_N_INSNS (1), /* log_shift_reg. */
|
||||
+ 0, /* extend. */
|
||||
+ COSTS_N_INSNS (1), /* extend_arith. */
|
||||
+ 0, /* bfi. */
|
||||
+ 0, /* bfx. */
|
||||
+ 0, /* clz. */
|
||||
+ 0, /* rev. */
|
||||
+ 0, /* non_exec. */
|
||||
+ true /* non_exec_costs_exec. */
|
||||
+ },
|
||||
+
|
||||
+ {
|
||||
+ /* MULT SImode */
|
||||
+ {
|
||||
+ COSTS_N_INSNS (2), /* simple. */
|
||||
+ COSTS_N_INSNS (2), /* flag_setting. */
|
||||
+ COSTS_N_INSNS (2), /* extend. */
|
||||
+ COSTS_N_INSNS (2), /* add. */
|
||||
+ COSTS_N_INSNS (2), /* extend_add. */
|
||||
+ COSTS_N_INSNS (11) /* idiv. */
|
||||
+ },
|
||||
+ /* MULT DImode */
|
||||
+ {
|
||||
+ COSTS_N_INSNS (3), /* simple. */
|
||||
+ 0, /* flag_setting (N/A). */
|
||||
+ COSTS_N_INSNS (3), /* extend. */
|
||||
+ COSTS_N_INSNS (3), /* add. */
|
||||
+ COSTS_N_INSNS (3), /* extend_add. */
|
||||
+ COSTS_N_INSNS (19) /* idiv. */
|
||||
+ }
|
||||
+ },
|
||||
+ /* LD/ST */
|
||||
+ {
|
||||
+ COSTS_N_INSNS (3), /* load. */
|
||||
+ COSTS_N_INSNS (4), /* load_sign_extend. */
|
||||
+ COSTS_N_INSNS (3), /* ldrd. */
|
||||
+ COSTS_N_INSNS (3), /* ldm_1st. */
|
||||
+ 1, /* ldm_regs_per_insn_1st. */
|
||||
+ 2, /* ldm_regs_per_insn_subsequent. */
|
||||
+ COSTS_N_INSNS (4), /* loadf. */
|
||||
+ COSTS_N_INSNS (4), /* loadd. */
|
||||
+ COSTS_N_INSNS (4), /* load_unaligned. */
|
||||
+ 0, /* store. */
|
||||
+ 0, /* strd. */
|
||||
+ 0, /* stm_1st. */
|
||||
+ 1, /* stm_regs_per_insn_1st. */
|
||||
+ 2, /* stm_regs_per_insn_subsequent. */
|
||||
+ 0, /* storef. */
|
||||
+ 0, /* stored. */
|
||||
+ COSTS_N_INSNS (1), /* store_unaligned. */
|
||||
+ COSTS_N_INSNS (4), /* loadv. */
|
||||
+ COSTS_N_INSNS (4) /* storev. */
|
||||
+ },
|
||||
+ {
|
||||
+ /* FP SFmode */
|
||||
+ {
|
||||
+ COSTS_N_INSNS (10), /* div. */
|
||||
+ COSTS_N_INSNS (4), /* mult. */
|
||||
+ COSTS_N_INSNS (4), /* mult_addsub. */
|
||||
+ COSTS_N_INSNS (4), /* fma. */
|
||||
+ COSTS_N_INSNS (4), /* addsub. */
|
||||
+ COSTS_N_INSNS (1), /* fpconst. */
|
||||
+ COSTS_N_INSNS (1), /* neg. */
|
||||
+ COSTS_N_INSNS (1), /* compare. */
|
||||
+ COSTS_N_INSNS (2), /* widen. */
|
||||
+ COSTS_N_INSNS (2), /* narrow. */
|
||||
+ COSTS_N_INSNS (2), /* toint. */
|
||||
+ COSTS_N_INSNS (1), /* fromint. */
|
||||
+ COSTS_N_INSNS (2) /* roundint. */
|
||||
+ },
|
||||
+ /* FP DFmode */
|
||||
+ {
|
||||
+ COSTS_N_INSNS (17), /* div. */
|
||||
+ COSTS_N_INSNS (4), /* mult. */
|
||||
+ COSTS_N_INSNS (6), /* mult_addsub. */
|
||||
+ COSTS_N_INSNS (6), /* fma. */
|
||||
+ COSTS_N_INSNS (3), /* addsub. */
|
||||
+ COSTS_N_INSNS (1), /* fpconst. */
|
||||
+ COSTS_N_INSNS (1), /* neg. */
|
||||
+ COSTS_N_INSNS (1), /* compare. */
|
||||
+ COSTS_N_INSNS (2), /* widen. */
|
||||
+ COSTS_N_INSNS (2), /* narrow. */
|
||||
+ COSTS_N_INSNS (2), /* toint. */
|
||||
+ COSTS_N_INSNS (1), /* fromint. */
|
||||
+ COSTS_N_INSNS (2) /* roundint. */
|
||||
+ }
|
||||
+ },
|
||||
+ /* Vector */
|
||||
+ {
|
||||
+ COSTS_N_INSNS (1) /* alu. */
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
#endif
|
||||
diff --git a/gcc/config/aarch64/aarch64-tune.md b/gcc/config/aarch64/aarch64-tune.md
|
||||
index c948846af..4231e56ec 100644
|
||||
--- a/gcc/config/aarch64/aarch64-tune.md
|
||||
+++ b/gcc/config/aarch64/aarch64-tune.md
|
||||
@@ -1,5 +1,5 @@
|
||||
;; -*- buffer-read-only: t -*-
|
||||
;; Generated automatically by gentune.sh from aarch64-cores.def
|
||||
(define_attr "tune"
|
||||
- "cortexa35,cortexa53,cortexa57,cortexa72,cortexa73,exynosm1,falkor,qdf24xx,thunderx,thunderxt88p1,thunderxt88,thunderxt81,thunderxt83,thunderx2t99,xgene1,thunderx2t99p1,vulcan,cortexa57cortexa53,cortexa72cortexa53,cortexa73cortexa35,cortexa73cortexa53"
|
||||
+ "cortexa35,cortexa53,cortexa57,cortexa72,cortexa73,exynosm1,falkor,qdf24xx,thunderx,thunderxt88p1,thunderxt88,thunderxt81,thunderxt83,thunderx2t99,xgene1,thunderx2t99p1,vulcan,cortexa57cortexa53,cortexa72cortexa53,cortexa73cortexa35,cortexa73cortexa53,tsv110"
|
||||
(const (symbol_ref "((enum attr_tune) aarch64_tune)")))
|
||||
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
|
||||
index 22e76e083..58e91ecce 100644
|
||||
--- a/gcc/config/aarch64/aarch64.c
|
||||
+++ b/gcc/config/aarch64/aarch64.c
|
||||
@@ -254,6 +254,22 @@ static const struct cpu_addrcost_table xgene1_addrcost_table =
|
||||
0, /* imm_offset */
|
||||
};
|
||||
|
||||
+static const struct cpu_addrcost_table tsv110_addrcost_table =
|
||||
+{
|
||||
+ {
|
||||
+ 1, /* hi */
|
||||
+ 0, /* si */
|
||||
+ 0, /* di */
|
||||
+ 1, /* ti */
|
||||
+ },
|
||||
+ 0, /* pre_modify */
|
||||
+ 0, /* post_modify */
|
||||
+ 0, /* register_offset */
|
||||
+ 1, /* register_sextend */
|
||||
+ 1, /* register_zextend */
|
||||
+ 0, /* imm_offset */
|
||||
+};
|
||||
+
|
||||
static const struct cpu_addrcost_table qdf24xx_addrcost_table =
|
||||
{
|
||||
{
|
||||
@@ -362,6 +378,16 @@ static const struct cpu_regmove_cost thunderx2t99_regmove_cost =
|
||||
4 /* FP2FP */
|
||||
};
|
||||
|
||||
+static const struct cpu_regmove_cost tsv110_regmove_cost =
|
||||
+{
|
||||
+ 1, /* GP2GP */
|
||||
+ /* Avoid the use of slow int<->fp moves for spilling by setting
|
||||
+ their cost higher than memmov_cost. */
|
||||
+ 2, /* GP2FP */
|
||||
+ 3, /* FP2GP */
|
||||
+ 2 /* FP2FP */
|
||||
+};
|
||||
+
|
||||
/* Generic costs for vector insn classes. */
|
||||
static const struct cpu_vector_cost generic_vector_cost =
|
||||
{
|
||||
@@ -402,6 +428,25 @@ static const struct cpu_vector_cost thunderx_vector_cost =
|
||||
3 /* cond_not_taken_branch_cost */
|
||||
};
|
||||
|
||||
+static const struct cpu_vector_cost tsv110_vector_cost =
|
||||
+{
|
||||
+ 1, /* scalar_int_stmt_cost */
|
||||
+ 1, /* scalar_fp_stmt_cost */
|
||||
+ 5, /* scalar_load_cost */
|
||||
+ 1, /* scalar_store_cost */
|
||||
+ 2, /* vec_int_stmt_cost */
|
||||
+ 2, /* vec_fp_stmt_cost */
|
||||
+ 2, /* vec_permute_cost */
|
||||
+ 3, /* vec_to_scalar_cost */
|
||||
+ 2, /* scalar_to_vec_cost */
|
||||
+ 5, /* vec_align_load_cost */
|
||||
+ 5, /* vec_unalign_load_cost */
|
||||
+ 1, /* vec_unalign_store_cost */
|
||||
+ 1, /* vec_store_cost */
|
||||
+ 1, /* cond_taken_branch_cost */
|
||||
+ 1 /* cond_not_taken_branch_cost */
|
||||
+};
|
||||
+
|
||||
/* Generic costs for vector insn classes. */
|
||||
static const struct cpu_vector_cost cortexa57_vector_cost =
|
||||
{
|
||||
@@ -731,6 +776,32 @@ static const struct tune_params thunderx_tunings =
|
||||
(AARCH64_EXTRA_TUNE_SLOW_UNALIGNED_LDPW) /* tune_flags. */
|
||||
};
|
||||
|
||||
+static const struct tune_params tsv110_tunings =
|
||||
+{
|
||||
+ &tsv110_extra_costs,
|
||||
+ &tsv110_addrcost_table,
|
||||
+ &tsv110_regmove_cost,
|
||||
+ &tsv110_vector_cost,
|
||||
+ &generic_branch_cost,
|
||||
+ &generic_approx_modes,
|
||||
+ 4, /* memmov_cost */
|
||||
+ 4, /* issue_rate */
|
||||
+ (AARCH64_FUSE_AES_AESMC
|
||||
+ | AARCH64_FUSE_CMP_BRANCH), /* fusible_ops */
|
||||
+ 16, /* function_align. */
|
||||
+ 4, /* jump_align. */
|
||||
+ 8, /* loop_align. */
|
||||
+ 2, /* int_reassoc_width. */
|
||||
+ 4, /* fp_reassoc_width. */
|
||||
+ 1, /* vec_reassoc_width. */
|
||||
+ 2, /* min_div_recip_mul_sf. */
|
||||
+ 2, /* min_div_recip_mul_df. */
|
||||
+ 0, /* max_case_values. */
|
||||
+ 0, /* cache_line_size. */
|
||||
+ tune_params::AUTOPREFETCHER_WEAK, /* autoprefetcher_model. */
|
||||
+ (AARCH64_EXTRA_TUNE_NONE) /* tune_flags. */
|
||||
+};
|
||||
+
|
||||
static const struct tune_params xgene1_tunings =
|
||||
{
|
||||
&xgene1_extra_costs,
|
||||
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
||||
index 808ebe57f..430c0d5db 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -14028,7 +14028,7 @@ performance of the code. Permissible values for this option are:
|
||||
@samp{generic}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a57},
|
||||
@samp{cortex-a72}, @samp{cortex-a73}, @samp{exynos-m1}, @samp{falkor},
|
||||
@samp{qdf24xx}, @samp{xgene1}, @samp{vulcan}, @samp{thunderx},
|
||||
-@samp{thunderxt88}, @samp{thunderxt88p1}, @samp{thunderxt81},
|
||||
+@samp{thunderxt88}, @samp{thunderxt88p1}, @samp{thunderxt81}, @samp{tsv110},
|
||||
@samp{thunderxt83}, @samp{thunderx2t99}, @samp{cortex-a57.cortex-a53},
|
||||
@samp{cortex-a72.cortex-a53}, @samp{cortex-a73.cortex-a35},
|
||||
@samp{cortex-a73.cortex-a53}, @samp{native}.
|
||||
--
|
||||
2.19.1
|
||||
|
||||
72
Backport-fix-contexpr-list-initialized-member.patch
Normal file
72
Backport-fix-contexpr-list-initialized-member.patch
Normal file
@ -0,0 +1,72 @@
|
||||
From fceecb5f37d65944c822bd172cde89e670669d49 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Merrill <jason@redhat.com>
|
||||
Date: Mon, 29 Jan 2018 15:58:36 -0500
|
||||
Subject: [PATCH] PR c++/82461 - constexpr list-initialized member
|
||||
|
||||
* constexpr.c (potential_constant_expression_1): Check
|
||||
TARGET_EXPR_DIRECT_INIT_P.
|
||||
|
||||
From-SVN: r257164
|
||||
---
|
||||
gcc/cp/ChangeLog | 5 +++++
|
||||
gcc/cp/constexpr.c | 3 ++-
|
||||
gcc/testsuite/g++.dg/cpp0x/constexpr-list2.C | 20 ++++++++++++++++++++
|
||||
3 files changed, 27 insertions(+), 1 deletion(-)
|
||||
create mode 100644 gcc/testsuite/g++.dg/cpp0x/constexpr-list2.C
|
||||
|
||||
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
|
||||
index 6aa0075b5..801d8cee3 100644
|
||||
--- a/gcc/cp/ChangeLog
|
||||
+++ b/gcc/cp/ChangeLog
|
||||
@@ -1,3 +1,8 @@
|
||||
+2018-01-29 Jason Merrill <jason@redhat.com>
|
||||
+ PR c++/82461 - constexpr list-initialized member
|
||||
+ * constexpr.c (potential_constant_expression_1): Check
|
||||
+ TARGET_EXPR_DIRECT_INIT_P.
|
||||
+
|
||||
2018-02-15 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/83227 - C++17 ICE with init-list derived-to-base conversion.
|
||||
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
|
||||
index 9082230b9..0d294ca49 100644
|
||||
--- a/gcc/cp/constexpr.c
|
||||
+++ b/gcc/cp/constexpr.c
|
||||
@@ -5627,7 +5627,8 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict,
|
||||
return RECUR (TREE_OPERAND (t, 1), want_rval);
|
||||
|
||||
case TARGET_EXPR:
|
||||
- if (!literal_type_p (TREE_TYPE (t)))
|
||||
+ if (!TARGET_EXPR_DIRECT_INIT_P (t)
|
||||
+ && !literal_type_p (TREE_TYPE (t)))
|
||||
{
|
||||
if (flags & tf_error)
|
||||
{
|
||||
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-list2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-list2.C
|
||||
new file mode 100644
|
||||
index 000000000..780a64dbb
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-list2.C
|
||||
@@ -0,0 +1,20 @@
|
||||
+// PR c++/82461
|
||||
+// { dg-do compile { target c++11 } }
|
||||
+
|
||||
+class A {
|
||||
+private:
|
||||
+public:
|
||||
+ constexpr A() {}
|
||||
+ ~A() {}
|
||||
+};
|
||||
+
|
||||
+class B {
|
||||
+private:
|
||||
+ A a;
|
||||
+public:
|
||||
+ constexpr B() : a{} {}
|
||||
+// works
|
||||
+// constexpr B() : a() {}
|
||||
+
|
||||
+ ~B() {}
|
||||
+};
|
||||
--
|
||||
2.27.0
|
||||
|
||||
70
Backport-re-PR-tree-optimization-84552-Compile-time-.patch
Normal file
70
Backport-re-PR-tree-optimization-84552-Compile-time-.patch
Normal file
@ -0,0 +1,70 @@
|
||||
From e0e3ff695ab4f56d3a69e42303a9af13a23fcc15 Mon Sep 17 00:00:00 2001
|
||||
From: xiezhiheng <xiezhiheng@huawei.com>
|
||||
Date: Tue, 5 Dec 2023 14:25:14 +0800
|
||||
Subject: [PATCH] [Backport] re PR tree-optimization/84552 (Compile time hog w/
|
||||
-O2 -floop-nest-optimize -fno-tree-copy-prop -fno-tree-fre
|
||||
-fno-tree-loop-ivcanon)
|
||||
|
||||
Reference: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=24545562ca5ece2615f8178ad6c6eb0be4fe6b3f
|
||||
---
|
||||
gcc/testsuite/gcc.dg/graphite/pr84552.c | 23 +++++++++++++++++++++++
|
||||
gcc/tree-scalar-evolution.c | 6 +++++-
|
||||
2 files changed, 28 insertions(+), 1 deletion(-)
|
||||
create mode 100644 gcc/testsuite/gcc.dg/graphite/pr84552.c
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.dg/graphite/pr84552.c b/gcc/testsuite/gcc.dg/graphite/pr84552.c
|
||||
new file mode 100644
|
||||
index 000000000..15cbb0848
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.dg/graphite/pr84552.c
|
||||
@@ -0,0 +1,23 @@
|
||||
+/* { dg-do compile } */
|
||||
+/* { dg-options "-O2 -floop-nest-optimize -fno-tree-copy-prop -fno-tree-fre -fno-tree-loop-ivcanon" } */
|
||||
+
|
||||
+int cx;
|
||||
+
|
||||
+int
|
||||
+e6 (int pj, int xe)
|
||||
+{
|
||||
+ for (cx = 0; cx < 2; ++cx)
|
||||
+ while (xe < 1)
|
||||
+ {
|
||||
+ for (cx = 0; cx < 2; ++cx)
|
||||
+ pj *= 2;
|
||||
+
|
||||
+ if (cx != 0)
|
||||
+ goto o3;
|
||||
+
|
||||
+ ++xe;
|
||||
+ }
|
||||
+
|
||||
+o3:
|
||||
+ return pj;
|
||||
+}
|
||||
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
|
||||
index cbd17e864..790050a20 100644
|
||||
--- a/gcc/tree-scalar-evolution.c
|
||||
+++ b/gcc/tree-scalar-evolution.c
|
||||
@@ -280,6 +280,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
#include "params.h"
|
||||
#include "tree-ssa-propagate.h"
|
||||
#include "gimple-fold.h"
|
||||
+#include "tree-into-ssa.h"
|
||||
|
||||
static tree analyze_scalar_evolution_1 (struct loop *, tree, tree);
|
||||
static tree analyze_scalar_evolution_for_address_of (struct loop *loop,
|
||||
@@ -1532,7 +1533,10 @@ static tree
|
||||
follow_copies_to_constant (tree var)
|
||||
{
|
||||
tree res = var;
|
||||
- while (TREE_CODE (res) == SSA_NAME)
|
||||
+ while (TREE_CODE (res) == SSA_NAME
|
||||
+ /* We face not updated SSA form in multiple places and this walk
|
||||
+ may end up in sibling loops so we have to guard it. */
|
||||
+ && !name_registered_for_update_p (res))
|
||||
{
|
||||
gimple *def = SSA_NAME_DEF_STMT (res);
|
||||
if (gphi *phi = dyn_cast <gphi *> (def))
|
||||
--
|
||||
2.19.1
|
||||
|
||||
480
delete-auto-bolt-feature.patch
Normal file
480
delete-auto-bolt-feature.patch
Normal file
@ -0,0 +1,480 @@
|
||||
From 7a43777d1dec212a8e6fb4d30d3ad90298dc54f5 Mon Sep 17 00:00:00 2001
|
||||
From: liyancheng <412998149@qq.com>
|
||||
Date: Tue, 5 Dec 2023 20:28:15 +0800
|
||||
Subject: [PATCH] delete auto-bolt
|
||||
|
||||
---
|
||||
bolt-plugin/bolt-plugin.cc | 372 +------------------------------------
|
||||
1 file changed, 4 insertions(+), 368 deletions(-)
|
||||
|
||||
diff --git a/bolt-plugin/bolt-plugin.cc b/bolt-plugin/bolt-plugin.cc
|
||||
index f357b00dd..25cd637ea 100644
|
||||
--- a/bolt-plugin/bolt-plugin.cc
|
||||
+++ b/bolt-plugin/bolt-plugin.cc
|
||||
@@ -215,28 +215,10 @@ struct plugin_objfile
|
||||
const struct ld_plugin_input_file *file;
|
||||
};
|
||||
|
||||
-struct jump_info
|
||||
-{
|
||||
- string des_func_name;
|
||||
- string src_addr_offset;
|
||||
- string dst_addr_offset;
|
||||
- string count;
|
||||
-};
|
||||
-
|
||||
-struct func_info
|
||||
-{
|
||||
- string function_name;
|
||||
- string bind_type; /* "GLOBAL","WEAK","LOCAL","UNKNOWN". */
|
||||
- string size;
|
||||
- vector<jump_info> edges;
|
||||
-};
|
||||
-
|
||||
/* Define feedback data type. */
|
||||
enum feedback_type
|
||||
{
|
||||
NULL_TYPE, /* No feedback data. */
|
||||
- PGO_TYPE, /* Feedback data from PGO. */
|
||||
- AFDO_TYPE, /* Feedback data from AutoFDO. */
|
||||
BOLT_TYPE, /* Feedback data from BOLT. */
|
||||
};
|
||||
|
||||
@@ -246,10 +228,6 @@ enum feedback_type
|
||||
|
||||
/* The FDO section's special prefix names. */
|
||||
#define ASM_FDO_SECTION_PREFIX ".text.fdo."
|
||||
-#define ASM_FDO_CALLER_FLAG ".fdo.caller "
|
||||
-#define ASM_FDO_CALLER_BIND_FLAG ".fdo.caller.bind "
|
||||
-#define ASM_FDO_CALLER_SIZE_FLAG ".fdo.caller.size "
|
||||
-#define ASM_FDO_CALLEE_FLAG ".fdo.callee "
|
||||
|
||||
static int linker_output_set;
|
||||
|
||||
@@ -277,9 +255,6 @@ static enum feedback_type fdo_type = feedback_type::NULL_TYPE;
|
||||
|
||||
static vector<string> gcc_options;
|
||||
|
||||
-/* Map of <weak_function_name, vector<function_info>> */
|
||||
-static map<string, vector<struct func_info>> weak_functions;
|
||||
-
|
||||
/* Returns 1 if two strings have the same prefix. */
|
||||
|
||||
inline static int
|
||||
@@ -369,14 +344,7 @@ generate_bolt_cmd ()
|
||||
}
|
||||
else
|
||||
{
|
||||
- if (fdo_type == feedback_type::AFDO_TYPE)
|
||||
- {
|
||||
- cmd = string ("llvm-bolt -reorder-functions=hfsort+ ")
|
||||
- + tmp_out_file_name + " -o " + new_binary
|
||||
- + " -data=" + bolt_profile_name;
|
||||
- }
|
||||
- else if (fdo_type == feedback_type::PGO_TYPE
|
||||
- || fdo_type == feedback_type::BOLT_TYPE)
|
||||
+ if (fdo_type == feedback_type::BOLT_TYPE)
|
||||
{
|
||||
cmd = string ("llvm-bolt -reorder-blocks=cache+ ")
|
||||
+ string (" -reorder-functions=hfsort+ ")
|
||||
@@ -386,12 +354,7 @@ generate_bolt_cmd ()
|
||||
+ " -data=" + bolt_profile_name;
|
||||
}
|
||||
else
|
||||
- {
|
||||
- MSG_ERROR ("Invalid profile type!");
|
||||
- return string ();
|
||||
- }
|
||||
- MSG_INFO ("Using the default llvm-bolt optimization option,"
|
||||
- " manually specify this option by -fbolt-option. ");
|
||||
+ MSG_ERROR ("Invalid profile type!");
|
||||
}
|
||||
return cmd;
|
||||
}
|
||||
@@ -460,201 +423,14 @@ cleanup_handler ()
|
||||
return LDPS_OK;
|
||||
}
|
||||
|
||||
-/* Open BOLT profile file generated by -fauto-bolt. */
|
||||
-
|
||||
-static void
|
||||
-open_bolt_profile_file (const char *file_name)
|
||||
-{
|
||||
- if (file_name == NULL)
|
||||
- {
|
||||
- MSG_ERROR ("Empty BOLT profile name, exit!");
|
||||
- }
|
||||
-
|
||||
- if (bolt_file_fd == NULL)
|
||||
- {
|
||||
- MSG_INFO ("Generate profile file for BOLT: %s", file_name);
|
||||
- bolt_file_fd = fopen (file_name, "wt");
|
||||
- if (!bolt_file_fd)
|
||||
- {
|
||||
- MSG_ERROR ("Failed to open the file: %s."
|
||||
- " Please check whether the target path exists.",
|
||||
- file_name);
|
||||
- }
|
||||
- return;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- MSG_WARN ("BOLT profile file: %s is open, skip.", file_name);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-/* In BOLT profile, function with same name represent as func_name/file_name/1,
|
||||
- also, `/` has been added in gcc/final.c, so add /1 if this function is same
|
||||
- name function. */
|
||||
-
|
||||
-static string
|
||||
-add_suffix (string str)
|
||||
-{
|
||||
- if (str.empty () || (strstr (str.c_str (), "/") == NULL))
|
||||
- {
|
||||
- return str;
|
||||
- }
|
||||
-
|
||||
- return str + "/1";
|
||||
-}
|
||||
-
|
||||
-/* Dump function info to BOLT profile, bolt_file_fd does not need
|
||||
- to be closed here. */
|
||||
-
|
||||
-static void
|
||||
-dump_func_to_bolt_profile_file (const struct func_info &func)
|
||||
-{
|
||||
- if (func.edges.empty ())
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (!bolt_file_fd)
|
||||
- {
|
||||
- open_bolt_profile_file (bolt_profile_name.c_str ());
|
||||
-
|
||||
- /* Check whether the feedback data is from AutoFDO. */
|
||||
- if (fdo_type == feedback_type::AFDO_TYPE)
|
||||
- {
|
||||
- fprintf (bolt_file_fd, "no_lbr cycles:u:\n");
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- for (const auto &edge: func.edges)
|
||||
- {
|
||||
- if (fdo_type == feedback_type::PGO_TYPE)
|
||||
- {
|
||||
- fprintf (bolt_file_fd, "1 %s %s 1 %s %s 0 %s\n",
|
||||
- add_suffix (func.function_name).c_str (),
|
||||
- edge.src_addr_offset.c_str (),
|
||||
- add_suffix (edge.des_func_name).c_str (),
|
||||
- edge.dst_addr_offset.c_str (), edge.count.c_str ());
|
||||
- }
|
||||
- else if (fdo_type == feedback_type::AFDO_TYPE)
|
||||
- {
|
||||
- fprintf (bolt_file_fd, "1 %s %s %s\n",
|
||||
- add_suffix (func.function_name).c_str (),
|
||||
- edge.src_addr_offset.c_str (),
|
||||
- edge.count.c_str ());
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- fflush (bolt_file_fd);
|
||||
-}
|
||||
-
|
||||
/* Called by the linker when all symbols have been read. */
|
||||
|
||||
static enum ld_plugin_status
|
||||
all_symbols_read_handler ()
|
||||
{
|
||||
- for (const auto &functions: weak_functions)
|
||||
- {
|
||||
- /* More than one weak function. */
|
||||
- if (functions.second.size () > 1)
|
||||
- {
|
||||
- MSG_WARN ("The weak function: %s is confusing, take the first one.",
|
||||
- functions.first.c_str ());
|
||||
- }
|
||||
-
|
||||
- dump_func_to_bolt_profile_file (functions.second[0]);
|
||||
- }
|
||||
return LDPS_OK;
|
||||
}
|
||||
|
||||
-/* Move pointer p to end and return end. */
|
||||
-
|
||||
-static char *
|
||||
-get_next_content (char *p, char *end)
|
||||
-{
|
||||
- while (*p && p < end)
|
||||
- {
|
||||
- p++;
|
||||
- }
|
||||
- p++;
|
||||
-
|
||||
- return p;
|
||||
-}
|
||||
-
|
||||
-/* Process function head info. */
|
||||
-
|
||||
-static char *
|
||||
-process_function_head (char *data , char *end, struct func_info *func)
|
||||
-{
|
||||
- CHECK (is_prefix_of (ASM_FDO_CALLER_FLAG, data), LDPL_FATAL,
|
||||
- "The function name is missing.");
|
||||
- func->function_name = xstrdup (data + strlen (ASM_FDO_CALLER_FLAG));
|
||||
- data = get_next_content (data, end);
|
||||
-
|
||||
- CHECK (is_prefix_of (ASM_FDO_CALLER_SIZE_FLAG, data), LDPL_FATAL,
|
||||
- "The function size is missing.");
|
||||
- func->size = xstrdup (data + strlen (ASM_FDO_CALLER_SIZE_FLAG));
|
||||
- data = get_next_content (data, end);
|
||||
-
|
||||
- CHECK (is_prefix_of (ASM_FDO_CALLER_BIND_FLAG, data), LDPL_FATAL,
|
||||
- "The function bind type is missing.");
|
||||
- func->bind_type = xstrdup (data + strlen (ASM_FDO_CALLER_BIND_FLAG));
|
||||
- data = get_next_content (data, end);
|
||||
- return data;
|
||||
-}
|
||||
-
|
||||
-/* Read profile info from the symbol table located between data and end. */
|
||||
-
|
||||
-static void
|
||||
-process_section (char *data, char *end)
|
||||
-{
|
||||
- struct func_info func;
|
||||
-
|
||||
- data = process_function_head (data, end, &func);
|
||||
-
|
||||
- while (*data && data < end)
|
||||
- {
|
||||
- struct jump_info jump;
|
||||
-
|
||||
- CHECK (data, LDPL_FATAL, "data is NULL");
|
||||
- jump.src_addr_offset = xstrdup (data);
|
||||
-
|
||||
- data = get_next_content (data, end);
|
||||
- CHECK (data, LDPL_FATAL, "data is NULL");
|
||||
- if (is_prefix_of (ASM_FDO_CALLEE_FLAG, data))
|
||||
- {
|
||||
- jump.des_func_name = xstrdup (data + strlen (ASM_FDO_CALLEE_FLAG));
|
||||
- jump.dst_addr_offset = "0";
|
||||
- data = get_next_content (data, end);
|
||||
- CHECK (data, LDPL_FATAL, "data is NULL");
|
||||
- }
|
||||
- else if (fdo_type == feedback_type::PGO_TYPE)
|
||||
- {
|
||||
- jump.des_func_name = func.function_name;
|
||||
- jump.dst_addr_offset = xstrdup (data);
|
||||
- data = get_next_content (data, end);
|
||||
- CHECK (data, LDPL_FATAL, "data is NULL");
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- jump.des_func_name = func.function_name;
|
||||
- }
|
||||
-
|
||||
- jump.count = xstrdup (data);
|
||||
- data = get_next_content (data, end);
|
||||
-
|
||||
- func.edges.push_back (jump);
|
||||
- }
|
||||
-
|
||||
- if (is_prefix_of ("WEAK", func.bind_type.c_str ()))
|
||||
- {
|
||||
- weak_functions[func.function_name].push_back (func);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- dump_func_to_bolt_profile_file (func);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
/* Process error when calling function process_symtab. */
|
||||
|
||||
static int
|
||||
@@ -694,42 +470,8 @@ process_symtab (void *data, const char *name, off_t offset, off_t length)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
-
|
||||
- secdata = secdatastart = (char *)xmalloc (length * sizeof (char));
|
||||
- offset += obj->file->offset;
|
||||
- if (offset != lseek (obj->file->fd, offset, SEEK_SET))
|
||||
- {
|
||||
- return process_symtab_error (obj, secdatastart);
|
||||
- }
|
||||
-
|
||||
- do
|
||||
- {
|
||||
- ssize_t got = read (obj->file->fd, secdata, length);
|
||||
-
|
||||
- if (got == 0)
|
||||
- {
|
||||
- break;
|
||||
- }
|
||||
- else if (got > 0)
|
||||
- {
|
||||
- secdata += got;
|
||||
- length -= got;
|
||||
- }
|
||||
- else if (errno != EINTR)
|
||||
- {
|
||||
- return process_symtab_error (obj, secdatastart);
|
||||
- }
|
||||
- }
|
||||
- while (length > 0);
|
||||
-
|
||||
- if (length > 0)
|
||||
- {
|
||||
- return process_symtab_error (obj, secdatastart);
|
||||
- }
|
||||
-
|
||||
- process_section (secdatastart, secdata);
|
||||
- free (secdatastart);
|
||||
- return 1;
|
||||
+ MSG_ERROR ("-fauto-bolt is not support.");
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
/* Callback used by gold to check if the plugin will claim FILE. Writes
|
||||
@@ -769,74 +511,6 @@ claim_file_handler (const struct ld_plugin_input_file *file, int *claimed)
|
||||
return LDPS_OK;
|
||||
}
|
||||
|
||||
-/* Mangle filename path of BASE and output new allocated pointer with
|
||||
- mangled path. */
|
||||
-
|
||||
-static string
|
||||
-mangle_path (const string &base)
|
||||
-{
|
||||
- if (base.empty ())
|
||||
- {
|
||||
- return base;
|
||||
- }
|
||||
-
|
||||
- /* Convert '/' to '#', convert '..' to '^',
|
||||
- convert ':' to '~' on DOS based file system. */
|
||||
-
|
||||
- string new_path;
|
||||
- int base_len = base.size ();
|
||||
- int l = 0;
|
||||
- int r = 0;
|
||||
- while (l < base_len)
|
||||
- {
|
||||
- while (r < base_len && base[r] != '/')
|
||||
- {
|
||||
- r++;
|
||||
- }
|
||||
-
|
||||
- int len = r - l;
|
||||
- if (len == 2 && base[r - 2] == '.' && base[r - 1] == '.')
|
||||
- {
|
||||
- new_path += '^';
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- new_path += base.substr (l, r - l);
|
||||
- }
|
||||
- if (r < base_len)
|
||||
- {
|
||||
- new_path += '#';
|
||||
- }
|
||||
-
|
||||
- r++;
|
||||
- l = r;
|
||||
- }
|
||||
- return new_path;
|
||||
-}
|
||||
-
|
||||
-/* Generate BOLT profile name from file_name. */
|
||||
-
|
||||
-static string
|
||||
-generate_bolt_profile_name (string file_name)
|
||||
-{
|
||||
- if (!IS_ABSOLUTE_PATH (file_name.c_str ()))
|
||||
- {
|
||||
- if (!bolt_dir_path.empty ())
|
||||
- {
|
||||
- file_name = concat (get_current_dir_name (),
|
||||
- separator, file_name.c_str (), NULL);
|
||||
- file_name = mangle_path (file_name);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- bolt_dir_path = DEFAULT_BOLT_OUT_DIR;
|
||||
- }
|
||||
- }
|
||||
- file_name = concat (bolt_dir_path.c_str (), separator, file_name.c_str (),
|
||||
- NULL);
|
||||
- return file_name;
|
||||
-}
|
||||
-
|
||||
/* Match option_prefix from gcc_options, return the index of gcc_options. */
|
||||
|
||||
static int
|
||||
@@ -927,31 +601,6 @@ parser_bolt_optimize_option (string raw_string)
|
||||
return raw_string;
|
||||
}
|
||||
|
||||
-/* Process option -fauto-bolt. */
|
||||
-
|
||||
-static void
|
||||
-process_auto_bolt_option (const string &flag_auto_bolt)
|
||||
-{
|
||||
- const int auto_bolt_index = match_gcc_option (flag_auto_bolt.c_str ());
|
||||
-
|
||||
- if (auto_bolt_index != -1)
|
||||
- {
|
||||
- if (gcc_options[auto_bolt_index] == "-fauto-bolt")
|
||||
- {
|
||||
- MSG_INFO ("Use default output directory %s, ", DEFAULT_BOLT_OUT_DIR);
|
||||
- MSG_INFO ("Specify it using -fauto-bolt= if needed.");
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- string flag_auto_bolt_equal = "-fauto-bolt=";
|
||||
- bolt_dir_path = lrealpath (gcc_options[auto_bolt_index].substr (
|
||||
- flag_auto_bolt_equal.size ()).c_str ());
|
||||
- MSG_INFO ("Get bolt profile path: %s", bolt_dir_path.c_str ());
|
||||
- }
|
||||
- bolt_profile_name = generate_bolt_profile_name(bolt_profile_name);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
/* Process option -fbolt-use=. */
|
||||
|
||||
static void
|
||||
@@ -1035,9 +684,6 @@ process_output_option (const string &flag_o)
|
||||
static void
|
||||
process_gcc_option ()
|
||||
{
|
||||
- string flag_profile_use = "-fprofile-use";
|
||||
- string flag_auto_profile = "-fauto-profile";
|
||||
- string flag_auto_bolt = "-fauto-bolt";
|
||||
string flag_bolt_use = "-fbolt-use=";
|
||||
string flag_bolt_target = "-fbolt-target=";
|
||||
string flag_bolt_optimize_options = "-fbolt-option=";
|
||||
@@ -1051,19 +697,9 @@ process_gcc_option ()
|
||||
/* Function process_output_option should be processed before
|
||||
process_auto_bolt_option to obtain correct bolt_profile_name. */
|
||||
process_output_option (flag_o);
|
||||
- process_auto_bolt_option (flag_auto_bolt);
|
||||
process_bolt_use_option (flag_bolt_use);
|
||||
process_bolt_target_option (flag_bolt_target);
|
||||
process_bolt_option (flag_bolt_optimize_options);
|
||||
-
|
||||
- if (match_gcc_option (flag_profile_use.c_str ()) != -1)
|
||||
- {
|
||||
- fdo_type = feedback_type::PGO_TYPE;
|
||||
- }
|
||||
- else if (match_gcc_option (flag_auto_profile.c_str ()) != -1)
|
||||
- {
|
||||
- fdo_type = feedback_type::AFDO_TYPE;
|
||||
- }
|
||||
|
||||
if (match_gcc_option (flag_bolt_use.c_str ()) != -1)
|
||||
{
|
||||
--
|
||||
2.25.1
|
||||
|
||||
65
gcc.spec
65
gcc.spec
@ -1,7 +1,7 @@
|
||||
%define debug_package %{nil}
|
||||
|
||||
%global gcc_version 7.3.0
|
||||
%global isl_version 0.21
|
||||
%global isl_version 0.16.1
|
||||
%global cloog_version 0.18.4
|
||||
|
||||
%define compat_gcc_provides 7777777
|
||||
@ -41,12 +41,12 @@ Version: 7.3.0
|
||||
# number 2020033101 meaning the openEuler 20.03 release date plus 01 to
|
||||
# replace DATE and will never change it in the future.
|
||||
%global openEulerDATE 2020033101
|
||||
Release: %{openEulerDATE}.54
|
||||
Release: %{openEulerDATE}.59
|
||||
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
|
||||
Group: Development/Languages
|
||||
#Source0: hcc-aarch64-linux-release.tar.bz2
|
||||
Source0: gcc-%{version}.tar.gz
|
||||
Source1: isl-%{isl_version}.tar.bz2
|
||||
Source1: isl-%{isl_version}.tar.xz
|
||||
Source2: cloog-%{cloog_version}.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: gmp libmpc-devel mpfr gmp-devel glibc-headers gcc-c++ mpfr-devel
|
||||
@ -73,7 +73,6 @@ Patch2: gcc-adapt-to-isl.patch
|
||||
Patch3: sanitizer-pr-85835.patch
|
||||
Patch4: CVE-2018-12886.patch
|
||||
Patch5: CVE-2019-15847.patch
|
||||
Patch7: add-tsv110-pipeline-scheduling.patch
|
||||
Patch12: aarch64-fix-tls-negative-offset.patch
|
||||
Patch14: arm-fix-push-minipool.patch
|
||||
Patch22: arm-bigendian-disable-interleaved-LS-vectorize.patch
|
||||
@ -100,7 +99,14 @@ Patch49: aarch64-Rename-hard_fp_offset-to-bytes_above_hard_fp.patch
|
||||
Patch50: aarch64-Tweak-frame_size-comment.patch
|
||||
Patch51: Backport-check-function-bodies-support.patch
|
||||
Patch52: aarch64-Make-stack-smash-canary-protect-saved-registers.patch
|
||||
|
||||
Patch53: Backport-aarch64-Add-HiSilicon-tsv110-CPU-support.patch
|
||||
Patch54: Backport-AArch64-Add-tsv110-pipeline-scheduling.patch
|
||||
Patch55: Backport-Rework-cold-and-hot-label-attributes-in-pre.patch
|
||||
Patch56: Backport-Learn-GIMPLE-pretty-printer-to-produce-nice.patch
|
||||
Patch57: Backport-AArch64-Fix-longbranch-test.patch
|
||||
Patch58: Backport-re-PR-tree-optimization-84552-Compile-time-.patch
|
||||
Patch59: delete-auto-bolt-feature.patch
|
||||
Patch60: Backport-fix-contexpr-list-initialized-member.patch
|
||||
#AutoReqProv: off
|
||||
AutoReq: true
|
||||
|
||||
@ -557,39 +563,7 @@ package or when debugging this package.
|
||||
%setup -q -n gcc-%{version} -a 1 -a 2
|
||||
/bin/pwd
|
||||
|
||||
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch7 -p1
|
||||
%patch12 -p1
|
||||
%patch14 -p1
|
||||
%patch22 -p1
|
||||
%patch23 -p1
|
||||
%patch25 -p1
|
||||
%patch29 -p1
|
||||
%patch31 -p1
|
||||
%patch34 -p1
|
||||
%patch35 -p1
|
||||
%patch36 -p1
|
||||
%patch37 -p1
|
||||
%patch38 -p1
|
||||
%patch39 -p1
|
||||
%patch40 -p1
|
||||
%patch41 -p1
|
||||
%patch42 -p1
|
||||
%patch43 -p1
|
||||
%patch44 -p1
|
||||
%patch45 -p1
|
||||
%patch46 -p1
|
||||
%patch47 -p1
|
||||
%patch48 -p1
|
||||
%patch49 -p1
|
||||
%patch50 -p1
|
||||
%patch51 -p1
|
||||
%patch52 -p1
|
||||
%autopatch -p1
|
||||
|
||||
%if 0%{?_enable_debug_packages}
|
||||
cat > split-debuginfo.sh <<\EOF
|
||||
@ -3364,6 +3338,21 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Thu Dec 12 2024 lijian1<lijian1@kylinos.cn> - 7.3.0-2020033101.59
|
||||
- Backport from upstream to fix contexpr list initialized member bug.
|
||||
|
||||
* Tue Dec 05 2023 liyancheng <412998149@qq.com> - 7.3.0-2020033101.58
|
||||
- Delete useless auto-bolt feature.
|
||||
|
||||
* Tue Dec 05 2023 eastb233 <xiezhiheng@huawei.com> - 7.3.0-2020033101.57
|
||||
- Fix efl compilation issue.
|
||||
|
||||
* Mon Nov 27 2023 eastb233 <xiezhiheng@huawei.com> - 7.3.0-2020033101.56
|
||||
- Fix incorrect port of tsv110 pipeline.
|
||||
|
||||
* Fri Nov 24 2023 zhaoshujian <zhaoshujian@huawei.com> - 7.3.0-2020033101.55
|
||||
- Change isl version from isl-0.21 to isl-0.16.1 to fix the deja test ice.
|
||||
|
||||
* Tue Nov 21 2023 eastb233 <xiezhiheng@huawei.com> - 7.3.0-2020033101.54
|
||||
- Delete several patches which cause some failures.
|
||||
|
||||
|
||||
BIN
isl-0.16.1.tar.xz
Normal file
BIN
isl-0.16.1.tar.xz
Normal file
Binary file not shown.
BIN
isl-0.21.tar.bz2
BIN
isl-0.21.tar.bz2
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user