]> gcc.gnu.org Git - gcc.git/commitdiff
regrename: Skip renaming if instruction is noop move.
authorJoJo R <rjiejie@linux.alibaba.com>
Tue, 14 Dec 2021 21:55:57 +0000 (16:55 -0500)
committerJeff Law <jeffreyalaw@gmail.com>
Tue, 14 Dec 2021 21:55:57 +0000 (16:55 -0500)
gcc/
* regrename.c (find_rename_reg): Return satisfied regno
if instruction is noop move.

gcc/regrename.c

index b8a9ca36f225cc9f74ea7c26964cdedfb1ab5948..fe72fcc362413e2eaefe8f5fc377464395e338aa 100644 (file)
@@ -394,6 +394,11 @@ find_rename_reg (du_head_p this_head, enum reg_class super_class,
                          this_head, *unavailable))
     return this_head->tied_chain->regno;
 
+  /* If this insn is a noop move, then do not rename in this chain as doing so
+     would inhibit removal of the noop move.  */
+  if (noop_move_p (this_head->first->insn))
+    return best_new_reg;
+
   /* If PREFERRED_CLASS is not NO_REGS, we iterate in the first pass
      over registers that belong to PREFERRED_CLASS and try to find the
      best register within the class.  If that failed, we iterate in
This page took 0.104033 seconds and 5 git commands to generate.