/* Single entry single exit control flow regions.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009, 2010
+ Free Software Foundation, Inc.
Contributed by Jan Sjodin <jan.sjodin@amd.com> and
Sebastian Pop <sebastian.pop@amd.com>.
#include "rtl.h"
#include "basic-block.h"
#include "diagnostic.h"
+#include "tree-pretty-print.h"
#include "tree-flow.h"
#include "toplev.h"
#include "tree-dump.h"
to translate the names of induction variables. */
static tree
-expand_scalar_variables_ssa_name (tree op0, basic_block bb,
+expand_scalar_variables_ssa_name (tree type, tree op0, basic_block bb,
sese region, htab_t map,
gimple_stmt_iterator *gsi)
{
if (is_parameter (region, op0)
|| is_iv (op0))
- return get_rename (map, op0);
+ return fold_convert (type, get_rename (map, op0));
def_stmt = SSA_NAME_DEF_STMT (op0);
if (new_op != op0
&& gimple_bb (SSA_NAME_DEF_STMT (new_op)) == bb)
- return new_op;
+ return fold_convert (type, new_op);
if (gimple_bb (def_stmt) == bb)
{
we do not need to create a new expression for it, we
only need to ensure its operands are expanded. */
expand_scalar_variables_stmt (def_stmt, bb, region, map, gsi);
- return new_op;
+ return fold_convert (type, new_op);
}
else
{
if (!gimple_bb (def_stmt)
|| !bb_in_sese_p (gimple_bb (def_stmt), region))
- return new_op;
+ return fold_convert (type, new_op);
switch (gimple_code (def_stmt))
{
{
tree old_name = TREE_OPERAND (op0, 0);
tree expr = expand_scalar_variables_ssa_name
- (old_name, bb, region, map, gsi);
+ (type, old_name, bb, region, map, gsi);
if (TREE_CODE (expr) != SSA_NAME
&& is_gimple_reg (old_name))
}
if (code == SSA_NAME)
- return expand_scalar_variables_ssa_name (op0, bb, region, map, gsi);
+ return expand_scalar_variables_ssa_name (type, op0, bb, region, map, gsi);
if (code == ADDR_EXPR)
{
/* Creates an IFSESE with CONDITION on edge ENTRY. */
-ifsese
+static ifsese
create_if_region_on_edge (edge entry, tree condition)
{
edge e;