]> git.ipfire.org Git - thirdparty/gcc.git/commit
Match: Simplify (T1)(a bit_op (T2)b) to (T1)a bit_op (T1)b
authorPan Li <pan2.li@intel.com>
Sat, 15 Nov 2025 03:20:37 +0000 (11:20 +0800)
committerPan Li <pan2.li@intel.com>
Sun, 23 Nov 2025 10:36:39 +0000 (18:36 +0800)
commit4bcdfc8bda79ca4540832262a901359e120de800
treee593386bf456e274a3c77b2e73c0e4e65c3ba224
parent0f2f068d19a2eed08aaf731fb9070606f0dd2f82
Match: Simplify (T1)(a bit_op (T2)b) to (T1)a bit_op (T1)b

During the match pattern of SAT_U_MUL form 7, we found there is
a pattern like below:

(nop_convert)(a bit_op (convert b))

which result in the pattern match of SAT_U_MUL complicated and
unintuitive.  According to the suggestion of Richard, we would
like to simply it to blew:

(convert a) bit_op (convert b)

which is more friendly for reading and bit_op.  There are three
bit_op here, aka bit_ior, bit_and and bit_xor.

gcc/ChangeLog:

* match.pd: Add simplfy to fold outer convert of bit_op
to inner captures.

Signed-off-by: Pan Li <pan2.li@intel.com>
gcc/match.pd