]> gcc.gnu.org Git - gcc.git/commitdiff
rtl: relax validate_subreg to allow paradoxical subregs that change mode
authorTamar Christina <tamar.christina@arm.com>
Mon, 2 Oct 2023 10:50:24 +0000 (11:50 +0100)
committerTamar Christina <tamar.christina@arm.com>
Mon, 2 Oct 2023 10:50:24 +0000 (11:50 +0100)
This patch relaxes the subreg invariant that you can only change modes
or make it paradoxical in one conversion. i.e. it now allows subreg:V2DI (reg:DF ..))

This is well defined in the generic sense and allowing it would enable
you to write RTL without the extra moves which can be interfered with by
combine.

Patch has been pre-approved[1], but giving people chance to object

[1] https://gcc.gnu.org/pipermail/gcc-patches/2023-September/629119.html

gcc/ChangeLog:

* emit-rtl.cc (validate_subreg): Relax subreg rule.

gcc/emit-rtl.cc

index 8bd623dcd0ef143d62235805c1a40120eda61c66..84b6833225e627f36361bc5de095065e808a02ba 100644 (file)
@@ -947,7 +947,7 @@ validate_subreg (machine_mode omode, machine_mode imode,
      in post-reload splitters that make arbitrarily mode changes to the
      registers themselves.  */
   else if (VECTOR_MODE_P (omode)
-          && GET_MODE_INNER (omode) == GET_MODE_INNER (imode))
+          && GET_MODE_UNIT_SIZE (omode) == GET_MODE_UNIT_SIZE (imode))
     ;
   /* Subregs involving floating point modes are not allowed to
      change size unless it's an insert into a complex mode.
This page took 0.064027 seconds and 5 git commands to generate.