rx-elf: sched2 dependency question

Richard Henderson rth@redhat.com
Tue Sep 28 06:54:00 GMT 2010

On 09/27/2010 03:37 PM, DJ Delorie wrote:
>> I think it's probably a mistake to have the default ADD
>> instruction SET the flags, rather than CLOBBER them.
> How else would we optimize away compares?

By having a separate ADD that looks like your current one.
Combine will put them together for you.  Compare i386
(define_insn "*add<mode>_1"
  [(set (match_operand:SWI48 0 "nonimmediate_operand" "=r,rm,r,r")
          (match_operand:SWI48 1 "nonimmediate_operand" "%0,0,r,r")
          (match_operand:SWI48 2 "<general_operand>" "<g>,r<i>,0,l<i>")))
   (clobber (reg:CC FLAGS_REG))]
  "ix86_binary_operator_ok (PLUS, <MODE>mode, operands)"

(define_insn "*add<mode>_2"
  [(set (reg FLAGS_REG)
            (match_operand:SWI 1 "nonimmediate_operand" "%0,0")
            (match_operand:SWI 2 "<general_operand>" "<g>,<r><i>"))
          (const_int 0)))
   (set (match_operand:SWI 0 "nonimmediate_operand" "=<r>,<r>m")
        (plus:SWI (match_dup 1) (match_dup 2)))]
  "ix86_match_ccmode (insn, CCGOCmode)
   && ix86_binary_operator_ok (PLUS, <MODE>mode, operands)"


More information about the Gcc mailing list