This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Don't allow FSM threader to create irreducible loops unless it eliminates a multi-way branch


On 10/20/2015 06:03 PM, Hans-Peter Nilsson wrote:
On Mon, 19 Oct 2015, Jeff Law wrote:
If I hack up GCC's old jump threader to avoid threading across backedges and
instead let the FSM threader handle that case, then we end up with cases where
the FSM threader creates irreducible loops with marginal benefit.

This can be seen in ssa-dom-thread-2{d,e,f}.c.

We've long avoided such threads in the old jump threader.  We generally want
to avoid them in the FSM threader as well.  The only case where we're going to
allow them is when we're able to eliminate a multi-way branch from the loop.

Bootstrapped and regression tested on x86_64-linux-gnu.  Also tested the above
mentioned testcases with my hacked up compiler.

Installed on the trunk.

Please do *not* backport this, it causes
unreachable-jump-table-entry issues for cris-elf, breaking build
in newlib.  Although this *is* a manifestation of undue reliance
on assembler broken-dot-word support for this target, I can
imagine similar issues with branches stretched beyond optimal
limit for other targets.
Not planning to.


I have no idea whether there's an actual bug related to the
patch or something "just waiting to happen" and 16-bit-offsets
just too close to the limits.  Brief inspection of the generated
assembly-code is, well, "inconclusive".  Also, I'm travelling at
the moment.
Feel free to pass it along when you get back.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]