tree-vect-stmts.c (exist_non_indexing_operands_for_use_p): Tweak order of checks.

* tree-vect-stmts.c (exist_non_indexing_operands_for_use_p): Tweak
	order of checks.

From-SVN: r153051
This commit is contained in:
Eric Botcazou 2009-10-21 10:08:39 +00:00 committed by Eric Botcazou
parent a4bf37944a
commit 59a05b0ca2
6 changed files with 49 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2009-10-21 Eric Botcazou <ebotcazou@adacore.com>
* tree-vect-stmts.c (exist_non_indexing_operands_for_use_p): Tweak
order of checks.
2009-10-20 Richard Henderson <rth@redhat.com> 2009-10-20 Richard Henderson <rth@redhat.com>
* tree-eh.c (lower_try_finally_copy): Do lower_eh_constructs_1 * tree-eh.c (lower_try_finally_copy): Do lower_eh_constructs_1

View File

@ -1,3 +1,8 @@
2009-10-21 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/loop_optimization7.ad[sb]: New test.
* gnat.dg/loop_optimization7_pkg.ads: New helper.
2009-10-21 Janus Weil <janus@gcc.gnu.org> 2009-10-21 Janus Weil <janus@gcc.gnu.org>
PR fortran/41706 PR fortran/41706

View File

@ -0,0 +1,16 @@
-- { dg-do compile }
-- { dg-options "-O3" }
-- { dg-options "-O3 -msse" { target i?86-*-* x86_64-*-* } }
package body Loop_Optimization7 is
function Conv (A : Arr) return Arr is
Result : Arr;
begin
for I in A'Range loop
Result (I) := Conv (A (I));
end loop;
return Result;
end;
end Loop_Optimization7;

View File

@ -0,0 +1,9 @@
with Loop_Optimization7_Pkg; use Loop_Optimization7_Pkg;
package Loop_Optimization7 is
type Arr is array (1..8) of Rec;
function Conv (A : Arr) return Arr;
end Loop_Optimization7;

View File

@ -0,0 +1,10 @@
package Loop_Optimization7_Pkg is
pragma Pure;
type Rec is record
F : Float;
end record;
function Conv (Trig : Rec) return Rec;
end Loop_Optimization7_Pkg;

View File

@ -172,13 +172,13 @@ exist_non_indexing_operands_for_use_p (tree use, gimple stmt)
{ {
tree operand; tree operand;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt); stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
/* USE corresponds to some operand in STMT. If there is no data /* USE corresponds to some operand in STMT. If there is no data
reference in STMT, then any operand that corresponds to USE reference in STMT, then any operand that corresponds to USE
is not indexing an array. */ is not indexing an array. */
if (!STMT_VINFO_DATA_REF (stmt_info)) if (!STMT_VINFO_DATA_REF (stmt_info))
return true; return true;
/* STMT has a data_ref. FORNOW this means that its of one of /* STMT has a data_ref. FORNOW this means that its of one of
the following forms: the following forms:
-1- ARRAY_REF = var -1- ARRAY_REF = var
@ -191,14 +191,12 @@ exist_non_indexing_operands_for_use_p (tree use, gimple stmt)
Therefore, all we need to check is if STMT falls into the Therefore, all we need to check is if STMT falls into the
first case, and whether var corresponds to USE. */ first case, and whether var corresponds to USE. */
if (TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME)
return false;
if (!gimple_assign_copy_p (stmt)) if (!gimple_assign_copy_p (stmt))
return false; return false;
if (TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME)
return false;
operand = gimple_assign_rhs1 (stmt); operand = gimple_assign_rhs1 (stmt);
if (TREE_CODE (operand) != SSA_NAME) if (TREE_CODE (operand) != SSA_NAME)
return false; return false;