aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-if-conv.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-if-conv.c')
-rw-r--r--gcc/tree-if-conv.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index dc43d95..13e12c6 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -2808,15 +2808,20 @@ tree_if_conversion (struct loop *loop)
goto cleanup;
/* Since we have no cost model, always version loops unless the user
- specified -ftree-loop-if-convert. Either version this loop, or if
- the pattern is right for outer-loop vectorization, version the
- outer loop. In the latter case we will still if-convert the
- original inner loop. */
- if (flag_tree_loop_if_convert != 1
- && !version_loop_for_if_conversion
- (versionable_outer_loop_p (loop_outer (loop))
- ? loop_outer (loop) : loop))
- goto cleanup;
+ specified -ftree-loop-if-convert or unless versioning is required.
+ Either version this loop, or if the pattern is right for outer-loop
+ vectorization, version the outer loop. In the latter case we will
+ still if-convert the original inner loop. */
+ if (any_pred_load_store
+ || any_complicated_phi
+ || flag_tree_loop_if_convert != 1)
+ {
+ struct loop *vloop
+ = (versionable_outer_loop_p (loop_outer (loop))
+ ? loop_outer (loop) : loop);
+ if (!version_loop_for_if_conversion (vloop))
+ goto cleanup;
+ }
/* Now all statements are if-convertible. Combine all the basic
blocks into one huge basic block doing the if-conversion