> It looks like this is an existing (potential) problem, > but default_noce_conversion_profitable_p uses seq_cost, which in turn > uses insn_cost. And insn_cost has an optional target hook behind it, > which allows for costing based on insn attributes etc. For a true > apples-with-apples comparison we should use insn_cost here too. Good point, fixed that. > I think the detail that COSTS_N_INSNS (2) is the default is useful here. > (In other words, I'd forgotten by the time I'd poked around other bits of > ifcvt and was about to ask why we didn't cost the condition “properly”.) > So how about something like: > > The original costs already include a base cost of COSTS_N_INSNS (2): > one instruction for the compare (which we will be needing either way) > and one instruction for the branch. Yes, this is much clearer. I went with that wording in the attached v2. Regards Robin