[stage1][PATCH] Lower VEC_COND_EXPR into internal functions.

Martin Liška mliska@suse.cz
Wed Apr 1 10:19:51 GMT 2020


Hello.

This is second attempt to get rid of tcc_comparison GENERIC trees
to be used as the first argument of VEC_COND_EXPR.

The patch attempts achieves that in the following steps:
1) veclower pass expands all tcc_comparison expression into a SSA_NAME
2) since that tcc_comparsion can't be used as the first argument of VEC_COND_EXPR
    (done in GIMPLE verifier)
3) I exposed new internal functions with:
DEF_INTERNAL_OPTAB_FN (VCOND, 0, vcond, vec_cond)
DEF_INTERNAL_OPTAB_FN (VCONDU, 0, vcondu, vec_condu)
DEF_INTERNAL_OPTAB_FN (VCONDEQ, 0, vcondeq, vec_condeq)
DEF_INTERNAL_OPTAB_FN (VCOND_MASK, 0, vcond_mask, vec_cond_mask)

4) logic of expand_vec_cond_expr is moved into the new pass_gimple_isel pass
5) the pass expands VEC_COND_EXPR into one of the internal functions defined in 3)
6) moreover, I've added a new logic that prefers expand_vec_cmp_expr_p when
    a SSA_NAME is being used in multiple (2+) VEC_COND_EXPR statements

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
Moreover, I run SPEC2006 and SPEC2017 benchmarks on znver1, znver2 and skylake
target and I don't see any reasonable change.

Achieved benefits of the patch:
- removal of a GENERIC expression being used in GIMPLE statements
- extraction into SSA_NAMEs can enable proper tree optimizer (FRE, DOM, PRE)
- possibility to expand smarter based on number of uses (expand_vec_cmp_expr_p)

Future plans:
- tcc_comparison removal just during gimplification
- removal of a code where these expressions are handled for VEC_COND_EXPR
- do the similar thing for COND_EXPR?

The task was guided by Richi (Biener) and I bet he can help with both further questions
and reasoning.

Thanks,
Martin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Lower-VEC_COND_EXPR-into-internal-functions.patch
Type: text/x-patch
Size: 25733 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20200401/10bb9ebb/attachment-0001.bin>


More information about the Gcc-patches mailing list