https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92549
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 47292 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47292&action=edit gcc10-pr92549.patch Yeah, there are *swap<mode> patterns, but they are unlikely to trigger, because before RA usually there is no swap between pseudos, but simply different pseudos, and only during RA we get to a need of a swap. This patch handles it in peephole2. The big question is if it should be done always (as in the patch), or only at -Os or on selected modern CPUs + maybe generic tuning, where xchg with register operands just uses normal register renaming and is 0.5 or worst case 1 cycles.