diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-29 15:52:16 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-29 15:52:16 +0000 |
commit | 883ef2dd5df7fd490fc2297ef44b0e8adc5d26c7 (patch) | |
tree | bc2bb6652872247dd5ddb29625b919b028d012bf /gcc/tree-ssa-loop-im.c | |
parent | 5a519fcc34e6c391435e0d3afd77cecd1f74ab52 (diff) | |
download | gcc-883ef2dd5df7fd490fc2297ef44b0e8adc5d26c7.tar.gz |
2008-09-29 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r140750
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@140756 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-im.c')
-rw-r--r-- | gcc/tree-ssa-loop-im.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c index 527b810e335..fe7a22203fc 100644 --- a/gcc/tree-ssa-loop-im.c +++ b/gcc/tree-ssa-loop-im.c @@ -763,6 +763,7 @@ rewrite_reciprocal (gimple_stmt_iterator *bsi) { gimple stmt, stmt1, stmt2; tree var, name, lhs, type; + tree real_one; stmt = gsi_stmt (*bsi); lhs = gimple_assign_lhs (stmt); @@ -770,9 +771,24 @@ rewrite_reciprocal (gimple_stmt_iterator *bsi) var = create_tmp_var (type, "reciptmp"); add_referenced_var (var); + DECL_GIMPLE_REG_P (var) = 1; + + /* For vectors, create a VECTOR_CST full of 1's. */ + if (TREE_CODE (type) == VECTOR_TYPE) + { + int i, len; + tree list = NULL_TREE; + real_one = build_real (TREE_TYPE (type), dconst1); + len = TYPE_VECTOR_SUBPARTS (type); + for (i = 0; i < len; i++) + list = tree_cons (NULL, real_one, list); + real_one = build_vector (type, list); + } + else + real_one = build_real (type, dconst1); stmt1 = gimple_build_assign_with_ops (RDIV_EXPR, - var, build_real (type, dconst1), gimple_assign_rhs2 (stmt)); + var, real_one, gimple_assign_rhs2 (stmt)); name = make_ssa_name (var, stmt1); gimple_assign_set_lhs (stmt1, name); |