This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[IPA branch] Re-enable aliasing
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, zadeck at naturalbridge dot com
- Date: Wed, 21 Sep 2005 00:54:12 +0200
- Subject: [IPA branch] Re-enable aliasing
Hi,
this patch should make IPA AA passes accept SSA form. This is just
quite change to get it working again, I made no attempt to actually
benefit something from SSA.
Honza
2005-09-21 Jan Hubicka <jh@suse.cz>
* ipa-type-escape.c (check_operand, check_tree, scan_for_refs): Handle
SSA_NAMEs.
(init_optimization_passes): Re-enable IPA passes.
Index: ipa-type-escape.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ipa-type-escape.c,v
retrieving revision 2.4
diff -c -3 -p -r2.4 ipa-type-escape.c
*** ipa-type-escape.c 1 Aug 2005 03:54:46 -0000 2.4
--- ipa-type-escape.c 20 Sep 2005 16:09:45 -0000
*************** check_operand (tree t)
*** 796,801 ****
--- 796,803 ----
if (TREE_CODE (t) == FUNCTION_DECL)
check_function_parameter_and_return_types (t, true);
+ else if (TREE_CODE (t) == SSA_NAME)
+ has_proper_scope_for_analysis (SSA_NAME_VAR (t));
else if (TREE_CODE (t) == VAR_DECL)
has_proper_scope_for_analysis (t);
}
*************** check_tree (tree t)
*** 821,826 ****
--- 823,831 ----
/* || TREE_CODE (t) == MEM_REF) */
check_tree (TREE_OPERAND (t, 0));
+ if (TREE_CODE (t) == SSA_NAME)
+ t = SSA_NAME_VAR (t);
+
if (SSA_VAR_P (t) || (TREE_CODE (t) == FUNCTION_DECL))
check_operand (t);
}
*************** look_for_address_of (tree t)
*** 903,908 ****
--- 908,915 ----
cref = TREE_OPERAND (cref, 0);
}
+ if (TREE_CODE (x) == SSA_NAME)
+ has_proper_scope_for_analysis (SSA_NAME_VAR (x));
if (TREE_CODE (x) == VAR_DECL)
has_proper_scope_for_analysis (x);
}
*************** scan_for_refs (tree *tp, int *walk_subtr
*** 1267,1273 ****
result so we do mark the resulting cast as being
bad. */
if (check_call (rhs))
! bitmap_set_bit (results_of_malloc, DECL_UID (lhs));
break;
default:
break;
--- 1274,1284 ----
result so we do mark the resulting cast as being
bad. */
if (check_call (rhs))
! {
! if (TREE_CODE (lhs) == SSA_NAME)
! lhs = SSA_NAME_VAR (lhs);
! bitmap_set_bit (results_of_malloc, DECL_UID (lhs));
! }
break;
default:
break;
Index: passes.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/passes.c,v
retrieving revision 2.108.2.6
diff -c -3 -p -r2.108.2.6 passes.c
*** passes.c 18 Sep 2005 13:00:25 -0000 2.108.2.6
--- passes.c 20 Sep 2005 16:09:45 -0000
*************** init_optimization_passes (void)
*** 434,443 ****
NEXT_PASS (pass_early_local_passes);
/*NEXT_PASS (pass_ipa_cp);*/
NEXT_PASS (pass_ipa_inline);
! /*NEXT_PASS (pass_ipa_alias);
NEXT_PASS (pass_ipa_reference);
NEXT_PASS (pass_ipa_pure_const);
! NEXT_PASS (pass_ipa_type_escape);*/
*p = NULL;
/* All passes needed to lower the function into shape optimizers can operate
--- 434,443 ----
NEXT_PASS (pass_early_local_passes);
/*NEXT_PASS (pass_ipa_cp);*/
NEXT_PASS (pass_ipa_inline);
! NEXT_PASS (pass_ipa_alias);
NEXT_PASS (pass_ipa_reference);
NEXT_PASS (pass_ipa_pure_const);
! NEXT_PASS (pass_ipa_type_escape);
*p = NULL;
/* All passes needed to lower the function into shape optimizers can operate