]> git.ipfire.org Git - thirdparty/gcc.git/commit
[PR114810][LRA]: Recognize alternatives with lack of available registers for insn...
authorVladimir N. Makarov <vmakarov@redhat.com>
Wed, 8 May 2024 14:39:04 +0000 (10:39 -0400)
committerVladimir N. Makarov <vmakarov@redhat.com>
Wed, 8 May 2024 16:39:14 +0000 (12:39 -0400)
commit2f00e6caca1a14dfe26e94f608e9d79a787ebe08
treea2f2c825afd5c3d685bdfadeabee1cdedd3e68bc
parentd9318caed3bbff8136d13e00dcfc020a59d10f78
[PR114810][LRA]: Recognize alternatives with lack of available registers for insn and demote them.

  PR114810 was fixed in machine-dependent way.  This patch is a fix of
the PR on LRA side.  LRA chose alternative with constraints `&r,r,ro`
on i686 when all operands of DImode and there are only 6 available
general regs.  The patch recognizes such case and significantly
increase the alternative cost.  It does not reject alternative
completely.  So the fix is safe but it might not work for all
potentially possible cases of registers lack as register classes can
have any relations including subsets and intersections.

gcc/ChangeLog:

PR target/114810
* lra-constraints.cc (process_alt_operands): Calculate union reg
class for the alternative, peak matched regs and required reload
regs.  Recognize alternatives with lack of available registers and
make them costly.  Add debug print about this case.
gcc/lra-constraints.cc