https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102981
Aldy Hernandez <aldyh at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2021-10-30 Status|UNCONFIRMED |NEW --- Comment #1 from Aldy Hernandez <aldyh at gcc dot gnu.org> --- In the pre-loop threaders (ethread, thread1, threadfull1), we can't touch anything because it would cross loops, but by threadfull2 we should be able to. There's a threadable path starting at the 2->6 edge here: <bb 6> [local count: 118111600]: # c_21 = PHI <c_30(5), 0(2)> # ivtmp.16_8 = PHI <ivtmp.16_13(5), ivtmp.16_25(2)> a.1_26 = a; if (a.1_26 < 0) goto <bb 12>; [89.00%] else goto <bb 10>; [11.00%] but we don't because doing so would peel off an iteration. Hmmm, this is really old code. I'm going to have to think about this: // This is like path_crosses_loops in profitable_path_p but more // restrictive, since profitable_path_p allows threading the // first block because it would be redirected anyhow. // // If we loosened the restriction and used profitable_path_p() // here instead, we would peel off the first iterations of loops // in places like tree-ssa/pr14341.c.