Commit 7d23434b by Ira Rosen Committed by Dorit Nuzman

tree-vectorizer.c (vect_strip_conversions): New function.

2005-01-03  Ira Rosen  <irar@il.ibm.com>

        * tree-vectorizer.c (vect_strip_conversions): New function.
        (vect_analyze_offset_expr): Call vect_strip_conversions. Add
        check for binary class.

From-SVN: r92888
parent 1aae12a2
2005-01-03 Ira Rosen <irar@il.ibm.com>
* tree-vectorizer.c (vect_strip_conversions): New function.
(vect_analyze_offset_expr): Call vect_strip_conversions. Add
check for binary class.
2005-01-03 Daniel Berlin <dberlin@dberlin.org>
Fix PR debug/17924
......
......@@ -230,6 +230,7 @@ static tree vect_get_memtag_and_dr
(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);
......@@ -1339,6 +1340,32 @@ vect_get_ptr_offset (tree ref ATTRIBUTE_UNUSED,
}
/* 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
......@@ -1391,22 +1418,10 @@ vect_analyze_offset_expr (tree expr,
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;
......@@ -1463,6 +1478,16 @@ vect_analyze_offset_expr (tree expr,
}
/* 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);
......@@ -1483,6 +1508,10 @@ vect_analyze_offset_expr (tree expr,
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))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment