http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55860
Jeffrey A. Law <law at redhat dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |law at redhat dot com --- Comment #2 from Jeffrey A. Law <law at redhat dot com> --- My current work won't help this PR. edge equivalences are not well handled for threading. While the edge containing the equivalence for jlk < n dominates the true arm of the condition, it does not dominate the join point where the true/else arms meet. So it's not going to be available in the expression hash table when we try to thread the true arm. dom_opt_leave_block does some work to recover edge equivalences, but only for the edge from the block we're leaving to its successor blocks. The edge equivalence is higher up in the chain. In theory we could walk up the CFG and add more stuff to the tables, which would probably help. Assuming that worked, I still doubt threading is going to be successful as we have to thread through the backedge in the CFG and we're currently very conservative with that, both in terms of recording jump threads and in terms of which jump threads we'll ultimately realize. In this particular case, threading from the true arm through the backedge will create a new, inner loop which the threading code tries really hard not to do because it doesn't know how to update all the various loop structures. We have the same problem for the FSA optimization, but in that case I'm tempted to just throw away all the loop information -- if we thread a backedge and eliminate a switch, that's huge from a performance standpoint and we can probably afford to just throw away the loop info at that point.