]> git.ipfire.org Git - thirdparty/gcc.git/commit
Match: Add overloaded types_match to avoid code dup [NFC]
authorPan Li <pan2.li@intel.com>
Thu, 23 May 2024 00:09:40 +0000 (08:09 +0800)
committerPan Li <pan2.li@intel.com>
Thu, 23 May 2024 14:46:43 +0000 (22:46 +0800)
commitdca3e6b9049ff3c1432d4717ca2309e7aad20447
tree26daa9d000853416e33ee11e620b1395c6c463d6
parent2b2476d4d18c92b8aba3567ebccd2100c2f7c258
Match: Add overloaded types_match to avoid code dup [NFC]

There are sorts of match pattern for SAT related cases,  there will be
some duplicated code to check the dest, op_0, op_1 are same tree types.
Aka ternary tree type matches.  Thus,  add overloaded types_match func
do this and avoid match code duplication.

The below test suites are passed for this patch:
* The rv64gcv fully regression test.
* The x86 bootstrap test.
* The x86 regression test.

gcc/ChangeLog:

* generic-match-head.cc (types_match): Add overloaded types_match
for 3 types.
* gimple-match-head.cc (types_match): Ditto.
* match.pd: Leverage overloaded types_match.

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