This is the mail archive of the 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: better redundant compare elimination

  In message <>you write:
  > This patch eliminates redundant compares when a label is only reached
  > from a jump by setting CC status according to the instruction preceding
  > the branch.
Interesting idea. 

  > This has a very small effect on the code I tried it on.  Is it worth
  > installing?
Your call.

  > Any other comments?
You've added another scan through the insns.  If you look about a
half-dozen lines down from your insertion point you'll find an
existing loop to walk over all the insns.

By putting your code to initialize LABEL_REFs in there you cut out
most of the overhead.

Otherwise it looks fine.

Note that if move your initialization code for LABEL_REFS into the
existing loop, most of your overhead disappears and you might want
to remove the flag_expensive_optimization check.  The only real
overhead left would be a couple prev_nonnote_insn calls when we
encounter a CODE_LABEL with a use count of 1 which would be the
exception rather than the rule I would think.


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