]> git.ipfire.org Git - thirdparty/gcc.git/commit
recog: Handle register filters
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 21 Nov 2023 15:39:09 +0000 (15:39 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 21 Nov 2023 15:39:09 +0000 (15:39 +0000)
commit82651648107993b6ca8cf9bf20ee17215da66473
treef04b388bcaf473ef3fcb0f12585a9488c77f3f97
parent09a85191d01e337d84f9c4bc13f3515e8b40e3af
recog: Handle register filters

The main (but simplest) part of this patch makes constrain_operands
take register filters into account.

The rest of the patch adds register filter information to
operand_alternative.  Generally, if two register constraints
have different register filters, it's better if they're in separate
alternatives.  However, the syntax doesn't enforce that, and we can't
assert it due to inline asms.  So it's a choice between (a) adding
code to enforce consistent filters or (b) dealing with mixes of filters
in a conservatively correct way (in the sense of not allowing invalid
operands).  The latter seems much easier.

The patch therefore adds a mask of the filters that apply
to at least one constraint in a given operand alternative.
A register is OK if it passes all of the filters in the mask.

gcc/
* recog.h (operand_alternative): Add a register_filters field.
(alternative_register_filters): New function.
* recog.cc (preprocess_constraints): Calculate the filters field.
(constrain_operands): Check register filters.
gcc/recog.cc
gcc/recog.h