This is the mail archive of the gcc-patches@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: Clean up MIPS branch handling, fix mips-ps-*.c failures


Richard Sandiford <richard@codesourcery.com> writes:
> I also checked the before-and-after output of gcc.c-torture and
> gcc.dg using -O2 -mbranch-likely.  There were differences in 21
> files because of the VOIDmode stuff, which changes the way
> simplify_relational_operation_1 handles (eq foo (const_int 0)) and
> (ne foo (const_int 0)).  Some of the differences were improvements,
> some were degredations, but I think the overall effect was a wash.

Funny, I was debugging the same thing yesterday because I too was
trying to remove the mode from comparisons when we expand conditional
branches and these showed up as local performance-regressions.  One
thing I found was that because of the VOIDmode check in
simplify_relational_operation we don't run
simplify_relational_operation_1 in some cases and in turn fail to do
this simplification:

  (if_then_else (eq (plus:SI (reg:SI 4) -1) -1) ...)
  -> (if_then_else (eq (reg:SI 4) 0) ...)

where the result would have been a valid insn.  I will look into this
more after your patch is checked in.  Thanks very much for your work.

Adam


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