This is the mail archive of the gcc@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: Switch optimization idea


On Fri, 2013-03-22 at 13:00 -0600, Jeff Law wrote:

> As others have pointed out, this is jump threading.
> 
> The reason you're not seeing jump threading in the CoreMark test is the 
> switch is inside a loop and threading a backedge is severely constrained.
> 
> There's a BZ for this issue with a bit more state for this issue.
> 
> jeff

It took me a minute to map BZ to bugzilla, but I assume you mean there
is a bugzilla report with information on this issue, I'll look around to
see what I can find.

The example I gave was a simple case and ideally the duplicated code
(codeX) could have other edges leading into or out of it without that
preventing the jump threading.  But it sounds like it does prevent it
with the current implementation of jump threading.  Maybe it is just the
presence of a back edge that is preventing it.  I will look more into
the GCC implementation and what constraints there are and why they
prevent its use in CoreMark.

Steve Ellcey
sellcey@imgtec.com



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