diff options
author | bonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-08-23 17:48:37 +0000 |
---|---|---|
committer | bonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-08-23 17:48:37 +0000 |
commit | a0bfd1b9d36fc14ba7fbc53c7b4d31d4ca93e4ed (patch) | |
tree | 4c0428b73658184eadcaa843efb1e394f6f5bb89 | |
parent | 386367fa4827ceac357595e178d56f55ed27e898 (diff) | |
download | gcc-a0bfd1b9d36fc14ba7fbc53c7b4d31d4ca93e4ed.tar.gz |
2005-08-23 Paolo Bonzini <bonzini@gnu.org>
PR middle-end/23517
* fold-const.c (fold_convert): Use VIEW_CONVERT_EXPR to convert
between vectors.
* convert.c (convert_to_integer, convert_to_vector): Likewise.
* tree-vect-generic.c (tree_vec_extract, expand_vector_operations_1):
Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103406 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/convert.c | 4 | ||||
-rw-r--r-- | gcc/fold-const.c | 2 | ||||
-rw-r--r-- | gcc/tree-vect-generic.c | 18 |
4 files changed, 14 insertions, 19 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4c1dd351489..9595e9aa0d4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,14 @@ 2005-08-23 Paolo Bonzini <bonzini@gnu.org> + PR middle-end/23517 + * fold-const.c (fold_convert): Use VIEW_CONVERT_EXPR to convert + between vectors. + * convert.c (convert_to_integer, convert_to_vector): Likewise. + * tree-vect-generic.c (tree_vec_extract, expand_vector_operations_1): + Likewise. + +2005-08-23 Paolo Bonzini <bonzini@gnu.org> + * config/rs6000/predicates.md (equality_operator): New. * config/rs6000/rs6000.md: Rewrite as a peephole2 the split for comparison with a large constant. diff --git a/gcc/convert.c b/gcc/convert.c index 90793320930..e5f8dcd76de 100644 --- a/gcc/convert.c +++ b/gcc/convert.c @@ -684,7 +684,7 @@ convert_to_integer (tree type, tree expr) error ("can't convert between vector values of different size"); return error_mark_node; } - return build1 (NOP_EXPR, type, expr); + return build1 (VIEW_CONVERT_EXPR, type, expr); default: error ("aggregate value used where an integer was expected"); @@ -760,7 +760,7 @@ convert_to_vector (tree type, tree expr) error ("can't convert between vector values of different size"); return error_mark_node; } - return build1 (NOP_EXPR, type, expr); + return build1 (VIEW_CONVERT_EXPR, type, expr); default: error ("can't convert value to a vector"); diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 52a9a425a8b..28d97df862a 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -2019,7 +2019,7 @@ fold_convert (tree type, tree arg) gcc_assert (tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (orig))); gcc_assert (INTEGRAL_TYPE_P (orig) || POINTER_TYPE_P (orig) || TREE_CODE (orig) == VECTOR_TYPE); - return fold_build1 (NOP_EXPR, type, arg); + return fold_build1 (VIEW_CONVERT_EXPR, type, arg); case VOID_TYPE: return fold_build1 (CONVERT_EXPR, type, fold_ignored_result (arg)); diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c index f9c9fda3104..463b161a434 100644 --- a/gcc/tree-vect-generic.c +++ b/gcc/tree-vect-generic.c @@ -106,13 +106,8 @@ tree_vec_extract (block_stmt_iterator *bsi, tree type, { if (bitpos) return gimplify_build3 (bsi, BIT_FIELD_REF, type, t, bitsize, bitpos); - - /* Build a conversion; VIEW_CONVERT_EXPR is very expensive unless T will - anyway be stored in memory, so prefer NOP_EXPR. */ - else if (TYPE_MODE (type) == BLKmode) - return gimplify_build1 (bsi, VIEW_CONVERT_EXPR, type, t); else - return gimplify_build1 (bsi, NOP_EXPR, type, t); + return gimplify_build1 (bsi, VIEW_CONVERT_EXPR, type, t); } static tree @@ -455,16 +450,7 @@ expand_vector_operations_1 (block_stmt_iterator *bsi) if (lang_hooks.types_compatible_p (TREE_TYPE (lhs), TREE_TYPE (rhs))) *p_rhs = rhs; else - { - /* Build a conversion; VIEW_CONVERT_EXPR is very expensive unless T will - be stored in memory anyway, so prefer NOP_EXPR. We should also try - performing the VIEW_CONVERT_EXPR on the left side of the - assignment. */ - if (TYPE_MODE (TREE_TYPE (rhs)) == BLKmode) - *p_rhs = gimplify_build1 (bsi, VIEW_CONVERT_EXPR, TREE_TYPE (lhs), rhs); - else - *p_rhs = gimplify_build1 (bsi, NOP_EXPR, TREE_TYPE (lhs), rhs); - } + *p_rhs = gimplify_build1 (bsi, VIEW_CONVERT_EXPR, TREE_TYPE (lhs), rhs); mark_stmt_modified (bsi_stmt (*bsi)); } |