[SPEC]Delete all submissions before openEuler 24.03-LTS-SP1

This commit is contained in:
liyancheng 2024-12-30 22:16:02 +08:00
parent 6cc2442cc2
commit eed5adb71b
11 changed files with 2 additions and 1860 deletions

View File

@ -1,25 +0,0 @@
From 8d8dff2b18de8149b4f9f03968abd1b6f4b8cc69 Mon Sep 17 00:00:00 2001
From: rfwang07 <wangrufeng5@huawei.com>
Date: Sat, 21 Dec 2024 18:29:10 +0800
Subject: [PATCH] fix: function missing return value
---
gcc/final.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/final.cc b/gcc/final.cc
index e4bfceabc..0252250ba 100644
--- a/gcc/final.cc
+++ b/gcc/final.cc
@@ -4443,7 +4443,7 @@ dump_direct_callee_info_to_asm (basic_block bb, gcov_type call_count)
}
/* Dump the edge info into asm. */
-static int
+static void
dump_edge_jump_info_to_asm (basic_block bb, gcov_type bb_count)
{
edge e;
--
2.39.5 (Apple Git-154)

View File

@ -1,50 +0,0 @@
From d10807504a7f4e58a7dd1fa245d0ccf16227d222 Mon Sep 17 00:00:00 2001
From: Chernonog Viacheslav <chernonog.vyacheslav@huawei.com>
Date: Wed, 4 Dec 2024 20:07:23 +0800
Subject: [PATCH] [Bugfix] replace tmp pattern split
move split before reload
change split tmp pattern to 3 instructions
---
gcc/config/aarch64/aarch64-simd.md | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md
index 04592fc90..fb5e355d0 100644
--- a/gcc/config/aarch64/aarch64-simd.md
+++ b/gcc/config/aarch64/aarch64-simd.md
@@ -6566,18 +6566,25 @@
(match_operand:VDQHSD 1 "register_operand" "w")
(match_operand:VDQHSD 2 "half_size_minus_one_operand"))
(match_operand:VDQHSD 3 "cmlt_arith_mask_operand")))]
- "TARGET_SIMD && flag_cmlt_arith"
+ "TARGET_SIMD && !reload_completed && flag_cmlt_arith"
"#"
- "&& reload_completed"
- [(set (match_operand:<V_INT_EQUIV> 0 "register_operand")
+ "&& true"
+ [(set (match_operand:<V_INT_EQUIV> 0 "register_operand" "=w")
(lshiftrt:<V_INT_EQUIV>
(match_operand:VDQHSD 1 "register_operand")
(match_operand:VDQHSD 2 "half_size_minus_one_operand")))
+ (set (match_operand:<V_INT_EQUIV> 4 "register_operand" "w")
+ (match_operand:VDQHSD 3 "cmlt_arith_mask_operand"))
(set (match_dup 0)
(and:<V_INT_EQUIV>
- (match_dup 0)
- (match_operand:VDQHSD 3 "cmlt_arith_mask_operand")))]
- ""
+ (match_dup 4)
+ (match_dup 0)))]
+ {
+ if (can_create_pseudo_p ())
+ operands[4] = gen_reg_rtx (<V_INT_EQUIV>mode);
+ else
+ FAIL;
+ }
[(set_attr "type" "neon_compare_zero")]
)
--
2.33.0

View File

@ -1,52 +0,0 @@
From 8f5c12954adb237685c837cb37c98b7594e9fa61 Mon Sep 17 00:00:00 2001
From: Mingchuan Wu <wumingchuan1992@foxmail.com>
Date: Tue, 10 Dec 2024 15:50:16 +0800
Subject: [PATCH] [bugfix] fix vector costs for hip09.
---
gcc/config/aarch64/aarch64-cost-tables.h | 6 +++++-
gcc/config/aarch64/aarch64.cc | 4 +++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/gcc/config/aarch64/aarch64-cost-tables.h b/gcc/config/aarch64/aarch64-cost-tables.h
index dc51d9c2c..06da1b271 100644
--- a/gcc/config/aarch64/aarch64-cost-tables.h
+++ b/gcc/config/aarch64/aarch64-cost-tables.h
@@ -872,7 +872,11 @@ const struct cpu_cost_table hip09_extra_costs =
},
/* Vector */
{
- COSTS_N_INSNS (1) /* alu. */
+ COSTS_N_INSNS (1), /* alu. */
+ COSTS_N_INSNS (4), /* mult. */
+ COSTS_N_INSNS (1), /* movi. */
+ COSTS_N_INSNS (2), /* dup. */
+ COSTS_N_INSNS (2) /* extract. */
}
};
diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index 829e0da8f..f2444a039 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -499,6 +499,8 @@ static const struct cpu_addrcost_table hip09_addrcost_table =
},
0, /* pre_modify */
0, /* post_modify */
+ 0, /* post_modify_ld3_st3 */
+ 0, /* post_modify_ld4_st4 */
0, /* register_offset */
1, /* register_sextend */
1, /* register_zextend */
@@ -1910,7 +1912,7 @@ static const struct tune_params hip09_tunings =
&hip09_extra_costs,
&hip09_addrcost_table,
&hip09_regmove_cost,
- &hip09_vector_cost,
+ &generic_vector_cost,
&generic_branch_cost,
&generic_approx_modes,
SVE_256, /* sve_width */
--
2.33.0

