On Wed, 05 Nov 2025 18:31:36 PST (-0800), Jeff Law wrote:
Let's consider this code fragment (from xalan):

[snip]

Then we realized we really should just ignore the (set (reg) (const_int
0)) in the if-converted sequence.  We're going to be able to propagate
that away in nearly every case since we have a hard-wired zero register.
  Sure enough, ignoring that insn was enough to tip the balance on this
case and we get the desired code.

Seems like maybe we should be doing that everywhere? I think we're doing it for RTX costs (the SET is free and then the immediate costs to 0). I don't think we're doing it for the insn_cost case, though -- unless something else is happening somewhere that I don't understand.

I briefly opened up the ifcvt code, saw it calling both RTX and insn costs, and then decided it'd be better to just say something here rather than try to figure ouf it changing insn_cost would help this specific case ;)

Reply via email to