Skip to content

Commit f907cf4

Browse files
committed
vect: Move suggested_unroll_factor applying [PR105940]
As PR105940 shown, when rs6000 port tries to assign m_suggested_unroll_factor by 4 or so, there will be ICE on: exact_div (LOOP_VINFO_VECT_FACTOR (loop_vinfo), loop_vinfo->suggested_unroll_factor); In function vect_analyze_loop_2, the current place of suggested_unroll_factor applying can't guarantee it's applied for all cases. As the case shows, vectorizer could retry with SLP forced off, the vf is reset by saved_vectorization_factor which isn't applied with suggested_unroll_factor before. It means it can end up with one vf which neglects suggested_unroll_factor. I think it's off design, we should move the applying of suggested_unroll_factor after start_over. PR tree-optimization/105940 gcc/ChangeLog: * tree-vect-loop.cc (vect_analyze_loop_2): Move the place of applying suggested_unroll_factor after start_over.
1 parent 0774389 commit f907cf4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gcc/tree-vect-loop.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2388,15 +2388,15 @@ vect_analyze_loop_2 (loop_vec_info loop_vinfo, bool &fatal,
23882388
set of rgroups. */
23892389
gcc_assert (LOOP_VINFO_MASKS (loop_vinfo).is_empty ());
23902390

2391+
/* This is the point where we can re-start analysis with SLP forced off. */
2392+
start_over:
2393+
23912394
/* Apply the suggested unrolling factor, this was determined by the backend
23922395
during finish_cost the first time we ran the analyzis for this
23932396
vector mode. */
23942397
if (loop_vinfo->suggested_unroll_factor > 1)
23952398
LOOP_VINFO_VECT_FACTOR (loop_vinfo) *= loop_vinfo->suggested_unroll_factor;
23962399

2397-
/* This is the point where we can re-start analysis with SLP forced off. */
2398-
start_over:
2399-
24002400
/* Now the vectorization factor is final. */
24012401
poly_uint64 vectorization_factor = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
24022402
gcc_assert (known_ne (vectorization_factor, 0U));

0 commit comments

Comments
 (0)