public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/PR102497-remove-unused-fn)] Remove unused function.
@ 2021-11-12 11:38 Martin Liska
  0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2021-11-12 11:38 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:fa79b1367d6c0c49859d9624d1095592eaf437c4

commit fa79b1367d6c0c49859d9624d1095592eaf437c4
Author: Martin Liska <mliska@suse.cz>
Date:   Fri Nov 12 12:37:26 2021 +0100

    Remove unused function.
    
            PR tree-optimization/102497
    
    gcc/ChangeLog:
    
            * gimple-predicate-analysis.cc (add_pred): Remove unused
            function:

Diff:
---
 gcc/gimple-predicate-analysis.cc | 61 ----------------------------------------
 1 file changed, 61 deletions(-)

diff --git a/gcc/gimple-predicate-analysis.cc b/gcc/gimple-predicate-analysis.cc
index 454113d532e..6dde0203841 100644
--- a/gcc/gimple-predicate-analysis.cc
+++ b/gcc/gimple-predicate-analysis.cc
@@ -2105,67 +2105,6 @@ predicate::normalize (gimple *use_or_def, bool is_use)
     }
 }
 
-/* Add a predicate for the condition or logical assignment STMT to CHAIN.
-   Expand SSA_NAME into constituent subexpressions.  Invert the result
-   if INVERT is true.  Return true if the predicate has been added.  */
-
-static bool
-add_pred (pred_chain *chain, gimple *stmt, bool invert)
-{
-  if (gimple_code (stmt) == GIMPLE_COND)
-    {
-      tree lhs = gimple_cond_lhs (stmt);
-      if (TREE_CODE (lhs) == SSA_NAME)
-	{
-	  gimple *def = SSA_NAME_DEF_STMT (lhs);
-	  if (is_gimple_assign (def)
-	      && add_pred (chain, def, invert))
-	    return true;
-	}
-
-      pred_info pred;
-      pred.pred_lhs = lhs;
-      pred.pred_rhs = gimple_cond_rhs (stmt);
-      pred.cond_code = gimple_cond_code (stmt);
-      pred.invert = invert;
-      chain->safe_push (pred);
-      return true;
-    }
-
-  if (!is_gimple_assign (stmt))
-    return false;
-
-  if (gimple_assign_single_p (stmt))
-    // FIXME: handle this?
-    return false;
-
-  if (TREE_TYPE (gimple_assign_lhs (stmt)) != boolean_type_node)
-    return false;
-
-  tree rhs1 = gimple_assign_rhs1 (stmt);
-  tree rhs2 = gimple_assign_rhs2 (stmt);
-  tree_code code = gimple_assign_rhs_code (stmt);
-  if (code == BIT_AND_EXPR)
-    {
-      if (TREE_CODE (rhs1) == SSA_NAME
-	  && add_pred (chain, SSA_NAME_DEF_STMT (rhs1), invert)
-	  && TREE_CODE (rhs2) == SSA_NAME
-	  /* FIXME: Need to handle failure below! */
-	  && add_pred (chain, SSA_NAME_DEF_STMT (rhs2), invert))
-	return true;
-    }
-  else if (TREE_CODE_CLASS (code) != tcc_comparison)
-    return false;
-
-  pred_info pred;
-  pred.pred_lhs = rhs1;
-  pred.pred_rhs = rhs2;
-  pred.cond_code = code;
-  pred.invert = invert;
-  chain->safe_push (pred);
-  return true;
-}
-
 /* Convert the chains of control dependence edges into a set of predicates.
    A control dependence chain is represented by a vector edges.  DEP_CHAINS
    points to an array of NUM_CHAINS dependence chains. One edge in


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-12 11:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-12 11:38 [gcc(refs/users/marxin/heads/PR102497-remove-unused-fn)] Remove unused function Martin Liska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).