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

            Bug ID: 112462
           Summary: RISC-V zicond cost model enhancements
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: law at gcc dot gnu.org
  Target Milestone: ---

Currently the costing of zicond always returns COSTS_N_INSNS (1) which can be
inaccurate.  I see two primary issues that need to be fixed.

First, for conditions which are not equality comparisons against zero the
expander will need to emit a sCC insn.  That additional instruction needs to be
included in the cost.

Second, the expander needs to look at the true/false arms and potentially emit
additional code because of the limitations of the czero instruction.  Those
additional instructions need to be included in the cost as well.

It's unclear if we should refactor the expander logic so that its basic
structure can be used to drive costing as well as expansion logic or if we
should just mirror the basic structure with new code and keep it in sync with
the expander logic.

Reply via email to