Clean up MIPS branch handling, fix mips-ps-*.c failures

Adam Nemet anemet@caviumnetworks.com
Thu Mar 9 18:54:00 GMT 2006


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



More information about the Gcc-patches mailing list