switch index optimization

Jeffrey A Law law@cygnus.com
Tue Jan 27 13:09:00 GMT 1998


  In message < 199801271819.KAA01586@atrus.synopsys.com >you write:
  > > The stuff we're talking about probably won't help that case.  This needs
  > > global constant/copy propagation into if/else statements.  It's on the
  > > list of things to do.
  > 
  > If you're going to do that, it seems you could go one step further and
  > propagate ranges (min and max values of expressions).  Constant
  > propagation is then just a special case (min == max).  With this framework
  > one could then implement efficient array bounds checking (omitting checks
  > for expressions guaranteed to be within range).
That's the problem -- generalizing from min == max to a range test on RTL isn't
trivial :-)  That's the problem I'm looking into solving on a local level
in CSE.  The fact that it's a hard problem shouldn't be a suprise to anyone
that had the joy of debugging the tree based range checking code last year --
it took 4-8 weeks to stabilize once it went into the gcc snapshots.

There's also the problem of finding cc0 on machines that use it and a host
of other (purely technical) issues.

Odds are we'll have an incremental approach to solving the problem.

  * First we'll contribute gcse/pre, which includes global constant/copy propagation
  (which is done and will be submitted once we've received final payment from
  the customer who funded the work).

  * Getting constant/copy propagation into if/else conditionals on non-cc0
  machines would probably follow next.  This is happening under another
  contract, so we'll submit this code when we get paid on for its contract :-)

  * Then handle cc0 machines.

  * Then deal with true range checking.


jeff



More information about the Gcc mailing list