gcc_unreachable ();
}
- bool anticpatable_exp_p (const vsetvl_info &header_info)
+ bool anticipated_exp_p (const vsetvl_info &header_info)
{
if (!header_info.has_nonvlmax_reg_avl () && !header_info.has_vl ())
return true;
}
}
- for (const insn_info *insn : bb->real_nondebug_insns ())
+ for (insn_info *insn : bb->real_nondebug_insns ())
{
if (info.has_nonvlmax_reg_avl ()
&& find_access (insn->defs (), REGNO (info.get_avl ())))
bitmap_clear_bit (m_transp[bb_index], i);
break;
}
+
+ if (info.has_vl ()
+ && reg_mentioned_p (info.get_vl (), insn->rtl ()))
+ {
+ if (find_access (insn->defs (), REGNO (info.get_vl ())))
+ /* We can't fuse vsetvl into the blocks that modify the
+ VL operand since successors of such blocks will need
+ the value of those blocks are defining.
+
+ bb 4: def a5
+ / \
+ bb 5:use a5 bb 6:vsetvl a5, 5
+
+ The example above shows that we can't fuse vsetvl
+ from bb 6 into bb 4 since the successor bb 5 is using
+ the value defined in bb 4. */
+ ;
+ else
+ {
+ /* We can't fuse vsetvl into the blocks that use the
+ VL operand which has different value from the
+ vsetvl info.
+
+ bb 4: def a5
+ |
+ bb 5: use a5
+ |
+ bb 6: def a5
+ |
+ bb 7: use a5
+
+ The example above shows that we can't fuse vsetvl
+ from bb 6 into bb 5 since their value is different.
+ */
+ resource_info resource
+ = full_register (REGNO (info.get_vl ()));
+ def_lookup dl = crtl->ssa->find_def (resource, insn);
+ def_info *def
+ = dl.matching_set_or_last_def_of_prev_group ();
+ gcc_assert (def);
+ insn_info *def_insn = extract_single_source (
+ dyn_cast<set_info *> (def));
+ if (def_insn && vsetvl_insn_p (def_insn->rtl ()))
+ {
+ vsetvl_info def_info = vsetvl_info (def_insn);
+ if (m_dem.compatible_p (def_info, info))
+ continue;
+ }
+ }
+
+ bitmap_clear_bit (m_transp[bb_index], i);
+ break;
+ }
}
}
vsetvl_info &footer_info = block_info.get_exit_info ();
if (header_info.valid_p ()
- && (anticpatable_exp_p (header_info) || block_info.full_available))
+ && (anticipated_exp_p (header_info) || block_info.full_available))
bitmap_set_bit (m_antloc[bb_index],
get_expr_index (m_exprs, header_info));
|| eg->dest == EXIT_BLOCK_PTR_FOR_FN (cfun))
continue;
+ /* When multiple set bits in earliest edge, such edge may
+ have infinite loop in preds or succs or multiple conflict
+ vsetvl expression which make such edge is unrelated. We
+ don't perform fusion for such situation. */
+ if (bitmap_count_bits (e) != 1)
+ continue;
+
vsetvl_block_info &src_block_info = get_block_info (eg->src);
vsetvl_block_info &dest_block_info = get_block_info (eg->dest);