diff options
author | Andre Vieira <andre.simoesdiasvieira@arm.com> | 2019-11-06 11:22:35 +0000 |
---|---|---|
committer | Andre Vieira <avieira@gcc.gnu.org> | 2019-11-06 11:22:35 +0000 |
commit | 2e7a4f579b1157754ea20a03431b4fa80cd4567a (patch) | |
tree | aaf27c52aa95d14e8b7ddb3b27621128025f43ca /gcc/tree-vect-loop-manip.c | |
parent | 3cf3da88be453f3fceaa596ee78be8d1e5aa21ca (diff) | |
download | gcc-2e7a4f579b1157754ea20a03431b4fa80cd4567a.zip gcc-2e7a4f579b1157754ea20a03431b4fa80cd4567a.tar.gz gcc-2e7a4f579b1157754ea20a03431b4fa80cd4567a.tar.bz2 |
[vect] PR92317: fix skip_epilogue creation for epilogues
gcc/ChangeLog:
2019-11-06 Andre Vieira <andre.simoesdiasvieira@arm.com>
PR tree-optimization/92317
* tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard2): Also
update phi's with constant phi arguments.
gcc/testsuite/ChangeLog:
2019-11-06 Andre Vieira <andre.simoesdiasvieira@arm.com>
PR tree-optimization/92317
* gcc/testsuite/g++.dg/opt/pr92317.C: New test.
From-SVN: r277877
Diffstat (limited to 'gcc/tree-vect-loop-manip.c')
-rw-r--r-- | gcc/tree-vect-loop-manip.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index 1fbcaf2..54f3ccf 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -2291,12 +2291,14 @@ slpeel_update_phi_nodes_for_guard2 (class loop *loop, class loop *epilog, { gphi *update_phi = gsi.phi (); tree old_arg = PHI_ARG_DEF (update_phi, 0); - /* This loop-closed-phi actually doesn't represent a use out of the - loop - the phi arg is a constant. */ - if (TREE_CODE (old_arg) != SSA_NAME) - continue; - tree merge_arg = get_current_def (old_arg); + tree merge_arg = NULL_TREE; + + /* If the old argument is a SSA_NAME use its current_def. */ + if (TREE_CODE (old_arg) == SSA_NAME) + merge_arg = get_current_def (old_arg); + /* If it's a constant or doesn't have a current_def, just use the old + argument. */ if (!merge_arg) merge_arg = old_arg; |