[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-18 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #21 from Hongtao.liu --- (In reply to Hongtao.liu from comment #20) > (In reply to Richard Biener from comment #19) > > Ah, so the issue is missing -mavx512bw which means we end up with a AVX2 > > style > > mask for V32QImode. With

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-18 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #22 from Hongtao.liu --- (In reply to Hongtao.liu from comment #21) > (In reply to Hongtao.liu from comment #20) > > (In reply to Richard Biener from comment #19) > > > Ah, so the issue is missing -mavx512bw which means we end up wit

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-18 Thread rguenther at suse dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #23 from rguenther at suse dot de --- On Tue, 18 Jan 2022, crazylht at gmail dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 > > --- Comment #22 from Hongtao.liu --- > (In reply to Hongtao.liu from comment #21

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-18 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 Andrew Pinski changed: What|Removed |Added CC||pinskia at gcc dot gnu.org --- Comment

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-18 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #25 from Hongtao.liu --- in fold_unary_loc ---cut from fold-const.cc- 9276 else if (TREE_CODE (arg0) == COND_EXPR) 9277{ 9278 tree arg01 = TREE_OPERAND (arg0, 1); 9279 tree arg02 = TREE_OPERAND

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-18 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #26 from Andrew Pinski --- (In reply to Hongtao.liu from comment #25) > > gcc always tries to simplify (convert (cond (cmp a b) c d) > (cond (cmp > a b) (convert c) (convert d)), exactly the opposite of what this case wants. R

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-18 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #27 from Hongtao.liu --- (In reply to Andrew Pinski from comment #26) > (In reply to Hongtao.liu from comment #25) > > > > gcc always tries to simplify (convert (cond (cmp a b) c d) > (cond (cmp > > a b) (convert c) (convert d)

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-18 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #28 from Richard Biener --- (In reply to Hongtao.liu from comment #25) > in fold_unary_loc > ---cut from fold-const.cc- > 9276 else if (TREE_CODE (arg0) == COND_EXPR) > 9277{ > 9278 tree arg01 = TREE_OPER

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-19 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #29 from Hongtao.liu --- (In reply to Richard Biener from comment #28) > (In reply to Hongtao.liu from comment #25) > > in fold_unary_loc > > ---cut from fold-const.cc- > > 9276 else if (TREE_CODE (arg0) == COND_EXPR) > >

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-19 Thread rguenther at suse dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #30 from rguenther at suse dot de --- On Wed, 19 Jan 2022, crazylht at gmail dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 > > --- Comment #29 from Hongtao.liu --- > (In reply to Richard Biener from comment

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-20 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #31 from CVS Commits --- The master branch has been updated by hongtao Liu : https://gcc.gnu.org/g:8bc700f4c3fbe405413db02281ef2918bfa831fc commit r12-6756-g8bc700f4c3fbe405413db02281ef2918bfa831fc Author: liuhongt Date: Mon Jan

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-26 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #32 from Hongtao.liu --- A patch is posted at https://gcc.gnu.org/pipermail/gcc-patches/2022-January/589168.html

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-31 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 Andrew Pinski changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot gnu.org

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-02-01 Thread law at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #34 from Jeffrey A. Law --- I've always wanted to see us be able to push something like those matched conversions down through the PHI. That would make the code look like: if (x.1_1 > 255) goto ; [INV] else goto ; [INV]

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-02-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #35 from Andrew Pinski --- (In reply to Jeffrey A. Law from comment #34) > I've always wanted to see us be able to push something like those matched > conversions down through the PHI. > > Is that what you're working on? Yes.

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-02-13 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #36 from CVS Commits --- The master branch has been updated by hongtao Liu : https://gcc.gnu.org/g:7e204bd2f189850cb940677c99d8d93eb7dd40cd commit r12-7216-g7e204bd2f189850cb940677c99d8d93eb7dd40cd Author: liuhongt Date: Mon Jan

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-02-13 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #37 from Richard Biener --- Is this now "good enough" for GCC 12?

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-02-13 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #38 from Hongtao.liu --- (In reply to Richard Biener from comment #37) > Is this now "good enough" for GCC 12? Yes.

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-02-13 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 Richard Biener changed: What|Removed |Added Priority|P3 |P2 Target Milestone|12.0

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-02-17 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #40 from CVS Commits --- The master branch has been updated by hongtao Liu : https://gcc.gnu.org/g:754dce903ca28c4c2f2bc8614a8de5e631655f2e commit r12-7276-g754dce903ca28c4c2f2bc8614a8de5e631655f2e Author: liuhongt Date: Wed Feb

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2021-12-20 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 Andrew Pinski changed: What|Removed |Added Summary|Missed vectorization under |[12 Regression] Missed

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-04 Thread tnfchris at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #1 from Tamar Christina --- Looks like the change causes the simpler conditional to be detected by the vectorizer as a masked operation, which in principle makes sense: note: vect_recog_mask_conversion_pattern: detected: iftmp.0_2

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-05 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #2 from Hongtao.liu --- (In reply to Tamar Christina from comment #1) > Looks like the change causes the simpler conditional to be detected by the > vectorizer as a masked operation, which in principle makes sense: > > note: vect_

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-13 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #3 from Hongtao.liu --- for patt_42 = () patt_40; vectype_in (QImode:nunits 4) unit-size align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7fffea18ddc8 precision:1 min max > QI size unit-si

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-13 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #4 from Hongtao.liu --- (In reply to Hongtao.liu from comment #3) > for patt_42 = () patt_40; > > vectype_in (QImode:nunits 4) > > type size > unit-size > align:8 warn_if_not_align:0 symtab:0 alias

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-13 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #5 from Hongtao.liu --- > And GCC vectorizer only handle 2X elements, but not 4X,8X,... > > /* For scalar masks we may have different boolean >vector types having the same QImode. Thus we >add additional chec

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-13 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 Richard Biener changed: What|Removed |Added Ever confirmed|0 |1 Last reconfirmed|

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-13 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #7 from Richard Biener --- Forcing the pattern to not trigger produces the expected t.c:8:6: missed: not vectorized: relevant stmt not supported: iftmp.0_21 = x.1_14 > 255 ? iftmp.0_19 : iftmp.0_20; since condition vectorization

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-13 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #8 from Hongtao.liu --- (In reply to Richard Biener from comment #7) > Forcing the pattern to not trigger produces the expected > > t.c:8:6: missed: not vectorized: relevant stmt not supported: iftmp.0_21 = > x.1_14 > 255 ? iftmp.

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-13 Thread rsandifo at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #9 from rsandifo at gcc dot gnu.org --- (In reply to Richard Biener from comment #7) > I think that is what we need to add. We also don't have a good > representation > for "packing" of masks. > > diff --git a/gcc/tree-vect-patter

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-13 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #10 from Hongtao.liu --- with @@ -12120,7 +12120,8 @@ supportable_narrowing_operation (enum tree_code code, c1 = VEC_PACK_TRUNC_EXPR; if (VECTOR_BOOLEAN_TYPE_P (narrow_vectype) && VECTOR_BOOLEAN_TYPE_P (vectyp

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-13 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #11 from Hongtao.liu --- (In reply to Hongtao.liu from comment #10) > with > @@ -12120,7 +12120,8 @@ supportable_narrowing_operation (enum tree_code code, >c1 = VEC_PACK_TRUNC_EXPR; >if (VECTOR_BOOLEAN_TYPE_P (narrow_

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-13 Thread rguenther at suse dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #12 from rguenther at suse dot de --- On Thu, 13 Jan 2022, crazylht at gmail dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 > > --- Comment #10 from Hongtao.liu --- > with > @@ -12120,7 +12120,8 @@ supportabl

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-13 Thread rguenther at suse dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #13 from rguenther at suse dot de --- On Thu, 13 Jan 2022, rsandifo at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 > > --- Comment #9 from rsandifo at gcc dot gnu.org > --- > (In reply to Richard

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-13 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #14 from Hongtao.liu --- > > But still not as good as before, since original version we only need to pack > data which is produced by vec_cond_expr, but now need to extraly pack mask. > > Also for non-avx512 target, it looks like

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-13 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #15 from Hongtao.liu --- (In reply to rguent...@suse.de from comment #12) > On Thu, 13 Jan 2022, crazylht at gmail dot com wrote: > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 > > > > --- Comment #10 from Hongtao.liu -

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-13 Thread rguenther at suse dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #16 from rguenther at suse dot de --- On Thu, 13 Jan 2022, crazylht at gmail dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 > > --- Comment #15 from Hongtao.liu --- > (In reply to rguent...@suse.de from comme

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-13 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #17 from Hongtao.liu --- > As said, the scalar conversion does not make any sense... Agree.

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-14 Thread rsandifo at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #18 from rsandifo at gcc dot gnu.org --- Again haven't really looked at this in detail, so could be wrong, but: (In reply to rguent...@suse.de from comment #13) > On Thu, 13 Jan 2022, rsandifo at gcc dot gnu.org wrote: > > > https

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-14 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #19 from Richard Biener --- Ah, so the issue is missing -mavx512bw which means we end up with a AVX2 style mask for V32QImode. With -mavx512bw the code vectorizes fine. I guess ix86_get_mask_mode is too restrictive here? And indee

[Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489

2022-01-17 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103771 --- Comment #20 from Hongtao.liu --- (In reply to Richard Biener from comment #19) > Ah, so the issue is missing -mavx512bw which means we end up with a AVX2 > style > mask for V32QImode. With -mavx512bw the code vectorizes fine. Vectorization