View File

@ -1,54 +0,0 @@
From 14457b169e1e4cb372d165de3bbdde391e8b817f Mon Sep 17 00:00:00 2001
From: YunQiang Su <yunqiang@isrc.iscas.ac.cn>
Date: Tue, 8 Oct 2024 18:04:01 +0800
Subject: [PATCH] gcc/opts-common.cc: Fix build with clang
1. For putenv ("AI_INFER_LEVEL=1"), clang complains that C++11 deprecates
convert string literal to char *, while putenv expcets "char *".
Let's use setenv, which expects "const char *".
2. Ditto for char *lan in handle_lto_option.
3. In `handle_machine_option`, there is a variable length array,
int64_t argv_hw[argc_hw]
clang complains about it, and in fact, argc_hw can be an const var.
---
gcc/opts-common.cc | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/gcc/opts-common.cc b/gcc/opts-common.cc
index 12c3f7299..33c696f3d 100644
--- a/gcc/opts-common.cc
+++ b/gcc/opts-common.cc
@@ -1053,7 +1053,7 @@ ai_infer_optimization (int argc, const char **argv,
dlclose (onnxruntime_lib_handle);
if (model_pred == 1)
- putenv ("AI_INFER_LEVEL=1");
+ setenv ("AI_INFER_LEVEL", "1", 1);
return model_pred;
}
@@ -1065,9 +1065,8 @@ handle_lto_option (unsigned int lang_mask,
struct cl_decoded_option *&opt_array)
{
int ret = 0;
- char *lan = "";
char *compiler = xstrdup (argv[0]);
- lan = strrchr (compiler, '/');
+ char *lan = strrchr (compiler, '/');
if (lan != NULL)
lan ++;
else
@@ -1125,7 +1124,7 @@ handle_machine_option (unsigned int lang_mask,
{
return ret;
}
- int argc_hw = 6;
+ const int argc_hw = 6;
int64_t argv_hw[argc_hw] = {
global_options.x_param_simultaneous_prefetches,
global_options.x_param_l1_cache_size,
--
2.33.0

File diff suppressed because one or more lines are too long

View File

@ -1,81 +0,0 @@
From 861ddfd90d86215a573a7614f49d572f1e03be6f Mon Sep 17 00:00:00 2001
From: huang-xiaoquan <huangxiaoquan1@huawei.com>
Date: Mon, 16 Dec 2024 11:34:06 +0800
Subject: [PATCH] [Bugfix] Adjust the same gate to use struct option
---
gcc/gimple-ssa-warn-access.cc | 7 ++++++-
gcc/ipa-free-lang-data.cc | 5 +++--
gcc/symbol-summary.h | 8 +++++++-
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/gcc/gimple-ssa-warn-access.cc b/gcc/gimple-ssa-warn-access.cc
index a24645783..3d80590ee 100644
--- a/gcc/gimple-ssa-warn-access.cc
+++ b/gcc/gimple-ssa-warn-access.cc
@@ -56,6 +56,9 @@
#include "attr-fnspec.h"
#include "pointer-query.h"
+/* Check whether in C language or LTO with only C language. */
+extern bool lang_c_p (void);
+
/* Return true if tree node X has an associated location. */
static inline location_t
@@ -2198,7 +2201,9 @@ pass_waccess::gate (function *)
In pass waccess, it will traverse all SSA and cause ICE
when handling these unused SSA. So temporarily disable
pass waccess when enable structure optimizations. */
- if (flag_ipa_struct_reorg)
+ if (optimize >= 3 && flag_ipa_struct_reorg && !seen_error ()
+ && flag_lto_partition == LTO_PARTITION_ONE && lang_c_p ()
+ && (in_lto_p || flag_whole_program))
return false;
return (warn_free_nonheap_object
diff --git a/gcc/ipa-free-lang-data.cc b/gcc/ipa-free-lang-data.cc
index 801e95cea..17e3f43b3 100644
--- a/gcc/ipa-free-lang-data.cc
+++ b/gcc/ipa-free-lang-data.cc
@@ -108,8 +108,9 @@ fld_simplified_type_name (tree type)
/* Simplify type will cause that struct A and struct A within
struct B are different type pointers, so skip it in structure
optimizations. */
- if (flag_ipa_struct_reorg && lang_c_p ()
- && flag_lto_partition == LTO_PARTITION_ONE)
+ if (optimize >= 3 && flag_ipa_struct_reorg && !seen_error ()
+ && flag_lto_partition == LTO_PARTITION_ONE && lang_c_p ()
+ && (in_lto_p || flag_whole_program))
return TYPE_NAME (type);
if (!TYPE_NAME (type) || TREE_CODE (TYPE_NAME (type)) != TYPE_DECL)
diff --git a/gcc/symbol-summary.h b/gcc/symbol-summary.h
index 4f896f4e4..06a1c7fff 100644
--- a/gcc/symbol-summary.h
+++ b/gcc/symbol-summary.h
@@ -21,6 +21,10 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_SYMBOL_SUMMARY_H
#define GCC_SYMBOL_SUMMARY_H
+#include "diagnostic.h"
+/* Check whether in C language or LTO with only C language. */
+extern bool lang_c_p (void);
+
/* Base class for function_summary and fast_function_summary classes. */
template <class T>
@@ -109,7 +113,9 @@ protected:
: m_allocator.allocate ();
/* In structure optimizatons, we call memset to ensure that
the allocated memory is initialized to 0. */
- if (flag_ipa_struct_reorg)
+ if (optimize >= 3 && flag_ipa_struct_reorg && !seen_error ()
+ && flag_lto_partition == LTO_PARTITION_ONE && lang_c_p ()
+ && (in_lto_p || flag_whole_program))
memset (allocated, 0, sizeof (T));
return allocated;
}
--
2.33.0

View File

@ -1,248 +0,0 @@
From e2896c73513cfb2dfd7c4796effef6ba06396f35 Mon Sep 17 00:00:00 2001
From: Zinin Ivan WX1305386 <zinin.ivan@huawei-partners.com>
Date: Fri, 13 Dec 2024 10:52:08 +0300
Subject: [PATCH] [Bugfix][if-split] Added checking for ssa_name
Added checking if part of OR complex condition is really an ssa
name in necessary_complex_cond_p(). Besides, made var_n_cst
structure, which replaced var_cst and cond_parts_defs structures.
---
gcc/gimple-if-split.cc | 123 +++++++++++++++++++----------------------
1 file changed, 56 insertions(+), 67 deletions(-)
diff --git a/gcc/gimple-if-split.cc b/gcc/gimple-if-split.cc
index 351515435..914b65d47 100644
--- a/gcc/gimple-if-split.cc
+++ b/gcc/gimple-if-split.cc
@@ -61,14 +61,14 @@ Example:
//-------------------------------------------------------------------------
/* Check if arg list of call got n. */
bool
-got_in_args_p (gimple* call, tree n)
+got_in_args_p (gimple *call, tree n)
{
unsigned num_args = gimple_call_num_args (call);
for (int i = 0; i < num_args; i++)
{
if (n == gimple_call_arg (call, i))
- return true;
+ return true;
}
return false;
@@ -142,19 +142,24 @@ bb_got_necessary_call_p (basic_block bb, tree n, unsigned nesting)
//-------------------------------------------------------------------------
// Complex conditions
//-------------------------------------------------------------------------
-/* Auxiliary struct which contains var and its constant of comaprison
- * of expr: n == cst. */
-struct var_const
+/* Auxiliary struct which contains tree nodes of such statements:
+ * var = (n == cst). Actually in some cases var field can be not an ssa
+ * name and/or it's rhs can be not "comparison with constant"
+ * expression. However, we need to fill var field of such structures
+ * in necessary_complex_cond_p () to build/change conditions in
+ * process_complex_cond (). */
+struct var_n_const
{
+ tree var = NULL_TREE;
tree n = NULL_TREE;
tree cst = NULL_TREE;
};
/* Check if var_def stmt got this pattern:
* var = (n == const);
- * If it does, we need to set var_cst struct. */
+ * If it does, we need to set n and cst in var_n_cst struct. */
static bool
-comp_with_const_p (gimple *var_def, var_const *var_cst)
+comp_with_const_p (gimple *var_def, var_n_const *var_n_cst)
{
if (gimple_expr_code (var_def) != EQ_EXPR)
return false;
@@ -164,33 +169,24 @@ comp_with_const_p (gimple *var_def, var_const *var_cst)
if (TREE_CODE (var_def_rhs2) != INTEGER_CST)
return false;
- var_cst->n = gimple_assign_rhs1 (var_def);
- var_cst->cst = var_def_rhs2;
+ var_n_cst->n = gimple_assign_rhs1 (var_def);
+ var_n_cst->cst = var_def_rhs2;
return true;
}
-/* Auxiliary struct which contains defenition of each part of
- * complex condition, like:
- * a = ... <- a_def
- * b = ... <- b_def
- * c = a | b <- complex_cond. */
-struct cond_parts_defs
-{
- gimple *a_def = NULL;
- gimple *b_def = NULL;
-};
-
/* Check if cond got this pattern:
* a = ...; <- a_def
* b = ...; <- b_def
- * c = a | b;
+ * c = a | b; <- c_def
* if (c != 0)
- * and a_def or b_def is comparison with constant. If it does,
- * we need to set a with a_def and b with b_def. */
+ * and a_def or b_def is comparison with constant.
+ * If it does, we need to set a_var_n_cst and b_var_n_cst.
+ * Also set a_var_n_cst->var as gimple_assign_rhs1 (c_def),
+ * b_var_n_cst->var as gimple_assign_rhs2 (c_def). */
static bool
necessary_complex_cond_p (const gimple *cond, basic_block then_bb,
- cond_parts_defs *defs)
+ var_n_const *a_var_n_cst, var_n_const *b_var_n_cst)
{
tree lhs = gimple_cond_lhs (cond);
tree rhs = gimple_cond_rhs (cond);
@@ -207,27 +203,25 @@ necessary_complex_cond_p (const gimple *cond, basic_block then_bb,
|| gimple_expr_code (c_def) != BIT_IOR_EXPR)
return false;
- tree a_var = gimple_assign_rhs1 (c_def);
- tree b_var = gimple_assign_rhs2 (c_def);
- gimple *a_def = SSA_NAME_DEF_STMT (a_var);
- gimple *b_def = SSA_NAME_DEF_STMT (b_var);
-
- if (!a_def || !is_gimple_assign (a_def) || !b_def
- || !is_gimple_assign (b_def))
- return false;
-
- var_const var_cst;
-
- if (!(comp_with_const_p (a_def, &var_cst)
- && bb_got_necessary_call_p (then_bb, var_cst.n, SCALAR_NESTING))
- && !(comp_with_const_p (b_def, &var_cst)
- && bb_got_necessary_call_p (then_bb, var_cst.n, SCALAR_NESTING)))
- return false;
-
- defs->a_def = a_def;
- defs->b_def = b_def;
-
- return true;
+ bool result = false;
+
+ gimple *a_def;
+ a_var_n_cst->var = gimple_assign_rhs1 (c_def);
+ if (TREE_CODE (a_var_n_cst->var) == SSA_NAME
+ && (a_def = SSA_NAME_DEF_STMT (a_var_n_cst->var))
+ && is_gimple_assign (a_def) && comp_with_const_p (a_def, a_var_n_cst)
+ && bb_got_necessary_call_p (then_bb, a_var_n_cst->n, SCALAR_NESTING))
+ result = true;
+
+ gimple *b_def;
+ b_var_n_cst->var = gimple_assign_rhs2 (c_def);
+ if (TREE_CODE (b_var_n_cst->var) == SSA_NAME
+ && (b_def = SSA_NAME_DEF_STMT (b_var_n_cst->var))
+ && is_gimple_assign (b_def) && comp_with_const_p (b_def, b_var_n_cst)
+ && bb_got_necessary_call_p (then_bb, b_var_n_cst->n, SCALAR_NESTING))
+ result = true;
+
+ return result;
}
/* Check if our complex condition seems to be "necessary"
@@ -253,11 +247,10 @@ process_complex_cond (basic_block cond_bb, basic_block then_bb,
basic_block else_bb)
{
gimple *cond = last_stmt (cond_bb);
- cond_parts_defs defs;
+ var_n_const a_var_n_cst, b_var_n_cst;
- if (!can_duplicate_block_p (then_bb)
- || !single_succ_p (then_bb)
- || !necessary_complex_cond_p (cond, then_bb, &defs))
+ if (!can_duplicate_block_p (then_bb) || !single_succ_p (then_bb)
+ || !necessary_complex_cond_p (cond, then_bb, &a_var_n_cst, &b_var_n_cst))
return;
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -267,19 +260,16 @@ process_complex_cond (basic_block cond_bb, basic_block then_bb,
print_gimple_stmt (dump_file, cond, 0, TDF_NONE);
}
- var_const var_cst;
-
/* Setting cond. */
- if (comp_with_const_p (defs.a_def, &var_cst))
- /* Setting cond as: if (n == const). */
- gimple_cond_set_condition (as_a<gcond *> (cond), EQ_EXPR, var_cst.n,
- var_cst.cst);
+ if (a_var_n_cst.n != NULL_TREE && a_var_n_cst.cst != NULL_TREE)
+ /* Setting cond as: if (n == const). */
+ gimple_cond_set_condition (as_a<gcond *> (cond), EQ_EXPR, a_var_n_cst.n,
+ a_var_n_cst.cst);
else
{
/* Setting cond as: if (a != 0). */
- tree cond_lhs = gimple_assign_lhs (defs.a_def);
- gimple_cond_set_condition (as_a<gcond *> (cond), NE_EXPR, cond_lhs,
- build_zero_cst (TREE_TYPE (cond_lhs)));
+ gimple_cond_set_condition (as_a<gcond *> (cond), NE_EXPR, a_var_n_cst.var,
+ build_zero_cst (TREE_TYPE (a_var_n_cst.var)));
}
update_stmt (cond);
@@ -290,19 +280,18 @@ process_complex_cond (basic_block cond_bb, basic_block then_bb,
/* Setting inner_cond. */
gcond *inner_cond = NULL;
- if (comp_with_const_p (defs.b_def, &var_cst))
+ if (b_var_n_cst.n != NULL_TREE && b_var_n_cst.cst != NULL_TREE)
{
- /* Setting inner cond as: if (b == const). */
- inner_cond = gimple_build_cond (EQ_EXPR, var_cst.n, var_cst.cst,
+ /* Setting inner cond as: if (n == const). */
+ inner_cond = gimple_build_cond (EQ_EXPR, b_var_n_cst.n, b_var_n_cst.cst,
NULL_TREE, NULL_TREE);
}
else
{
/* Setting inner cond as: if (b != 0). */
- tree inner_cond_lhs = gimple_assign_lhs (defs.b_def);
inner_cond = gimple_build_cond (
- NE_EXPR, inner_cond_lhs, build_zero_cst (TREE_TYPE (inner_cond_lhs)),
- NULL_TREE, NULL_TREE);
+ NE_EXPR, b_var_n_cst.var,
+ build_zero_cst (TREE_TYPE (b_var_n_cst.var)), NULL_TREE, NULL_TREE);
}
gimple_stmt_iterator gsi = gsi_last_bb (inner_cond_bb);
gsi_insert_after (&gsi, inner_cond, GSI_NEW_STMT);
@@ -362,7 +351,7 @@ make_two_separate_calls (basic_block outer_cond_bb, basic_block inner_cond_bb,
if (single_succ (then_bb) == EXIT_BLOCK_PTR_FOR_FN (cfun))
{
gcc_assert (gimple_code (last_stmt (then_bb)) == GIMPLE_RETURN);
- ret_val = gimple_return_retval (as_a<greturn*>(last_stmt (then_bb)));
+ ret_val = gimple_return_retval (as_a<greturn *> (last_stmt (then_bb)));
then_bb_succ_edge_flags = single_succ_edge (then_bb)->flags;
}
@@ -373,7 +362,7 @@ make_two_separate_calls (basic_block outer_cond_bb, basic_block inner_cond_bb,
* if now merge_bb is pred of EXIT_BLOCK. */
if (single_succ (merge_bb) == EXIT_BLOCK_PTR_FOR_FN (cfun))
{
- gimple* ret = gimple_build_return (ret_val);
+ gimple *ret = gimple_build_return (ret_val);
gimple_stmt_iterator gsi = gsi_last_bb (merge_bb);
gsi_insert_after (&gsi, ret, GSI_NEW_STMT);
@@ -400,7 +389,7 @@ make_two_separate_calls (basic_block outer_cond_bb, basic_block inner_cond_bb,
single_succ (merge_bb));
if (get_immediate_dominator (CDI_POST_DOMINATORS, outer_cond_bb) == then_bb)
- set_immediate_dominator (CDI_POST_DOMINATORS, outer_cond_bb, merge_bb);
+ set_immediate_dominator (CDI_POST_DOMINATORS, outer_cond_bb, merge_bb);
return then_bb1;
}
--
2.33.0

View File

@ -1,90 +0,0 @@
From 66e1c68b47a1fd889e206be5572a2ba5d62afb4d Mon Sep 17 00:00:00 2001
From: Zinin Ivan WX1305386 <zinin.ivan@huawei-partners.com>
Date: Tue, 17 Dec 2024 22:07:36 +0800
Subject: [PATCH] [if-split][BugFix]Fixed work with loops in
process_complex_cond()
Signed-off-by: zhenyu--zhao_admin <zhaozhenyu17@huawei.com>
---
gcc/gimple-if-split.cc | 17 +++++++++++++++--
gcc/tree-loop-distribution.cc | 6 ++++++
gcc/tree-vect-loop.cc | 4 ----
3 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/gcc/gimple-if-split.cc b/gcc/gimple-if-split.cc
index 914b65d4782..b535ffab1c3 100644
--- a/gcc/gimple-if-split.cc
+++ b/gcc/gimple-if-split.cc
@@ -262,9 +262,11 @@ process_complex_cond (basic_block cond_bb, basic_block then_bb,
/* Setting cond. */
if (a_var_n_cst.n != NULL_TREE && a_var_n_cst.cst != NULL_TREE)
- /* Setting cond as: if (n == const). */
- gimple_cond_set_condition (as_a<gcond *> (cond), EQ_EXPR, a_var_n_cst.n,
+ {
+ /* Setting cond as: if (n == const). */
+ gimple_cond_set_condition (as_a<gcond *> (cond), EQ_EXPR, a_var_n_cst.n,
a_var_n_cst.cst);
+ }
else
{
/* Setting cond as: if (a != 0). */
@@ -276,8 +278,19 @@ process_complex_cond (basic_block cond_bb, basic_block then_bb,
/* Creating inner_cond_bb. */
edge then_e = find_edge (cond_bb, then_bb);
edge else_e = find_edge (cond_bb, else_bb);
+
+ bool inner_cond_bb_need_set_loop = false;
+ if (else_e->dest->loop_father != else_e->src->loop_father)
+ inner_cond_bb_need_set_loop = true;
+
basic_block inner_cond_bb = split_edge (else_e);
+ if (inner_cond_bb_need_set_loop)
+ {
+ remove_bb_from_loops (inner_cond_bb);
+ add_bb_to_loop (inner_cond_bb, cond_bb->loop_father);
+ }
+
/* Setting inner_cond. */
gcond *inner_cond = NULL;
if (b_var_n_cst.n != NULL_TREE && b_var_n_cst.cst != NULL_TREE)
diff --git a/gcc/tree-loop-distribution.cc b/gcc/tree-loop-distribution.cc
index 8d118e98739..f7a4690246c 100644
--- a/gcc/tree-loop-distribution.cc
+++ b/gcc/tree-loop-distribution.cc
@@ -5265,10 +5265,16 @@ loop_distribution::execute (function *fun)
bool destroy_p;
int nb_generated_loops, nb_generated_calls;
+
+ vect_slp_init ();
+
nb_generated_loops
= distribute_loop (loop, work_list, cd, &nb_generated_calls,
&destroy_p, (!optimize_loop_for_speed_p (loop)
|| !flag_tree_loop_distribution));
+
+ vect_slp_fini ();
+
if (destroy_p)
loops_to_be_destroyed.safe_push (loop);
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index f296e9415c4..7f75779519a 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -3016,10 +3016,6 @@ vect_analyze_loop (class loop *loop, vec_info_shared *shared,
opt_loop_vec_info first_loop_vinfo = opt_loop_vec_info::success (NULL);
/* Loop_vinfo for loop-distribution pass. */
opt_loop_vec_info fail_loop_vinfo = opt_loop_vec_info::success (NULL);
- if (result_only_p)
- {
- vect_slp_init ();
- }
unsigned int mode_i = 0;
unsigned HOST_WIDE_INT simdlen = loop->simdlen;
--
Gitee

View File

@ -1,25 +0,0 @@
From 843b7577b5b255806978f338f6f99863693509d6 Mon Sep 17 00:00:00 2001
From: Mingchuan Wu <wumingchuan1992@foxmail.com>
Date: Wed, 18 Dec 2024 10:10:30 +0800
Subject: [PATCH] [bugfix] fix typo error.
---
gcc/opts-common.cc | 2 --
1 file changed, 2 deletions(-)
diff --git a/gcc/opts-common.cc b/gcc/opts-common.cc
index 35db76b84..ee94723fc 100644
--- a/gcc/opts-common.cc
+++ b/gcc/opts-common.cc
@@ -1070,8 +1070,6 @@ handle_machine_option (unsigned int lang_mask,
global_options.x_param_ipa_prefetch_distance_factor};
int64_t output_pred = get_optimize_decision_from_optimizer (
argc, argv, "hip09", argc_hw, argv_hw);
- if (output_pred == 1)
- return output_pred;
if (output_pred != 1)
return ret;
--
2.33.0

View File

@ -1,195 +0,0 @@
From e0b6e2e9d8226881886c28826a2fe2e55fd29511 Mon Sep 17 00:00:00 2001
From: zhenyu--zhao_admin <zhaozhenyu17@huawei.com>
Date: Sun, 29 Dec 2024 14:11:14 +0800
Subject: [PATCH] [Bugfix] Can not find fdata file.
---
gcc/ai-optimizer.cc | 49 ++++++++++++++++++++++++++++++++++++---------
gcc/ai4c-infer.cc | 28 ++++----------------------
gcc/gcc.cc | 31 +++++++++++++++++++++++++---
gcc/gcc.h | 1 +
4 files changed, 73 insertions(+), 36 deletions(-)
diff --git a/gcc/ai-optimizer.cc b/gcc/ai-optimizer.cc
index c3d99dd85..70ff24077 100644
--- a/gcc/ai-optimizer.cc
+++ b/gcc/ai-optimizer.cc
@@ -284,19 +284,50 @@ static int
graph_infer (int argc1, const char **argv1, const char *mops,
int argc2, int64_t *argv2)
{
- char *gcc_exec_prefix = getenv ("ONNX_FDATA_PATH");
- if (gcc_exec_prefix == NULL)
+ char gcc_exec_prefix[512];
+ ssize_t len = readlink ("/proc/self/exe", gcc_exec_prefix,
+ sizeof (gcc_exec_prefix) - 1);
+ if (len == -1)
return 0;
- char native_file[512];
- if (gcc_exec_prefix)
+ char native_file[512];
+ strncpy (native_file, gcc_exec_prefix, sizeof (native_file) - 1);
+ const char *target = "bin/gcc";
+ const char *target_cc1 = "cc1";
+ const char *target_gpp = "bin/g++";
+ const char *target_cc1plus = "cc1plus";
+ const char *target_gfortran = "bin/gfortran";
+ const char *target_f951 = "f951";
+ const char *replacement = "../libexec/gcc/optimizer.fdata";
+ const char *replacement_front_end = "../../optimizer.fdata";
+
+ /* Replace the part of the current executable file path after the last slash
+ to locate the model file. */
+ if (strstr (native_file, target) != NULL ||
+ strstr (native_file, target_gpp) != NULL ||
+ strstr (native_file, target_gfortran) != NULL)
{
- const char *onnx_fdata = "optimizer.fdata";
- strncpy (native_file, gcc_exec_prefix, sizeof (native_file) - 1);
- native_file[sizeof (native_file) - 1] = '\0';
char *last_slash = strrchr (native_file, '/');
- if (last_slash)
- strcpy (last_slash + 1, onnx_fdata);
+ if (last_slash != NULL)
+ {
+ size_t prefix_len = last_slash - native_file + 1;
+ native_file[prefix_len] = '\0';
+ strncat (native_file, replacement, sizeof (native_file) -
+ strlen (native_file) - 1);
+ }
+ }
+ else if (strstr (native_file, target_cc1) != NULL ||
+ strstr (native_file, target_cc1plus) != NULL ||
+ strstr (native_file, target_f951) != NULL)
+ {
+ char *last_slash = strrchr (native_file, '/');
+ if (last_slash != NULL)
+ {
+ size_t prefix_len = last_slash - native_file + 1;
+ native_file[prefix_len] = '\0';
+ strncat (native_file, replacement_front_end, sizeof (native_file) -
+ strlen (native_file) - 1);
+ }
}
if (access (native_file, F_OK) == 0)
diff --git a/gcc/ai4c-infer.cc b/gcc/ai4c-infer.cc
index 42922e1ca..4cd4bfb00 100644
--- a/gcc/ai4c-infer.cc
+++ b/gcc/ai4c-infer.cc
@@ -333,29 +333,11 @@ preprocess (int argc, int64_t *argv, int64_t *in_modes)
static int
graph_infer (int argc, const char *argv, int argc2, int64_t *argv2)
{
- char *gcc_exec_prefix = getenv ("ONNX_FDATA_PATH");
- if (gcc_exec_prefix == NULL)
- return 0;
- char file_name[512];
-
- if (gcc_exec_prefix)
- {
- const char *onnx_fdata = "onnx.fdata";
- strncpy (file_name, gcc_exec_prefix, sizeof (file_name) - 1);
- file_name[sizeof (file_name) - 1] = '\0';
- char *last_slash = strrchr (file_name, '/');
- if (last_slash)
- strcpy (last_slash + 1, onnx_fdata);
- }
-
+ const char *file_name = getenv ("GCC_AI4C_ONNX_FDATA");
if (access (file_name, F_OK) == 0)
- {
- fill_node (file_name);
- }
+ fill_node (file_name);
else
- {
- return 0;
- }
+ return 0;
int64_t in_modes[M_MODE_SIZE];
@@ -441,9 +423,7 @@ int
get_optimize_decision_from_ai4c ()
{
if (initialized== 1)
- {
- return optimize_result;
- }
+ return optimize_result;
if (native_tune && (strchr (native_tune, '+') != NULL))
{
char hash[65];
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 179d507f2..b4beb1957 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -8133,6 +8133,7 @@ driver::main (int argc, char **argv)
putenv_COLLECT_GCC (argv[0]);
maybe_putenv_COLLECT_LTO_WRAPPER ();
maybe_putenv_OFFLOAD_TARGETS ();
+ putenv_ONNX_FDATA ();
handle_unrecognized_options ();
if (completion)
@@ -8189,9 +8190,6 @@ driver::expand_at_files (int *argc, char ***argv) const
void
driver::decode_argv (int argc, const char **argv)
{
- const char* libexec_path = standard_libexec_prefix;
- if (libexec_path)
- setenv ("ONNX_FDATA_PATH", libexec_path, 1);
init_opts_obstack ();
init_options_struct (&global_options, &global_options_set);
@@ -8590,6 +8588,33 @@ driver::maybe_putenv_COLLECT_LTO_WRAPPER () const
}
+/* Set up to remember the pathname of the onnx.fdata. */
+
+void
+driver::putenv_ONNX_FDATA () const
+{
+ char *lto_wrapper_file;
+ lto_wrapper_file = find_a_program ("lto-wrapper");
+
+ if (lto_wrapper_file)
+ {
+ lto_wrapper_file = convert_white_space (lto_wrapper_file);
+ char native_file[512];
+ const char *onnx_fdata = "../../onnx.fdata";
+ strncpy (native_file, lto_wrapper_file, sizeof (native_file) - 1);
+ native_file[sizeof (native_file) - 1] = '\0';
+ char *last_slash = strrchr (native_file, '/');
+ if (last_slash)
+ strcpy (last_slash + 1, onnx_fdata);
+ obstack_init (&collect_obstack);
+ obstack_grow (&collect_obstack, "GCC_AI4C_ONNX_FDATA=",
+ sizeof ("GCC_AI4C_ONNX_FDATA=") - 1);
+ obstack_grow (&collect_obstack, native_file,
+ strlen ( native_file) + 1);
+ xputenv (XOBFINISH (&collect_obstack, char *));
+ }
+}
+
/* Set up to remember the names of offload targets. */
void
diff --git a/gcc/gcc.h b/gcc/gcc.h
index 63231ddb3..ff3ae8bed 100644
--- a/gcc/gcc.h
+++ b/gcc/gcc.h
@@ -44,6 +44,7 @@ class driver
void set_up_specs () const;
void putenv_COLLECT_GCC (const char *argv0) const;
void maybe_putenv_COLLECT_LTO_WRAPPER () const;
+ void putenv_ONNX_FDATA () const;
void maybe_putenv_OFFLOAD_TARGETS () const;
void handle_unrecognized_options ();
int maybe_print_and_exit () const;
--
2.43.0

View File

@ -2,7 +2,7 @@
%global gcc_major 12
# Note, gcc_release must be integer, if you want to add suffixes to
# %%{release}, append them after %%{gcc_release} on Release: line.
%global gcc_release 59
%global gcc_release 57
%global _unpackaged_files_terminate_build 0
%global _performance_build 1
@ -428,16 +428,6 @@ Patch319: 0319-CSPGO-fix-bugs-when-using-cspgo.patch
Patch320: 0320-if-split-fix-bugs.patch
Patch321: 0321-Struct-reorg-Avoid-doing-struct-split-and-reorder_fi.patch
Patch322: 0322-Bugfix-Create-POINTER_PLUS_EXPR-for-REFERENCE_TYPE.patch
Patch323: 0323-fix-function-missing-return-value.patch
Patch324: 0324-Bugfix-replace-tmp-pattern-split.patch
Patch325: 0325-bugfix-fix-vector-costs-for-hip09.patch
Patch326: 0326-gcc-opts-common.cc-Fix-build-with-clang.patch
Patch327: 0327-BUGFIX-Fix-build-error-on-risv_64.patch
Patch328: 0328-Bugfix-Adjust-the-same-gate-to-use-struct-option.patch
Patch329: 0329-Bugfix-if-split-Added-checking-for-ssa_name.patch
Patch330: 0330-Fixed-work-with-loops-in-process_complex_cond.patch
Patch331: 0331-bugfix-fix-typo-error.patch
Patch332: 0332-Bugfix-Can-not-find-fdata-file.patch
# Part 1001-1999
%ifarch sw_64
@ -1546,16 +1536,6 @@ not stable, so plugins must be rebuilt any time GCC is updated.
%patch -P320 -p1
%patch -P321 -p1
%patch -P322 -p1
%patch -P323 -p1
%patch -P324 -p1
%patch -P325 -p1
%patch -P326 -p1
%patch -P327 -p1
%patch -P328 -p1
%patch -P329 -p1
%patch -P330 -p1
%patch -P331 -p1
%patch -P332 -p1
%ifarch sw_64
%patch -P1001 -p1
@ -3181,8 +3161,7 @@ end
%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/lto-wrapper
%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/liblto_plugin.so*
%{_libdir}/bfd-plugins/liblto_plugin.so
%{_prefix}/libexec/gcc/onnx.fdata
%{_prefix}/libexec/gcc/optimizer.fdata
%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/onnx.fdata
%ifarch aarch64
%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/libbolt_plugin.so*
%endif
@ -4179,18 +4158,6 @@ end
%doc rpm.doc/changelogs/libcc1/ChangeLog*
%changelog
* Mon Dec 30 2024 Zhenyu Zhao <zhaozhenyu17@huawei.com> - 12.3.1-59
- Type:Bugfix
- ID:NA
- SUG:NA
- DESC:Sync patches from openeuler/gcc.
* Thu Dec 26 2024 rfwang07 <wangrufeng5@huawei.com> - 12.3.1-58
- Type:Bugfix
- ID:NA
- SUG:NA
- DESC:Fix function missing return value.
* Mon Dec 09 2024 liyancheng <412998149@qq.com> - 12.3.1-57
- Type:Bugfix
- ID:NA