Skip to content
Snippets Groups Projects
user avatar
Georg-Johann Lay authored
This patch avoids (clobber (match_dup)) in insn patterns for tablejump.
The machine description now uses a scratch_operand instead which is
possible since the clobbered entity is known in advance:

3-byte PC        : REG_Z
2-byte PC + JMP  : REG_Z
2-byte PC + RJMP : None, hence scratch:HI is used.

The avr-casesi pass and optimization has to be adjusted to the new patterns.

	PR target/116781
gcc/
	* config/avr/avr.md (*tablejump_split, *tablejump): Add
	operand 2 as a "scratch_operand" instead of a match_dup.
	(casesi): Adjust expander operands accordingly.  Use a scratch:HI
	when the jump address is not clobbered.  This is the case for a
	2-byte PC + has no JMP instruction.  In all the other cases, the
	affected operand is REG_Z (reg:HI 30).
	(casesi_<mode>_sequence): Adjust matcher to new anatomy.
	* config/avr/avr-passes.cc (avr_is_casesi_sequence)
	(avr_is_casesi_sequence, avr_optimize_casesi)
	(avr_casei_sequence_check_operands): Adjust to new anatomy.
083892ba
History
Name Last commit Last update