SSA implementation

Mark Mitchell mark@codesourcery.com
Fri Jun 30 09:14:00 GMT 2000


>>>>> "Richard" == Richard Kenner <kenner@vlsi1.ultra.nyu.edu> writes:

    Richard>     We will be contributing a dead-code elimination pass
    Richard> in the very near future that operates on the SSA form.
    Richard> One big improvement is that this algorithm is a) very
    Richard> fast and b) can eliminate loops in things like:

    Richard>   void f () { int i; for (i = 0; i < 100; ++i) ; }

    Richard> We could always have eliminated such loops, but as I
    Richard> understood it, we chose not to under the assumption they
    Richard> were there for timing delay purposes.  Has this policy
    Richard> chaged?

Yes.  This was debated to death a year or two ago.  The manual has
said:

  Historically, GCC has not deleted ``empty'' loops under the
  assumption that the most likely reason you would put one in a program is
  to have a delay, so deleting them will not make real programs run any
  faster.

  However, the rationale here is that optimization of a nonempty loop
  cannot produce an empty one, which holds for C but is not always the
  case for C++.

  Moreover, with @samp{-funroll-loops} small ``empty'' loops are already
  removed, so the current behavior is both sub-optimal and inconsistent
  and will change in the future.

for quite some time.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com


More information about the Gcc mailing list