(tree, tree, bool, loop_vec_info, tree, struct data_reference **);
static bool vect_analyze_offset_expr (tree, struct loop *, tree, tree *,
tree *, tree *);
+static tree vect_strip_conversion (tree);
/* Utility functions for the code transformation. */
static tree vect_create_destination_var (tree, tree);
}
+/* Function vect_strip_conversions
+
+ Strip conversions that don't narrow the mode. */
+
+static tree
+vect_strip_conversion (tree expr)
+{
+ tree to, ti, oprnd0;
+
+ while (TREE_CODE (expr) == NOP_EXPR || TREE_CODE (expr) == CONVERT_EXPR)
+ {
+ to = TREE_TYPE (expr);
+ oprnd0 = TREE_OPERAND (expr, 0);
+ ti = TREE_TYPE (oprnd0);
+
+ if (!INTEGRAL_TYPE_P (to) || !INTEGRAL_TYPE_P (ti))
+ return NULL_TREE;
+ if (GET_MODE_SIZE (TYPE_MODE (to)) < GET_MODE_SIZE (TYPE_MODE (ti)))
+ return NULL_TREE;
+
+ expr = oprnd0;
+ }
+ return expr;
+}
+
+
/* Function vect_analyze_offset_expr
Given an offset expression EXPR received from get_inner_reference, analyze
tree init, evolution, def_stmt;
/* Strip conversions that don't narrow the mode. */
- while (TREE_CODE (expr) == NOP_EXPR || TREE_CODE (expr) == CONVERT_EXPR)
- {
- tree to, ti;
-
- to = TREE_TYPE (expr);
- oprnd0 = TREE_OPERAND (expr, 0);
- ti = TREE_TYPE (oprnd0);
-
- if (!INTEGRAL_TYPE_P (to) || !INTEGRAL_TYPE_P (ti))
- return false;
- if (GET_MODE_SIZE (TYPE_MODE (to)) < GET_MODE_SIZE (TYPE_MODE (ti)))
- return false;
+ expr = vect_strip_conversion (expr);
+ if (!expr)
+ return false;
- expr = oprnd0;
- }
-
*step = NULL_TREE;
*misalign = NULL_TREE;
*initial_offset = NULL_TREE;
}
/* Recursive computation. */
+ if (!BINARY_CLASS_P (expr))
+ {
+ /* We expect to get binary expressions (PLUS/MINUS and MULT). */
+ if (vect_debug_details (NULL))
+ {
+ fprintf (dump_file, "Not binary expression ");
+ print_generic_expr (dump_file, expr, TDF_SLIM);
+ }
+ return false;
+ }
oprnd0 = TREE_OPERAND (expr, 0);
oprnd1 = TREE_OPERAND (expr, 1);
FORNOW: We don't support such cases. */
return false;
+ /* Strip conversions that don't narrow the mode. */
+ left_offset = vect_strip_conversion (left_offset);
+ if (!left_offset)
+ return false;
/* Misalignment computation. */
if (SSA_VAR_P (left_offset))
{