https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94043

--- Comment #8 from Kewen Lin <linkw at gcc dot gnu.org> ---
> It's most likely either SCEV or expand_simple_operations looking throuhg
> the single-arg PHI (which we should avoid for LC PHI nodes)

Thanks Richi, I found the loop-closed PHI form was broken after we finished the
vectorization on the loop 2, BB 38 was inserted, the function
gimple_find_edge_insert_loc will get one new BB if the dest has phis, even it's
unrelated.

;; basic block 4, loop depth 2
;;  pred:       11
;;              37
...
_15 = e2.2_31 + 1;
...
if (ivtmp_59 >= 1)
  goto <bb 38>; [100.00%]
else
  goto <bb 11>; [0.00%]
;;  succ:       38
;;              11

;; basic block 38, loop depth 1
;;  pred:       4
_40 = BIT_FIELD_REF <vect__15.22_43, 32, 96>;
;;  succ:       33

;; basic block 33, loop depth 1
;;  pred:       38
# _51 = PHI <_15(38)> 
;;  succ:       34

The alternatives seems could be 1) extend the current
gimple_find_edge_insert_loc to handle the phi nodes, if the phis aren't
related, just insert there, otherwise, insert some phis for uses of those stmts
and remove the related phis and create new assignments after those new stmts,
or 2) call rewrite_into_loop_closed_ssa for each successful vectorization.

Reply via email to