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]

Re: SSA implementation


>>>>> "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

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