TODO: We may elide the cases that the unnecessary IMM in
the future. */
- if (is_gimple_val (var) && !POINTER_TYPE_P (TREE_TYPE (var)))
+ if (poly_int_tree_p (var)
+ || (is_gimple_val (var)
+ && !POINTER_TYPE_P (TREE_TYPE (var))))
{
biggest_mode
= get_biggest_mode (biggest_mode,
update_local_live_ranges (
vec_info *vinfo,
hash_map<basic_block, vec<stmt_point>> &program_points_per_bb,
- hash_map<basic_block, hash_map<tree, pair>> &live_ranges_per_bb)
+ hash_map<basic_block, hash_map<tree, pair>> &live_ranges_per_bb,
+ machine_mode *biggest_mode)
{
loop_vec_info loop_vinfo = dyn_cast<loop_vec_info> (vinfo);
if (!loop_vinfo)
: get_store_value (gsi_stmt (si));
tree sel_type = build_nonstandard_integer_type (
TYPE_PRECISION (TREE_TYPE (var)), 1);
+ *biggest_mode
+ = get_biggest_mode (*biggest_mode, TYPE_MODE (sel_type));
tree sel = build_decl (UNKNOWN_LOCATION, VAR_DECL,
get_identifier ("vect_perm"), sel_type);
pair &live_range = live_ranges->get_or_insert (sel, &existed_p);
/* Update live ranges according to PHI. */
update_local_live_ranges (other->m_vinfo, program_points_per_bb,
- live_ranges_per_bb);
+ live_ranges_per_bb, &biggest_mode);
/* TODO: We calculate the maximum live vars base on current STMTS
sequence. We can support live range shrink if it can give us
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-march=rv32gcv -mabi=ilp32 -Ofast -ftree-vectorize --param riscv-autovec-lmul=dynamic" } */
+
+typedef struct rtx_def *rtx;
+struct replacement {
+ rtx *where;
+ rtx *subreg_loc;
+ int mode;
+};
+static struct replacement replacements[150];
+void move_replacements (rtx *x, rtx *y, int n_replacements)
+{
+ int i;
+ for (i = 0; i < n_replacements; i++)
+ if (replacements[i].subreg_loc == x)
+ replacements[i].subreg_loc = y;
+ else if (replacements[i].where == x)
+ {
+ replacements[i].where = y;
+ replacements[i].subreg_loc = 0;
+ }
+}