]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/postreload.cc
cselib: add function to check if SET is redundant [PR106187]
[gcc.git] / gcc / postreload.cc
index 4a67d0d437a2b968a6177f1352e6f0a607d9eb8c..f17d2f0d0e15f486ea47a827fd5ace010147520e 100644 (file)
@@ -43,7 +43,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "function-abi.h"
 #include "rtl-iter.h"
 
-static int reload_cse_noop_set_p (rtx);
 static bool reload_cse_simplify (rtx_insn *, rtx);
 static void reload_cse_regs_1 (void);
 static int reload_cse_simplify_set (rtx, rtx_insn *);
@@ -74,16 +73,6 @@ reload_cse_regs (rtx_insn *first ATTRIBUTE_UNUSED)
     }
 }
 
-/* See whether a single set SET is a noop.  */
-static int
-reload_cse_noop_set_p (rtx set)
-{
-  if (cselib_reg_set_mode (SET_DEST (set)) != GET_MODE (SET_DEST (set)))
-    return 0;
-
-  return rtx_equal_for_cselib_p (SET_DEST (set), SET_SRC (set));
-}
-
 /* Try to simplify INSN.  Return true if the CFG may have changed.  */
 static bool
 reload_cse_simplify (rtx_insn *insn, rtx testreg)
@@ -118,7 +107,7 @@ reload_cse_simplify (rtx_insn *insn, rtx testreg)
          this out, so it's safer to simplify before we delete.  */
       count += reload_cse_simplify_set (body, insn);
 
-      if (!count && reload_cse_noop_set_p (body))
+      if (!count && cselib_redundant_set_p (body))
        {
          if (check_for_inc_dec (insn))
            delete_insn_and_edges (insn);
@@ -157,7 +146,7 @@ reload_cse_simplify (rtx_insn *insn, rtx testreg)
          rtx part = XVECEXP (body, 0, i);
          if (GET_CODE (part) == SET)
            {
-             if (! reload_cse_noop_set_p (part))
+             if (! cselib_redundant_set_p (part))
                break;
              if (REG_P (SET_DEST (part))
                  && REG_FUNCTION_VALUE_P (SET_DEST (part)))
This page took 0.031891 seconds and 5 git commands to generate.