gccint: Define Subst Output Template

1 
1 17.21.3 Generation of output template in 'define_subst'
1 -------------------------------------------------------
1 
1 If all necessary checks for 'define_subst' application pass, a new
1 RTL-pattern, based on the output-template, is created to replace the old
1 template.  Like in input-patterns, meanings of some RTL expressions are
1 changed when they are used in output-patterns of a 'define_subst'.
1 Thus, 'match_dup' is used for copying the whole expression from the
1 original pattern, which matched corresponding 'match_operand' from the
1 input pattern.
1 
1  'match_dup N' is used in the output template to be replaced with the
1 expression from the original pattern, which matched 'match_operand N'
1 from the input pattern.  As a consequence, 'match_dup' cannot be used to
1 point to 'match_operand's from the output pattern, it should always
1 refer to a 'match_operand' from the input pattern.
1 
1  In the output template one can refer to the expressions from the
1 original pattern and create new ones.  For instance, some operands could
1 be added by means of standard 'match_operand'.
1 
1  After replacing 'match_dup' with some RTL-subtree from the original
1 pattern, it could happen that several 'match_operand's in the output
1 pattern have the same indexes.  It is unknown, how many and what indexes
1 would be used in the expression which would replace 'match_dup', so such
1 conflicts in indexes are inevitable.  To overcome this issue,
1 'match_operands' and 'match_operators', which were introduced into the
1 output pattern, are renumerated when all 'match_dup's are replaced.
1 
1  Number of alternatives in 'match_operand's introduced into the output
1 template 'M' could differ from the number of alternatives in the
1 original pattern 'N', so in the resultant pattern there would be 'N*M'
1 alternatives.  Thus, constraints from the original pattern would be
1 duplicated 'N' times, constraints from the output pattern would be
1 duplicated 'M' times, producing all possible combinations.
1