89 lines
3.1 KiB
Diff
89 lines
3.1 KiB
Diff
From 189fe23d846e3e701d1fba7605b96ee3b07799a3 Mon Sep 17 00:00:00 2001
|
|
From: Martin Liska <mliska@suse.cz>
|
|
Date: Mon, 9 Mar 2020 13:23:03 +0100
|
|
Subject: [PATCH 11/26] Lower VEC_COND_EXPR into internal functions.
|
|
|
|
gcc/ChangeLog:
|
|
|
|
* Makefile.in: Add new file.
|
|
* expr.c (expand_expr_real_2): Add gcc_unreachable as we should
|
|
not meet this condition.
|
|
(do_store_flag): Likewise.
|
|
* gimplify.c (gimplify_expr): Gimplify first argument of
|
|
VEC_COND_EXPR to be a SSA name.
|
|
* internal-fn.c (vec_cond_mask_direct): New.
|
|
(vec_cond_direct): Likewise.
|
|
(vec_condu_direct): Likewise.
|
|
(vec_condeq_direct): Likewise.
|
|
(expand_vect_cond_optab_fn): New.
|
|
(expand_vec_cond_optab_fn): Likewise.
|
|
(expand_vec_condu_optab_fn): Likewise.
|
|
(expand_vec_condeq_optab_fn): Likewise.
|
|
(expand_vect_cond_mask_optab_fn): Likewise.
|
|
(expand_vec_cond_mask_optab_fn): Likewise.
|
|
(direct_vec_cond_mask_optab_supported_p): Likewise.
|
|
(direct_vec_cond_optab_supported_p): Likewise.
|
|
(direct_vec_condu_optab_supported_p): Likewise.
|
|
(direct_vec_condeq_optab_supported_p): Likewise.
|
|
* internal-fn.def (VCOND): New OPTAB.
|
|
(VCONDU): Likewise.
|
|
(VCONDEQ): Likewise.
|
|
(VCOND_MASK): Likewise.
|
|
* optabs.c (get_rtx_code): Make it global.
|
|
(expand_vec_cond_mask_expr): Removed.
|
|
(expand_vec_cond_expr): Removed.
|
|
* optabs.h (expand_vec_cond_expr): Likewise.
|
|
(vector_compare_rtx): Make it global.
|
|
* passes.def: Add new pass_gimple_isel pass.
|
|
* tree-cfg.c (verify_gimple_assign_ternary): Add check
|
|
for VEC_COND_EXPR about first argument.
|
|
* tree-pass.h (make_pass_gimple_isel): New.
|
|
* tree-ssa-forwprop.c (pass_forwprop::execute): Prevent
|
|
propagation of the first argument of a VEC_COND_EXPR.
|
|
* tree-ssa-reassoc.c (ovce_extract_ops): Support SSA_NAME as
|
|
first argument of a VEC_COND_EXPR.
|
|
(optimize_vec_cond_expr): Likewise.
|
|
* tree-vect-generic.c (expand_vector_divmod): Make SSA_NAME
|
|
for a first argument of created VEC_COND_EXPR.
|
|
(expand_vector_condition): Fix coding style.
|
|
* tree-vect-stmts.c (vectorizable_condition): Gimplify
|
|
first argument.
|
|
* gimple-isel.cc: New file.
|
|
|
|
gcc/testsuite/ChangeLog:
|
|
|
|
* g++.dg/vect/vec-cond-expr-eh.C: New test.
|
|
|
|
Reference commit in GCC: 502d63b6d6141597bb18fd23c87736a1b384cf8f
|
|
Signed-off-by: Pronin Alexander 00812787 <pronin.alexander@huawei.com>
|
|
---
|
|
gcc/tree-vect-stmts.c | 12 ++++++------
|
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
|
|
index 98b233718..0e1c86af6 100644
|
|
--- a/gcc/tree-vect-stmts.c
|
|
+++ b/gcc/tree-vect-stmts.c
|
|
@@ -11281,12 +11281,12 @@ vectorizable_condition (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi,
|
|
{
|
|
vec_cond_rhs = vec_oprnds1[i];
|
|
if (bitop1 == NOP_EXPR)
|
|
- {
|
|
- gimple_seq stmts = NULL;
|
|
- vec_compare = gimple_build (&stmts, cond_code, vec_cmp_type,
|
|
- vec_cond_lhs, vec_cond_rhs);
|
|
- gsi_insert_before (gsi, stmts, GSI_SAME_STMT);
|
|
- }
|
|
+ {
|
|
+ gimple_seq stmts = NULL;
|
|
+ vec_compare = gimple_build (&stmts, cond_code, vec_cmp_type,
|
|
+ vec_cond_lhs, vec_cond_rhs);
|
|
+ gsi_insert_before (gsi, stmts, GSI_SAME_STMT);
|
|
+ }
|
|
else
|
|
{
|
|
new_temp = make_ssa_name (vec_cmp_type);
|
|
--
|
|
2.27.0
|
|
|