- bool found = false;
- if (!used_in_pattern)
- {
- imm_use_iterator imm_iter;
- use_operand_p use_p;
- gimple *use_stmt;
- tree lhs;
- loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
-
- if (is_gimple_assign (stmt))
- lhs = gimple_assign_lhs (stmt);
- else
- lhs = gimple_call_lhs (stmt);
-
- /* This use is out of pattern use, if LHS has other uses that are
- pattern uses, we should mark the stmt itself, and not the pattern
- stmt. */
- if (lhs && TREE_CODE (lhs) == SSA_NAME)
- FOR_EACH_IMM_USE_FAST (use_p, imm_iter, lhs)
- {
- if (is_gimple_debug (USE_STMT (use_p)))
- continue;
- use_stmt = USE_STMT (use_p);
-
- if (!flow_bb_inside_loop_p (loop, gimple_bb (use_stmt)))
- continue;
-
- if (vinfo_for_stmt (use_stmt)
- && STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (use_stmt)))
- {
- found = true;
- break;
- }
- }
- }
+ /* This is the last stmt in a sequence that was detected as a
+ pattern that can potentially be vectorized. Don't mark the stmt
+ as relevant/live because it's not going to be vectorized.
+ Instead mark the pattern-stmt that replaces it. */