]> git.ipfire.org Git - thirdparty/gcc.git/commit
bootstrap/84402 - improve (match ...) code generation
authorRichard Biener <rguenther@suse.de>
Tue, 28 Mar 2023 10:42:14 +0000 (12:42 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 28 Mar 2023 11:30:31 +0000 (13:30 +0200)
commit75cda3be0232f745cda4e177d514f6900390af0b
tree9c87fdaa90980e7768308094c35d1a85142d8dd6
parent1a62008123694b2ac07f28e25fc6e5ff371925f5
bootstrap/84402 - improve (match ...) code generation

The following avoids duplicating matching code for (match ...)
in match.pd when possible.  That's more easily possible for
(match ...) than simplify because we do not need to handle
common matches (those would be diagnosed only during compiling)
nor is the result able to inspect the active operator.

Specifically this reduces the size of the generated matches for
the atomic ops as noted in PR108129.

gimple-match.cc shrinks from 245k lines to 209k lines with this patch.

PR bootstrap/84402
PR tree-optimization/108129
* genmatch.cc (lower_for): For (match ...) delay
substituting into the match operator if possible.
(dt_operand::gen_gimple_expr): For user_id look at the
first substitute for determining how to access operands.
(dt_operand::gen_generic_expr): Likewise.
(dt_node::gen_kids): Properly sort user_ids according
to their substitutes.
(dt_node::gen_kids_1): Code-generate user_id matching.
gcc/genmatch.cc