On 11/12/23 07:52, Richard Sandiford wrote:
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.
OK
jeff

Reply via email to