#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.
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;
return ret;
}
-movement_possibility (gimple *stmt)
+ static enum move_pos
- enum move_pos pos = movement_possibility_1 (stmt);
++movement_possibility (gimple *stmt, bool restrict_oacc_hoisting)
+ {
++ 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. */