[Sync] Sync patch from openeuler/gcc
(cherry picked from commit 795c78916bae7f2434855935d301fffb709d2f85)
This commit is contained in:
parent
5b9299ef5f
commit
81983f5b97
170
0093-gimple-Factor-the-code-to-avoid-depending-auto-featu.patch
Normal file
170
0093-gimple-Factor-the-code-to-avoid-depending-auto-featu.patch
Normal file
@ -0,0 +1,170 @@
|
||||
From 3cddb0b4960e5983404bbebb11e31ffb62e98350 Mon Sep 17 00:00:00 2001
|
||||
From: zhongyunde <zhongyunde@huawei.com>
|
||||
Date: Sat, 13 May 2023 10:04:02 +0800
|
||||
Subject: [PATCH 1/5] [gimple] Factor the code to avoid depending auto feature
|
||||
|
||||
The lambda function with captrue can't use a function pointer
|
||||
to express, so use a class to model.
|
||||
---
|
||||
gcc/config/aarch64/aarch64.c | 8 +--
|
||||
gcc/gimple-match-head.c | 115 ++++++++++++++++++++++++-----------
|
||||
2 files changed, 85 insertions(+), 38 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
|
||||
index 85dbd3898..10e037325 100644
|
||||
--- a/gcc/config/aarch64/aarch64.c
|
||||
+++ b/gcc/config/aarch64/aarch64.c
|
||||
@@ -3098,10 +3098,10 @@ aarch64_maxmin_plus_const (rtx_code code, rtx *operands, bool generate_p)
|
||||
== x <= y ? x - y : 0 [z == y]
|
||||
== x < y ? x - y : 0 [z == y]
|
||||
== x < y + 1 ? x - (y + 1) : -1 [z == y + 1]. */
|
||||
- auto maxmin_val = rtx_mode_t (maxmin_op, mode);
|
||||
- auto add_val = rtx_mode_t (add_op, mode);
|
||||
- auto sub_val = wi::neg (add_val);
|
||||
- auto diff = wi::sub (maxmin_val, sub_val);
|
||||
+ rtx_mode_t maxmin_val = rtx_mode_t (maxmin_op, mode);
|
||||
+ rtx_mode_t add_val = rtx_mode_t (add_op, mode);
|
||||
+ wide_int sub_val = wi::neg (add_val);
|
||||
+ wide_int diff = wi::sub (maxmin_val, sub_val);
|
||||
if (!(diff == 0
|
||||
|| (diff == 1 && wi::gt_p (maxmin_val, sub_val, sgn))
|
||||
|| (diff == -1 && wi::lt_p (maxmin_val, sub_val, sgn))))
|
||||
diff --git a/gcc/gimple-match-head.c b/gcc/gimple-match-head.c
|
||||
index c1dea1734..061aef39c 100644
|
||||
--- a/gcc/gimple-match-head.c
|
||||
+++ b/gcc/gimple-match-head.c
|
||||
@@ -1023,10 +1023,87 @@ gimple_extract (gimple *stmt, gimple_match_op *res_op,
|
||||
bool
|
||||
gimple_extract_op (gimple *stmt, gimple_match_op *res_op)
|
||||
{
|
||||
- auto nop = [](tree op) { return op; };
|
||||
+ /* This function is not called by other function now, so leave the
|
||||
+ lambda to minimize modifiers. */
|
||||
+ tree (*nop)(tree) = [](tree op)
|
||||
+ {
|
||||
+ return op;
|
||||
+ };
|
||||
return gimple_extract (stmt, res_op, nop, nop);
|
||||
}
|
||||
|
||||
+/* The std=gnu++98 doesn't support c++ auto feature, and the origin
|
||||
+ lambda capture some variables, so they can't be replaced with a
|
||||
+ simple function pointer. */
|
||||
+class __lambda_valueize
|
||||
+{
|
||||
+ typedef tree (*tree_op_func)(tree);
|
||||
+
|
||||
+ public:
|
||||
+ inline tree operator () (tree op) const
|
||||
+ {
|
||||
+ return do_valueize (op, top_valueize, valueized);
|
||||
+ }
|
||||
+
|
||||
+ private:
|
||||
+ tree_op_func &top_valueize;
|
||||
+ bool &valueized;
|
||||
+
|
||||
+ public:
|
||||
+ __lambda_valueize (tree_op_func &_top_valueize, bool &_valueized)
|
||||
+ : top_valueize{_top_valueize}, valueized {_valueized}
|
||||
+ {}
|
||||
+};
|
||||
+
|
||||
+class __lambda_condition
|
||||
+{
|
||||
+ typedef tree (*tree_op_func)(tree);
|
||||
+
|
||||
+ public:
|
||||
+ inline tree operator () (tree op) const
|
||||
+ {
|
||||
+ bool cond_valueized = false;
|
||||
+ tree lhs = do_valueize (TREE_OPERAND (op, 0), top_valueize,
|
||||
+ cond_valueized);
|
||||
+ tree rhs = do_valueize (TREE_OPERAND (op, 1), top_valueize,
|
||||
+ cond_valueized);
|
||||
+ gimple_match_op res_op2 (res_op->cond, TREE_CODE (op),
|
||||
+ TREE_TYPE (op), lhs, rhs);
|
||||
+ if ((gimple_resimplify2 (seq, &res_op2, valueize) || cond_valueized)
|
||||
+ && res_op2.code.is_tree_code ())
|
||||
+ {
|
||||
+ if (TREE_CODE_CLASS ((tree_code) res_op2.code) == tcc_comparison)
|
||||
+ {
|
||||
+ valueized = true;
|
||||
+ return build2 (res_op2.code, TREE_TYPE (op), res_op2.ops[0],
|
||||
+ res_op2.ops[1]);
|
||||
+ }
|
||||
+ else if (res_op2.code == SSA_NAME
|
||||
+ || res_op2.code == INTEGER_CST
|
||||
+ || res_op2.code == VECTOR_CST)
|
||||
+ {
|
||||
+ valueized = true;
|
||||
+ return res_op2.ops[0];
|
||||
+ }
|
||||
+ }
|
||||
+ return do_valueize (op, top_valueize, valueized);
|
||||
+ }
|
||||
+
|
||||
+ private:
|
||||
+ tree_op_func &top_valueize;
|
||||
+ tree_op_func &valueize;
|
||||
+ bool &valueized;
|
||||
+ gimple_match_op *&res_op;
|
||||
+ gimple_seq *&seq;
|
||||
+
|
||||
+ public:
|
||||
+ __lambda_condition (tree_op_func &_top_valueize, tree_op_func &_valueize,
|
||||
+ bool &_valueized, gimple_match_op *&_res_op, gimple_seq *&_seq)
|
||||
+ : top_valueize{_top_valueize}, valueize{_valueize}, valueized {_valueized},
|
||||
+ res_op {_res_op}, seq {_seq}
|
||||
+ {}
|
||||
+};
|
||||
+
|
||||
/* The main STMT based simplification entry. It is used by the fold_stmt
|
||||
and the fold_stmt_to_constant APIs. */
|
||||
|
||||
@@ -1035,39 +1112,9 @@ gimple_simplify (gimple *stmt, gimple_match_op *res_op, gimple_seq *seq,
|
||||
tree (*valueize)(tree), tree (*top_valueize)(tree))
|
||||
{
|
||||
bool valueized = false;
|
||||
- auto valueize_op = [&](tree op)
|
||||
- {
|
||||
- return do_valueize (op, top_valueize, valueized);
|
||||
- };
|
||||
- auto valueize_condition = [&](tree op) -> tree
|
||||
- {
|
||||
- bool cond_valueized = false;
|
||||
- tree lhs = do_valueize (TREE_OPERAND (op, 0), top_valueize,
|
||||
- cond_valueized);
|
||||
- tree rhs = do_valueize (TREE_OPERAND (op, 1), top_valueize,
|
||||
- cond_valueized);
|
||||
- gimple_match_op res_op2 (res_op->cond, TREE_CODE (op),
|
||||
- TREE_TYPE (op), lhs, rhs);
|
||||
- if ((gimple_resimplify2 (seq, &res_op2, valueize)
|
||||
- || cond_valueized)
|
||||
- && res_op2.code.is_tree_code ())
|
||||
- {
|
||||
- if (TREE_CODE_CLASS ((tree_code) res_op2.code) == tcc_comparison)
|
||||
- {
|
||||
- valueized = true;
|
||||
- return build2 (res_op2.code, TREE_TYPE (op),
|
||||
- res_op2.ops[0], res_op2.ops[1]);
|
||||
- }
|
||||
- else if (res_op2.code == SSA_NAME
|
||||
- || res_op2.code == INTEGER_CST
|
||||
- || res_op2.code == VECTOR_CST)
|
||||
- {
|
||||
- valueized = true;
|
||||
- return res_op2.ops[0];
|
||||
- }
|
||||
- }
|
||||
- return valueize_op (op);
|
||||
- };
|
||||
+ __lambda_valueize valueize_op = __lambda_valueize{top_valueize, valueized};
|
||||
+ __lambda_condition valueize_condition = __lambda_condition{top_valueize,
|
||||
+ valueize, valueized, res_op, seq};
|
||||
|
||||
if (!gimple_extract (stmt, res_op, valueize_op, valueize_condition))
|
||||
return false;
|
||||
--
|
||||
2.33.0
|
||||
|
||||
112
0094-StructReorg-Fix-escape_cast_another_ptr-check-bug.patch
Normal file
112
0094-StructReorg-Fix-escape_cast_another_ptr-check-bug.patch
Normal file
@ -0,0 +1,112 @@
|
||||
From 9527d026dceb1e4f9d9f5c117dacfdfa65ce2735 Mon Sep 17 00:00:00 2001
|
||||
From: Mingchuan Wu <wumingchuan1992@foxmail.com>
|
||||
Date: Tue, 23 May 2023 21:03:58 +0800
|
||||
Subject: [PATCH 2/5] [StructReorg] Fix escape_cast_another_ptr check bug
|
||||
|
||||
In the other side check, escape mark is added
|
||||
when the replacement struct type exists.
|
||||
---
|
||||
gcc/ipa-struct-reorg/ipa-struct-reorg.c | 15 +++---
|
||||
.../struct/wo_prof_escape_replace_type.c | 49 +++++++++++++++++++
|
||||
2 files changed, 57 insertions(+), 7 deletions(-)
|
||||
create mode 100644 gcc/testsuite/gcc.dg/struct/wo_prof_escape_replace_type.c
|
||||
|
||||
diff --git a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-struct-reorg.c
|
||||
index 2cac340c7..218140f58 100644
|
||||
--- a/gcc/ipa-struct-reorg/ipa-struct-reorg.c
|
||||
+++ b/gcc/ipa-struct-reorg/ipa-struct-reorg.c
|
||||
@@ -688,6 +688,8 @@ srtype::analyze (void)
|
||||
info and/or static heuristics to differentiate splitting process. */
|
||||
if (fields.length () == 2)
|
||||
{
|
||||
+ /* Currently, when the replacement structure type exists,
|
||||
+ we only split the replacement structure. */
|
||||
for (hash_map<tree, tree>::iterator it = replace_type_map.begin ();
|
||||
it != replace_type_map.end (); ++it)
|
||||
{
|
||||
@@ -4921,7 +4923,9 @@ ipa_struct_reorg::check_other_side (srdecl *decl, tree other, gimple *stmt, vec<
|
||||
}
|
||||
|
||||
srtype *t1 = find_type (inner_type (t));
|
||||
- if (t1 == type)
|
||||
+ /* In the other side check, escape mark is added
|
||||
+ when the replacement struct type exists. */
|
||||
+ if (t1 == type || is_replace_type (inner_type (t), type->type))
|
||||
{
|
||||
/* In Complete Struct Relayout opti, if lhs type is the same
|
||||
as rhs type, we could return without any harm. */
|
||||
@@ -4961,13 +4965,10 @@ ipa_struct_reorg::check_other_side (srdecl *decl, tree other, gimple *stmt, vec<
|
||||
|
||||
return;
|
||||
}
|
||||
- if (!is_replace_type (inner_type (t), type->type))
|
||||
- {
|
||||
- if (t1)
|
||||
- t1->mark_escape (escape_cast_another_ptr, stmt);
|
||||
+ if (t1)
|
||||
+ t1->mark_escape (escape_cast_another_ptr, stmt);
|
||||
|
||||
- type->mark_escape (escape_cast_another_ptr, stmt);
|
||||
- }
|
||||
+ type->mark_escape (escape_cast_another_ptr, stmt);
|
||||
}
|
||||
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_replace_type.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_replace_type.c
|
||||
new file mode 100644
|
||||
index 000000000..d0a7b505e
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_replace_type.c
|
||||
@@ -0,0 +1,49 @@
|
||||
+/* { dg-do compile } */
|
||||
+
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+struct AngleDef
|
||||
+{
|
||||
+ double K;
|
||||
+ double th0;
|
||||
+};
|
||||
+typedef struct AngleDef angldef;
|
||||
+
|
||||
+struct bndangdihe
|
||||
+{
|
||||
+ int nbond;
|
||||
+ int nangl;
|
||||
+ int ndihe;
|
||||
+};
|
||||
+typedef struct bndangdihe bah;
|
||||
+
|
||||
+struct ambprmtop
|
||||
+{
|
||||
+ double *AnglK;
|
||||
+ double *AnglEq;
|
||||
+ bah nBAH;
|
||||
+ angldef *AParam;
|
||||
+ char source[512];
|
||||
+ char eprulesource[512];
|
||||
+};
|
||||
+typedef struct ambprmtop prmtop;
|
||||
+
|
||||
+static void OrderBondParameters (prmtop *tp)
|
||||
+{
|
||||
+ int i;
|
||||
+ tp->AParam = (angldef *)malloc (tp->nBAH.nangl * sizeof (angldef));
|
||||
+ for (i = 0; i < tp->nBAH.nangl; i++)
|
||||
+ {
|
||||
+ tp->AParam[i].K = tp->AnglK[i];
|
||||
+ tp->AParam[i].th0 = tp->AnglEq[i];
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void main ()
|
||||
+{
|
||||
+ prmtop *tp = (prmtop *)malloc (100 * sizeof (prmtop));
|
||||
+ OrderBondParameters (tp);
|
||||
+}
|
||||
+
|
||||
+/*---------------------------------------------------------------------------------------------*/
|
||||
+/* { dg-final { scan-ipa-dump "No structures to transform in struct split." "struct_reorg" } } */
|
||||
--
|
||||
2.33.0
|
||||
|
||||
172
0095-Backport-Fix-zero-masking-for-vcvtps2ph-when-dest-op.patch
Normal file
172
0095-Backport-Fix-zero-masking-for-vcvtps2ph-when-dest-op.patch
Normal file
@ -0,0 +1,172 @@
|
||||
From 5b473317f6b1890238f1778d0fdebf8ed09292d9 Mon Sep 17 00:00:00 2001
|
||||
From: liuhongt <hongtao.liu@intel.com>
|
||||
Date: Fri, 29 May 2020 13:38:49 +0800
|
||||
Subject: [PATCH 3/5] [Backport] Fix zero-masking for vcvtps2ph when dest
|
||||
operand is memory.
|
||||
|
||||
Reference: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=43088bb4dadd3d14b6b594c5f9363fe879f3d7f7
|
||||
|
||||
When dest is memory, zero-masking is not valid, only merging-masking is available,
|
||||
|
||||
2020-06-24 Hongtao Liu <hongtao.liu@inte.com>
|
||||
|
||||
gcc/ChangeLog:
|
||||
PR target/95254
|
||||
* config/i386/sse.md (*vcvtps2ph_store<merge_mask_name>):
|
||||
Refine from *vcvtps2ph_store<mask_name>.
|
||||
(vcvtps2ph256<mask_name>): Refine constraint from vm to v.
|
||||
(<mask_codefor>avx512f_vcvtps2ph512<mask_name>): Ditto.
|
||||
(*vcvtps2ph256<merge_mask_name>): New define_insn.
|
||||
(*avx512f_vcvtps2ph512<merge_mask_name>): Ditto.
|
||||
* config/i386/subst.md (merge_mask): New define_subst.
|
||||
(merge_mask_name): New define_subst_attr.
|
||||
(merge_mask_operand3): Ditto.
|
||||
|
||||
gcc/testsuite/ChangeLog:
|
||||
* gcc.target/i386/avx512f-vcvtps2ph-pr95254.c: New test.
|
||||
* gcc.target/i386/avx512vl-vcvtps2ph-pr95254.c: Ditto.
|
||||
---
|
||||
gcc/config/i386/sse.md | 32 ++++++++++++++++---
|
||||
gcc/config/i386/subst.md | 12 +++++++
|
||||
.../i386/avx512f-vcvtps2ph-pr95254.c | 12 +++++++
|
||||
.../i386/avx512vl-vcvtps2ph-pr95254.c | 18 +++++++++++
|
||||
4 files changed, 70 insertions(+), 4 deletions(-)
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/avx512f-vcvtps2ph-pr95254.c
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/avx512vl-vcvtps2ph-pr95254.c
|
||||
|
||||
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
|
||||
index bf01e1d74..915b8e3d2 100644
|
||||
--- a/gcc/config/i386/sse.md
|
||||
+++ b/gcc/config/i386/sse.md
|
||||
@@ -21354,19 +21354,19 @@
|
||||
(set_attr "prefix" "maybe_evex")
|
||||
(set_attr "mode" "V4SF")])
|
||||
|
||||
-(define_insn "*vcvtps2ph_store<mask_name>"
|
||||
+(define_insn "*vcvtps2ph_store<merge_mask_name>"
|
||||
[(set (match_operand:V4HI 0 "memory_operand" "=m")
|
||||
(unspec:V4HI [(match_operand:V4SF 1 "register_operand" "v")
|
||||
(match_operand:SI 2 "const_0_to_255_operand" "N")]
|
||||
UNSPEC_VCVTPS2PH))]
|
||||
"TARGET_F16C || TARGET_AVX512VL"
|
||||
- "vcvtps2ph\t{%2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2}"
|
||||
+ "vcvtps2ph\t{%2, %1, %0<merge_mask_operand3>|%0<merge_mask_operand3>, %1, %2}"
|
||||
[(set_attr "type" "ssecvt")
|
||||
(set_attr "prefix" "maybe_evex")
|
||||
(set_attr "mode" "V4SF")])
|
||||
|
||||
(define_insn "vcvtps2ph256<mask_name>"
|
||||
- [(set (match_operand:V8HI 0 "nonimmediate_operand" "=vm")
|
||||
+ [(set (match_operand:V8HI 0 "register_operand" "=v")
|
||||
(unspec:V8HI [(match_operand:V8SF 1 "register_operand" "v")
|
||||
(match_operand:SI 2 "const_0_to_255_operand" "N")]
|
||||
UNSPEC_VCVTPS2PH))]
|
||||
@@ -21377,8 +21377,20 @@
|
||||
(set_attr "btver2_decode" "vector")
|
||||
(set_attr "mode" "V8SF")])
|
||||
|
||||
+(define_insn "*vcvtps2ph256<merge_mask_name>"
|
||||
+ [(set (match_operand:V8HI 0 "memory_operand" "=m")
|
||||
+ (unspec:V8HI [(match_operand:V8SF 1 "register_operand" "v")
|
||||
+ (match_operand:SI 2 "const_0_to_255_operand" "N")]
|
||||
+ UNSPEC_VCVTPS2PH))]
|
||||
+ "TARGET_F16C || TARGET_AVX512VL"
|
||||
+ "vcvtps2ph\t{%2, %1, %0<merge_mask_operand3>|%0<merge_mask_operand3>, %1, %2}"
|
||||
+ [(set_attr "type" "ssecvt")
|
||||
+ (set_attr "prefix" "maybe_evex")
|
||||
+ (set_attr "btver2_decode" "vector")
|
||||
+ (set_attr "mode" "V8SF")])
|
||||
+
|
||||
(define_insn "<mask_codefor>avx512f_vcvtps2ph512<mask_name>"
|
||||
- [(set (match_operand:V16HI 0 "nonimmediate_operand" "=vm")
|
||||
+ [(set (match_operand:V16HI 0 "register_operand" "=v")
|
||||
(unspec:V16HI
|
||||
[(match_operand:V16SF 1 "register_operand" "v")
|
||||
(match_operand:SI 2 "const_0_to_255_operand" "N")]
|
||||
@@ -21389,6 +21401,18 @@
|
||||
(set_attr "prefix" "evex")
|
||||
(set_attr "mode" "V16SF")])
|
||||
|
||||
+(define_insn "*avx512f_vcvtps2ph512<merge_mask_name>"
|
||||
+ [(set (match_operand:V16HI 0 "memory_operand" "=m")
|
||||
+ (unspec:V16HI
|
||||
+ [(match_operand:V16SF 1 "register_operand" "v")
|
||||
+ (match_operand:SI 2 "const_0_to_255_operand" "N")]
|
||||
+ UNSPEC_VCVTPS2PH))]
|
||||
+ "TARGET_AVX512F"
|
||||
+ "vcvtps2ph\t{%2, %1, %0<merge_mask_operand3>|%0<merge_mask_operand3>, %1, %2}"
|
||||
+ [(set_attr "type" "ssecvt")
|
||||
+ (set_attr "prefix" "evex")
|
||||
+ (set_attr "mode" "V16SF")])
|
||||
+
|
||||
;; For gather* insn patterns
|
||||
(define_mode_iterator VEC_GATHER_MODE
|
||||
[V2DI V2DF V4DI V4DF V4SI V4SF V8SI V8SF])
|
||||
diff --git a/gcc/config/i386/subst.md b/gcc/config/i386/subst.md
|
||||
index 4a1c9b080..27eb3430d 100644
|
||||
--- a/gcc/config/i386/subst.md
|
||||
+++ b/gcc/config/i386/subst.md
|
||||
@@ -75,6 +75,18 @@
|
||||
(match_operand:SUBST_V 2 "nonimm_or_0_operand" "0C")
|
||||
(match_operand:<avx512fmaskmode> 3 "register_operand" "Yk")))])
|
||||
|
||||
+(define_subst_attr "merge_mask_name" "merge_mask" "" "_merge_mask")
|
||||
+(define_subst_attr "merge_mask_operand3" "merge_mask" "" "%{%3%}")
|
||||
+(define_subst "merge_mask"
|
||||
+ [(set (match_operand:SUBST_V 0)
|
||||
+ (match_operand:SUBST_V 1))]
|
||||
+ "TARGET_AVX512F"
|
||||
+ [(set (match_dup 0)
|
||||
+ (vec_merge:SUBST_V
|
||||
+ (match_dup 1)
|
||||
+ (match_dup 0)
|
||||
+ (match_operand:<avx512fmaskmode> 2 "register_operand" "Yk")))])
|
||||
+
|
||||
(define_subst_attr "mask_scalar_merge_name" "mask_scalar_merge" "" "_mask")
|
||||
(define_subst_attr "mask_scalar_merge_operand3" "mask_scalar_merge" "" "%{%3%}")
|
||||
(define_subst_attr "mask_scalar_merge_operand4" "mask_scalar_merge" "" "%{%4%}")
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvtps2ph-pr95254.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvtps2ph-pr95254.c
|
||||
new file mode 100644
|
||||
index 000000000..9e0da9473
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvtps2ph-pr95254.c
|
||||
@@ -0,0 +1,12 @@
|
||||
+/* { dg-do compile } */
|
||||
+/* { dg-options "-O2 -mavx512f" } */
|
||||
+
|
||||
+#include<immintrin.h>
|
||||
+extern __m256i res;
|
||||
+void
|
||||
+foo (__m512 a, __mmask16 m)
|
||||
+{
|
||||
+ res = _mm512_maskz_cvtps_ph (m, a, 10);
|
||||
+}
|
||||
+
|
||||
+/* { dg-final { scan-assembler-not "vcvtps2ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]\[^\n\]*res\[^\n\]*\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)"} } */
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vcvtps2ph-pr95254.c b/gcc/testsuite/gcc.target/i386/avx512vl-vcvtps2ph-pr95254.c
|
||||
new file mode 100644
|
||||
index 000000000..0c685ea66
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/avx512vl-vcvtps2ph-pr95254.c
|
||||
@@ -0,0 +1,18 @@
|
||||
+/* { dg-do compile } */
|
||||
+/* { dg-options "-O2 -mavx512vl -mavx512f" } */
|
||||
+
|
||||
+#include<immintrin.h>
|
||||
+extern __m128i res;
|
||||
+void
|
||||
+foo (__m256 a, __mmask8 m)
|
||||
+{
|
||||
+ res = _mm256_maskz_cvtps_ph (m, a, 10);
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+foo1 (__m128 a, __mmask8 m)
|
||||
+{
|
||||
+ res = _mm_maskz_cvtps_ph (m, a, 10);
|
||||
+}
|
||||
+
|
||||
+/* { dg-final { scan-assembler-not "vcvtps2ph\[ \\t\]+\[^\{\n\]*%\[xy\]mm\[0-9\]\[^\n\]*res\[^\n\]*\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)"} } */
|
||||
--
|
||||
2.33.0
|
||||
|
||||
49
0096-Struct-reorg-Fix-the-use-of-as_a.patch
Normal file
49
0096-Struct-reorg-Fix-the-use-of-as_a.patch
Normal file
@ -0,0 +1,49 @@
|
||||
From 1ab2b199a30db4ec605581a5a23b5c258a127db6 Mon Sep 17 00:00:00 2001
|
||||
From: dingguangya <dingguangya1@huawei.com>
|
||||
Date: Fri, 26 May 2023 09:27:38 +0800
|
||||
Subject: [PATCH 4/5] [Struct reorg] Fix the use of as_a
|
||||
|
||||
The as_a function is an internal type conversion
|
||||
function in gcc, which should be: gimple * ->gcond * when used,
|
||||
so fix the problem with function usage at this.
|
||||
---
|
||||
gcc/ipa-struct-reorg/ipa-struct-reorg.c | 9 +++------
|
||||
1 file changed, 3 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-struct-reorg.c
|
||||
index 2cac340c7..b0e4624b2 100644
|
||||
--- a/gcc/ipa-struct-reorg/ipa-struct-reorg.c
|
||||
+++ b/gcc/ipa-struct-reorg/ipa-struct-reorg.c
|
||||
@@ -6607,8 +6607,7 @@ ipa_struct_reorg::compress_candidate_with_check (gimple_stmt_iterator *gsi,
|
||||
gimple_set_location (cond, UNKNOWN_LOCATION);
|
||||
gsi_insert_before (gsi, cond, GSI_SAME_STMT);
|
||||
|
||||
- gimple* cur_stmt = as_a <gimple *> (cond);
|
||||
- edge e = split_block (cur_stmt->bb, cur_stmt);
|
||||
+ edge e = split_block (cond->bb, cond);
|
||||
basic_block split_src_bb = e->src;
|
||||
basic_block split_dst_bb = e->dest;
|
||||
|
||||
@@ -6847,8 +6846,7 @@ ipa_struct_reorg::decompress_candidate_with_check (gimple_stmt_iterator *gsi,
|
||||
gsi_insert_before (gsi, cond, GSI_SAME_STMT);
|
||||
|
||||
/* Split bb. */
|
||||
- gimple* cur_stmt = as_a <gimple *> (cond);
|
||||
- edge e = split_block (cur_stmt->bb, cur_stmt);
|
||||
+ edge e = split_block (cond->bb, cond);
|
||||
basic_block split_src_bb = e->src;
|
||||
basic_block split_dst_bb = e->dest;
|
||||
|
||||
@@ -7133,8 +7131,7 @@ ipa_struct_reorg::rewrite_pointer_plus_integer (gimple *stmt,
|
||||
gimple_set_location (cond, UNKNOWN_LOCATION);
|
||||
gsi_insert_before (gsi, cond, GSI_SAME_STMT);
|
||||
|
||||
- gimple *curr_stmt = as_a <gimple *> (cond);
|
||||
- edge e = split_block (curr_stmt->bb, curr_stmt);
|
||||
+ edge e = split_block (cond->bb, cond);
|
||||
basic_block split_src_bb = e->src;
|
||||
basic_block split_dst_bb = e->dest;
|
||||
remove_edge_raw (e);
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
From 90d3ef0637c66045eeab78ccf04e9ff51b9b451a Mon Sep 17 00:00:00 2001
|
||||
From: xiongzhou4 <xiongzhou4@huawei.com>
|
||||
Date: Thu, 1 Jun 2023 09:28:27 +0800
|
||||
Subject: [PATCH 5/5] [PGO kernel] Add fkernel-pgo option to support PGO kernel
|
||||
compilation.
|
||||
|
||||
If specified, disable TLS setting of instrumentation variables in
|
||||
gcc/tree-profile.c, as kernel does not support TLS.
|
||||
---
|
||||
gcc/common.opt | 4 ++++
|
||||
gcc/tree-profile.c | 4 +++-
|
||||
2 files changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gcc/common.opt b/gcc/common.opt
|
||||
index 238c97db8..6f0ed7cea 100644
|
||||
--- a/gcc/common.opt
|
||||
+++ b/gcc/common.opt
|
||||
@@ -2302,6 +2302,10 @@ fprofile-generate=
|
||||
Common Joined RejectNegative
|
||||
Enable common options for generating profile info for profile feedback directed optimizations, and set -fprofile-dir=.
|
||||
|
||||
+fkernel-pgo
|
||||
+Common Report Var(flag_kernel_pgo) Optimization Init(0)
|
||||
+Disable TLS setting of instrumentation variables to support PGO kernel compilation in -fprofile-generate, as kernel does not support TLS.
|
||||
+
|
||||
fprofile-partial-training
|
||||
Common Report Var(flag_profile_partial_training) Optimization
|
||||
Do not assume that functions never executed during the train run are cold.
|
||||
diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c
|
||||
index 6c0838261..924817472 100644
|
||||
--- a/gcc/tree-profile.c
|
||||
+++ b/gcc/tree-profile.c
|
||||
@@ -105,7 +105,9 @@ init_ic_make_global_vars (void)
|
||||
DECL_ARTIFICIAL (ic_tuple_var) = 1;
|
||||
DECL_INITIAL (ic_tuple_var) = NULL;
|
||||
DECL_EXTERNAL (ic_tuple_var) = 1;
|
||||
- if (targetm.have_tls)
|
||||
+ /* Disable TLS setting when compiling kernel in -fprofile-generate,
|
||||
+ as kernel does not support TLS. */
|
||||
+ if (targetm.have_tls && !flag_kernel_pgo)
|
||||
set_decl_tls_model (ic_tuple_var, decl_default_tls_model (ic_tuple_var));
|
||||
}
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
18
gcc.spec
18
gcc.spec
@ -61,7 +61,7 @@
|
||||
Summary: Various compilers (C, C++, Objective-C, ...)
|
||||
Name: gcc
|
||||
Version: %{gcc_version}
|
||||
Release: 29
|
||||
Release: 30
|
||||
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
|
||||
URL: https://gcc.gnu.org
|
||||
|
||||
@ -200,6 +200,11 @@ Patch88: 0088-Backport-fix-typo-causing-ICE.patch
|
||||
Patch90: 0090-State-sysroot-option-as-validated-once-processed.patch
|
||||
Patch91: 0091-bogus-Wstringop-overflow-with-VLA-of-elements-larger.patch
|
||||
Patch92: 0092-phiopt2-Add-option-to-control-the-simplify.patch
|
||||
Patch93: 0093-gimple-Factor-the-code-to-avoid-depending-auto-featu.patch
|
||||
Patch94: 0094-StructReorg-Fix-escape_cast_another_ptr-check-bug.patch
|
||||
Patch95: 0095-Backport-Fix-zero-masking-for-vcvtps2ph-when-dest-op.patch
|
||||
Patch96: 0096-Struct-reorg-Fix-the-use-of-as_a.patch
|
||||
Patch97: 0097-PGO-kernel-Add-fkernel-pgo-option-to-support-PGO-ker.patch
|
||||
|
||||
%global gcc_target_platform %{_arch}-linux-gnu
|
||||
|
||||
@ -745,6 +750,11 @@ not stable, so plugins must be rebuilt any time GCC is updated.
|
||||
%patch90 -p1
|
||||
%patch91 -p1
|
||||
%patch92 -p1
|
||||
%patch93 -p1
|
||||
%patch94 -p1
|
||||
%patch95 -p1
|
||||
%patch96 -p1
|
||||
%patch97 -p1
|
||||
|
||||
%build
|
||||
|
||||
@ -2769,6 +2779,12 @@ end
|
||||
%doc rpm.doc/changelogs/libcc1/ChangeLog*
|
||||
|
||||
%changelog
|
||||
* Fri Jun 2 2023 Wang Ding <wangding16@huawei.com> - 10.3.1-30
|
||||
- Type:Sync
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:Sync patch from openeuler/gcc
|
||||
|
||||
* Wed May 24 2023 liyancheng <412998149@qq.com> - 10.3.1-29
|
||||
- Type:Revert
|
||||
- ID:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user