https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84646
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aldyh at gcc dot gnu.org --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Jeffrey A. Law from comment #2) > The backwards threader discovers the threads, but refuses to optimize them > because it thinks doing so will create an irreducible loop without enough > benefit. The reason is now: Checking profitability of path (backwards): bb:3 (2 insns) bb:7 (4 insns) bb:6 (1 insns) (latch) bb:5 Control statement insns: 2 Overall: 5 insns Registering value_relation (path_oracle) (j_17 < m_23(D)) (root: bb5) path: 5->6->7->3->xx REJECTED (unreachable) it seems the path oracle is confused here. <bb 3> [local count: 955630225]: if (running_14 != 0) goto <bb 4>; [50.00%] else goto <bb 6>; [50.00%] <bb 4> [local count: 477815112]: _1 = (long unsigned int) i_16; _2 = _1 * 4; _3 = p_25(D) + _2; _4 = *_3; _5 = (long unsigned int) j_17; _6 = _5 * 4; _7 = q_26(D) + _6; _8 = *_7; _9 = _4 * _8; sum_27 = _9 + sum_11; if (sum_27 > 19999) goto <bb 5>; [50.00%] else goto <bb 6>; [50.00%] <bb 5> [local count: 238907556]: <bb 6> [local count: 955630225]: # sum_10 = PHI <sum_11(3), 20000(5), sum_27(4)> # running_13 = PHI <0(3), 0(5), 1(4)> j_28 = j_17 + 1; <bb 7> [local count: 1073741824]: # sum_11 = PHI <sum_12(11), sum_10(6)> # running_14 = PHI <running_15(11), running_13(6)> # j_17 = PHI <0(11), j_28(6)> if (j_17 < m_23(D)) goto <bb 3>; [89.00%] else goto <bb 8>; [11.00%]