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

--- Comment #4 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> Created attachment 58786 [details]
> gcc15-pr115981.patch
> 
> Untested fix.  As since that commit it checks swap_commutative_operands_p:
> 1) CONST_VECTOR I think has commutative_operand_precedence -4
> 2) REG has commutative_operand_precedence -1 or -2
> 3) SUBREG of object has commutative_operand_precedence -3
> 4) VEC_DUPLICATE has commutative_operand_precedence 0
> Which means the VEC_DUPLICATE operand will always come first and whatever
> matches reg_or_0_operand will always come second, i.e. exactly not the order
> in the pattern, so we don't need to add another one, can just change order
> of this one.

Patch LGTM.

Reply via email to