------- Comment #24 from rakdver at gcc dot gnu dot org 2007-11-24 22:28 ------- (In reply to comment #20) > > Couldn't ivopts be taught to recognize "dec and branch on zero" patterns > > > > k_114 = k_15 + -1; > > if (k_114 != 0) > > goto <bb 10>; > > else > > goto <bb 11>; > > > > and take into account their breakage for its cost estimates somehow? > > Why? If using dec and branch is profitable, doloop pass should do it; the > transformation that ivopts do does not prevent that or make it any more > difficult.
sorry, I misunderstood what you are asking for. Yes, ivopts would have to solve this; however, they would not only have to know about the possibility to compare with zero and jump in one instruction, but also about autoincrement addressing modes, to get this one correctly. That looks like a bit complicated way to solve the issue, I need to think about it more. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31849