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

--- Comment #15 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #14)
> Created attachment 40818 [details]
> patch
> 
> Patch I am testing for the loop splitting cost model.  I still believe loop
> splitting on its own is not profitable and it should be integrated with
> threading and CSE.

It regresses

FAIL: gcc.dg/tree-ssa/pr69270.c scan-tree-dump-not dom3 "bit_xor"
FAIL: gcc.dg/tree-ssa/pr69270.c scan-tree-dump-times dom3 "Folded to: _[0-9]+ =
0;" 1
FAIL: gcc.dg/tree-ssa/pr69270.c scan-tree-dump-times dom3 "Folded to: _[0-9]+ =
1;" 1
FAIL: gcc.dg/tree-ssa/pr69270.c scan-tree-dump-times dom3 "Replaced
.bufferstep_[0-9]+. with constant .0." 1
FAIL: gcc.dg/tree-ssa/pr69270.c scan-tree-dump-times dom3 "Replaced
.bufferstep_[0-9]+. with constant .1." 1

this testcase wants to "thread"

   if (bufferstep != 0)
    ...
   bufferstep ^= 1;

once which the backward threading code does only if we first split the path.
This effectively rotates the loop.  The threading doesn't seem to matter
though, what matters is the xor that can be conditionally simplified.

Thus another "enabler" for path splitting would be

  if (x ==/!= CST)
    ...
  use-of-x;

so we can constant propagate.

Reply via email to