https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90323
--- Comment #17 from luoxhu at gcc dot gnu.org --- If the constant limitation is removed, it could be combined successfully with my new patch for PR94613. https://gcc.gnu.org/pipermail/gcc-patches/2021-April/569255.html And what do you mean"This is not canonical form on RTL, and it's not a useful form either" in c#7, please? Not understanding the point... Trying 11 -> 16: 11: r124:V4SI=r127:V4SI&r129:V4SI|~r129:V4SI&r128:V4SI REG_DEAD r128:V4SI REG_DEAD r129:V4SI REG_DEAD r127:V4SI 16: %v2:V4SI=r124:V4SI REG_DEAD r124:V4SI Successfully matched this instruction: (set (reg/i:V4SI 66 %v2) (ior:V4SI (and:V4SI (reg:V4SI 127) (reg:V4SI 129)) (and:V4SI (not:V4SI (reg:V4SI 129)) (reg:V4SI 128)))) allowing combination of insns 11 and 16 original costs 4 + 4 = 8 replacement cost 4 deferring deletion of insn with uid = 11. modifying insn i3 16: %v2:V4SI=r127:V4SI&r129:V4SI|~r129:V4SI&r128:V4SI REG_DEAD r127:V4SI REG_DEAD r129:V4SI REG_DEAD r128:V4SI deferring rescan insn with uid = 16. diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 571e2337e27..701f37eb03e 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -3405,7 +3405,6 @@ simplify_context::simplify_binary_operation_1 (rtx_code code, machines, and also has shorter instruction path length. */ if (GET_CODE (op0) == AND && GET_CODE (XEXP (op0, 0)) == XOR - && CONST_INT_P (XEXP (op0, 1)) && rtx_equal_p (XEXP (XEXP (op0, 0), 0), trueop1)) { rtx a = trueop1; @@ -3419,7 +3418,6 @@ simplify_context::simplify_binary_operation_1 (rtx_code code, /* Similarly, (xor (and (xor A B) C) B) as (ior (and A C) (and B ~C)) */ else if (GET_CODE (op0) == AND && GET_CODE (XEXP (op0, 0)) == XOR - && CONST_INT_P (XEXP (op0, 1)) && rtx_equal_p (XEXP (XEXP (op0, 0), 1), trueop1)) { rtx a = XEXP (XEXP (op0, 0), 0);