https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80520
Jeffrey A. Law <law at redhat dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |law at redhat dot com --- Comment #8 from Jeffrey A. Law <law at redhat dot com> --- I'd look more at split-paths rather than DOM in this case. Prior to split-paths we have: [ ... ] _20 = y_33 & 1; if (_20 != 0) goto <bb 4>; [50.00%] else goto <bb 5>; [50.00%] <bb 4> [local count: 531502203]: _18 = _25 ^ 2567483615; <bb 5> [local count: 1063004407]: # prephitmp_49 = PHI <_25(3), _18(4)> _2 = (void *) ivtmp.8_30; [ ... ] Split-paths comes along and decides it'd like split BB5 resulting in: _20 = y_33 & 1; if (_20 != 0) goto <bb 4>; [50.00%] else goto <bb 6>; [50.00%] <bb 4> [local count: 531502203]: _18 = _25 ^ 2567483615; <bb 5> [local count: 531502203]: # prephitmp_43 = PHI <_18(4)> _47 = (void *) ivtmp.8_30; MEM[base: _47, offset: 0B] = prephitmp_43; ivtmp.8_42 = ivtmp.8_30 + 8; if (ivtmp.8_42 != _6) goto <bb 3>; [98.99%] else goto <bb 7>; [1.01%] <bb 6> [local count: 531502204]: # prephitmp_49 = PHI <_25(3)> _2 = (void *) ivtmp.8_30; MEM[base: _2, offset: 0B] = prephitmp_49; ivtmp.8_29 = ivtmp.8_30 + 8; if (ivtmp.8_29 != _6) goto <bb 3>; [98.99%] else goto <bb 7>; [1.01%] I don't see any simplifications that happen as a result of that transformation and we're not really even going to be able to simplify the branching structure. So ISTM that split-paths is where we ought to concentrate. It's been problematic in this space before -- it's got a number of hacks already to try and discourage path splitting in cases where doing so it going to inhibit if-conversion.