This patch adds the tree-ssa-ifcombine.h header file, with the function
declarations for `recognize_if_then_else` and `tree_ssa_ifcombine_bb` and
removes 'static' from the definitions in tree-ssa-ifcombine.cc, so that they
can be used in other passes.

gcc/ChangeLog:

        * tree-ssa-ifcombine.cc: Include tree-ssa-ifcombine.h.
        (recognize_if_then_else): Removed 'static'.
        (tree_ssa_ifcombine_bb): Removed 'static'.
        * tree-ssa-ifcombine.h: New file.

Signed-off-by: Konstantinos Eleftheriou <[email protected]>
---

(no changes since v1)

 gcc/tree-ssa-ifcombine.cc |  7 ++++---
 gcc/tree-ssa-ifcombine.h  | 27 +++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 3 deletions(-)
 create mode 100644 gcc/tree-ssa-ifcombine.h

diff --git a/gcc/tree-ssa-ifcombine.cc b/gcc/tree-ssa-ifcombine.cc
index a60e6914e68c..048ed30d7631 100644
--- a/gcc/tree-ssa-ifcombine.cc
+++ b/gcc/tree-ssa-ifcombine.cc
@@ -40,6 +40,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimplify-me.h"
 #include "tree-cfg.h"
 #include "tree-ssa.h"
+#include "tree-ssa-ifcombine.h"
 #include "attribs.h"
 #include "asan.h"
 #include "bitmap.h"
@@ -95,10 +96,10 @@ known_succ_p (basic_block cond_bb)
    basic-blocks to make the pattern match.  If SUCCS_ANY, *THEN_BB and *ELSE_BB
    will not be filled in, and they will be found to match even if reversed.  */
 
-static bool
+bool
 recognize_if_then_else (basic_block cond_bb,
                        basic_block *then_bb, basic_block *else_bb,
-                       bool succs_any = false)
+                       bool succs_any)
 {
   edge t, e;
 
@@ -1142,7 +1143,7 @@ tree_ssa_ifcombine_bb_1 (basic_block inner_cond_bb, 
basic_block outer_cond_bb,
    if-conversion helper.  We start with BB as the innermost
    worker basic-block.  Returns true if a transformation was done.  */
 
-static bool
+bool
 tree_ssa_ifcombine_bb (basic_block inner_cond_bb)
 {
   bool ret = false;
diff --git a/gcc/tree-ssa-ifcombine.h b/gcc/tree-ssa-ifcombine.h
new file mode 100644
index 000000000000..e3f73da3b13d
--- /dev/null
+++ b/gcc/tree-ssa-ifcombine.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 2026 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3, or (at your option) any
+later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef GCC_TREE_SSA_IFCOMBINE_H
+#define GCC_TREE_SSA_IFCOMBINE_H
+
+bool recognize_if_then_else (basic_block, basic_block *, basic_block *,
+                            bool succs_any = false);
+
+bool tree_ssa_ifcombine_bb (basic_block);
+
+#endif
-- 
2.52.0

Reply via email to