]> gcc.gnu.org Git - gcc.git/commit
PR target/106450: Tweak timode_remove_non_convertible_regs on x86_64.
authorRoger Sayle <roger@nextmovesoftware.com>
Sun, 31 Jul 2022 20:44:51 +0000 (21:44 +0100)
committerRoger Sayle <roger@nextmovesoftware.com>
Sun, 31 Jul 2022 20:44:51 +0000 (21:44 +0100)
commit493f4e6cf081ea2d016547629b29d130c1533ccb
tree52bfcbbc647a4cfb1647f12457210661b318968b
parentd325e7048c85e13f12ea79aebf9623eddc7ffcaf
PR target/106450: Tweak timode_remove_non_convertible_regs on x86_64.

This patch resolves PR target/106450, some more fall-out from more
aggressive TImode scalar-to-vector (STV) optimizations.  I continue
to be caught out by how far TImode STV has diverged from DImode/SImode
STV, and therefore requires additional (unexpected) tweaking.  Many
thanks to H.J. Lu for pointing out timode_remove_non_convertible_regs
needs to be extended to handle XOR (and other new operations).

Unhelpfully the comment above this function states that it's the TImode
version of "remove_non_convertible_regs", which doesn't exist anymore,
so I've resurrected an explanatory comment from the git history.
By refactoring the checks for hard regs and already "marked" regs
into timode_check_non_convertible_regs itself, all of its callers are
simplified.  This patch then FOR_EACH_INSN_USE and FOR_EACH_INSN_DEF
to generically handle arbitrary (non-move) instructions (including
unary and binary operations), calling timode_check_non_convertible_regs
on each TImode register USE and DEF.

2022-07-31  Roger Sayle  <roger@nextmovesoftware.com>
    H.J. Lu  <hjl.tools@gmail.com>

gcc/ChangeLog
PR target/106450
* config/i386/i386-features.cc (timode_check_non_convertible_regs):
Do nothing if REGNO is set in the REGS bitmap, or is a hard reg.
(timode_remove_non_convertible_regs): Update comment.
Call timode_check_non_convertible_reg on all TImode register
DEFs and USEs in each instruction.

gcc/testsuite/ChangeLog
PR target/106450
* gcc.target/i386/pr106450.c: New test case.
gcc/config/i386/i386-features.cc
gcc/testsuite/gcc.target/i386/pr106450.c [new file with mode: 0644]
This page took 0.068135 seconds and 6 git commands to generate.