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

            Bug ID: 110088
           Summary: [avr] Improve operation with const on l-reg after move
                    from d-reg
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gjl at gcc dot gnu.org
  Target Milestone: ---

The register allocator might generate code that moves a value from a d-reg to
an l-reg, and then performs operation like PLUS, IOR, AND with a constant.  So
we have a sequence like:

lreg = dreg
lreg = lreg <op> const

This is expensive because lreg cannot handle const and needs a QI scratch to
load bytes of const.  Instead, if dreg dies after the first insn, better code
is:

dreg = dreg <op> const
lreg = dreg

An RTL peephole can catch this.

Reply via email to