https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96298

--- Comment #5 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Trying 17, 14 -> 18:
   17: r147:DI=r145:DI^r121:DI
      REG_DEAD r145:DI
      REG_DEAD r121:DI
   14: r144:DI=r142:DI^r121:DI
      REG_DEAD r142:DI
   18: r148:DI=r144:DI^r147:DI
      REG_DEAD r147:DI
      REG_DEAD r144:DI

(no other insn here not mentioned uses r144 or r147)

This could simplify to just r142^r145.  But we go completely wrong here,
instead:

Failed to match this instruction:
(set (reg:DI 148)
    (xor:DI (xor:DI (reg:DI 145)
            (reg:DI 142))
        (reg:DI 121 [ _12 ])))
Successfully matched this instruction:
(set (reg:DI 147)
    (xor:DI (reg:DI 145)
        (reg:DI 142)))
Successfully matched this instruction:
(set (reg:DI 148)
    (xor:DI (reg:DI 147)
        (reg:DI 121 [ _12 ])))
allowing combination of insns 14, 17 and 18
original costs 4 + 4 + 4 = 12
replacement costs 4 + 4 = 8
deferring deletion of insn with uid = 14.
modifying insn i2    17: r147:DI=r145:DI^r142:DI
      REG_DEAD r142:DI
      REG_DEAD r145:DI
deferring rescan insn with uid = 17.
modifying insn i3    18: r148:DI=r147:DI^r121:DI
      REG_DEAD r121:DI
      REG_DEAD r147:DI
deferring rescan insn with uid = 18.


That sounds like simplify-rtx yes.

Reply via email to