This avoids edge inserting and eventual splitting during BB SLP
vectorization for now.
2020-10-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/97486
* tree-vect-slp.c (vect_slp_function): Split after stmts
ending a BB.
* gcc.dg/vect/bb-slp-pr97486.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+
+struct {
+ int *end_info;
+ int *fp;
+} png_load_body_c;
+
+int *png_set_longjmp_fn();
+
+void setjmp();
+
+void png_load_body()
+{
+ int *fp;
+ int png_ptr, info_ptr, *end_info;
+ if (!fp)
+ return;
+ if (png_ptr) {
+ info_ptr = 0;
+ end_info = png_set_longjmp_fn();
+ }
+ png_load_body_c.end_info = end_info;
+ png_load_body_c.fp = fp;
+ if (png_ptr)
+ png_set_longjmp_fn();
+ setjmp(info_ptr);
+}
}
else
bbs.safe_push (bb);
+
+ /* When we have a stmt ending this block we have to insert on
+ edges when inserting after it. Avoid this for now. */
+ if (gimple *last = last_stmt (bb))
+ if (is_ctrl_altering_stmt (last))
+ {
+ r |= vect_slp_bbs (bbs);
+ bbs.truncate (0);
+ }
}
if (!bbs.is_empty ())