From: Tobias Burnus Date: Mon, 12 Dec 2022 12:20:32 +0000 (+0100) Subject: Merge branch 'releases/gcc-12' into devel/omp/gcc-12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=daf3af9e5b6da664115207a6dae3706d11cc4614;p=thirdparty%2Fgcc.git Merge branch 'releases/gcc-12' into devel/omp/gcc-12 Merge up to r12-8979-g1a8af012222a8386fcda16a61dc17f11ba9cfbfd (12th Dec 2022) --- daf3af9e5b6da664115207a6dae3706d11cc4614 diff --cc gcc/tree-ssa-loop-im.cc index 3e09bb19ed30,3926e5c14a4b..99d0a0194daf --- a/gcc/tree-ssa-loop-im.cc +++ b/gcc/tree-ssa-loop-im.cc @@@ -46,9 -46,8 +46,10 @@@ along with GCC; see the file COPYING3 #include "alias.h" #include "builtins.h" #include "tree-dfa.h" + #include "tree-ssa.h" #include "dbgcnt.h" +#include "graphite-oacc.h" +#include "internal-fn.h" /* TODO: Support for predicated code motion. I.e. @@@ -333,8 -332,8 +334,8 @@@ enum move_po because it may trap), return MOVE_PRESERVE_EXECUTION. Otherwise return MOVE_IMPOSSIBLE. */ - enum move_pos - movement_possibility (gimple *stmt, bool restrict_oacc_hoisting) + static enum move_pos -movement_possibility_1 (gimple *stmt) ++movement_possibility_1 (gimple *stmt, bool restrict_oacc_hoisting) { tree lhs; enum move_pos ret = MOVE_POSSIBLE; @@@ -436,6 -423,23 +437,23 @@@ return ret; } + static enum move_pos -movement_possibility (gimple *stmt) ++movement_possibility (gimple *stmt, bool restrict_oacc_hoisting) + { - enum move_pos pos = movement_possibility_1 (stmt); ++ enum move_pos pos = movement_possibility_1 (stmt, restrict_oacc_hoisting); + if (pos == MOVE_POSSIBLE) + { + use_operand_p use_p; + ssa_op_iter ssa_iter; + FOR_EACH_PHI_OR_STMT_USE (use_p, stmt, ssa_iter, SSA_OP_USE) + if (TREE_CODE (USE_FROM_PTR (use_p)) == SSA_NAME + && ssa_name_maybe_undef_p (USE_FROM_PTR (use_p))) + return MOVE_PRESERVE_EXECUTION; + } + return pos; + } + + /* Compare the profile count inequality of bb and loop's preheader, it is three-state as stated in profile-count.h, FALSE is returned if inequality cannot be decided. */