summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-26 15:46:14 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-26 15:46:14 +0000
commit7c2ed7d7f7183e4c8c30bd3d483e9ced00b92a18 (patch)
tree9dffc470a7ede6e5dcb4084aecdc835c621898a8
parent25c067ae9a952745db033e75e007ab3a26965f0c (diff)
downloadgcc-7c2ed7d7f7183e4c8c30bd3d483e9ced00b92a18.tar.gz
2012-03-26 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/50052 * tree-sra.c (tree_non_aligned_mem_p): Removed. (tree_non_aligned_mem_for_access_p): Likewise. (build_accesses_from_assign): Removed strict alignment requirements checks. (access_precludes_ipa_sra_p): Likewise. * testsuite/gcc.dg/ipa/ipa-sra-2.c: Also run on strict-alignment platforms. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185807 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c1
-rw-r--r--gcc/tree-sra.c59
4 files changed, 15 insertions, 59 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4dce3474c38..697b5b1f345 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2012-03-26 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/50052
+ * tree-sra.c (tree_non_aligned_mem_p): Removed.
+ (tree_non_aligned_mem_for_access_p): Likewise.
+ (build_accesses_from_assign): Removed strict alignment requirements
+ checks.
+ (access_precludes_ipa_sra_p): Likewise.
+
2012-03-26 Richard Guenther <rguenther@suse.de>
PR tree-optimization/52701
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 867b8ca6180..e28c3dd0f51 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-26 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/50052
+ * gcc.dg/ipa/ipa-sra-2.c: Also run on strict-alignment platforms.
+
2012-03-26 Richard Guenther <rguenther@suse.de>
PR tree-optimization/52701
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c b/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c
index c6b4d63aa78..3437a81aa2c 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fipa-sra -fdump-tree-eipa_sra-details" } */
-/* { dg-require-effective-target non_strict_align } */
struct bovid
{
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 6cf6c15d4a4..4d1aa5f1eca 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -1081,53 +1081,6 @@ disqualify_ops_if_throwing_stmt (gimple stmt, tree lhs, tree rhs)
return false;
}
-/* Return true if EXP is a memory reference less aligned than ALIGN. This is
- invoked only on strict-alignment targets. */
-
-static bool
-tree_non_aligned_mem_p (tree exp, unsigned int align)
-{
- unsigned int exp_align;
-
- if (TREE_CODE (exp) == VIEW_CONVERT_EXPR)
- exp = TREE_OPERAND (exp, 0);
-
- if (TREE_CODE (exp) == SSA_NAME || is_gimple_min_invariant (exp))
- return false;
-
- /* get_object_alignment will fall back to BITS_PER_UNIT if it cannot
- compute an explicit alignment. Pretend that dereferenced pointers
- are always aligned on strict-alignment targets. */
- if (TREE_CODE (exp) == MEM_REF || TREE_CODE (exp) == TARGET_MEM_REF)
- exp_align = get_object_or_type_alignment (exp);
- else
- exp_align = get_object_alignment (exp);
-
- if (exp_align < align)
- return true;
-
- return false;
-}
-
-/* Return true if EXP is a memory reference less aligned than what the access
- ACC would require. This is invoked only on strict-alignment targets. */
-
-static bool
-tree_non_aligned_mem_for_access_p (tree exp, struct access *acc)
-{
- unsigned int acc_align;
-
- /* The alignment of the access is that of its expression. However, it may
- have been artificially increased, e.g. by a local alignment promotion,
- so we cap it to the alignment of the type of the base, on the grounds
- that valid sub-accesses cannot be more aligned than that. */
- acc_align = get_object_alignment (acc->expr);
- if (acc->base && acc_align > TYPE_ALIGN (TREE_TYPE (acc->base)))
- acc_align = TYPE_ALIGN (TREE_TYPE (acc->base));
-
- return tree_non_aligned_mem_p (exp, acc_align);
-}
-
/* Scan expressions occuring in STMT, create access structures for all accesses
to candidates for scalarization and remove those candidates which occur in
statements or expressions that prevent them from being split apart. Return
@@ -1154,11 +1107,7 @@ build_accesses_from_assign (gimple stmt)
lacc = build_access_from_expr_1 (lhs, stmt, true);
if (lacc)
- {
- lacc->grp_assignment_write = 1;
- if (STRICT_ALIGNMENT && tree_non_aligned_mem_for_access_p (rhs, lacc))
- lacc->grp_unscalarizable_region = 1;
- }
+ lacc->grp_assignment_write = 1;
if (racc)
{
@@ -1166,8 +1115,6 @@ build_accesses_from_assign (gimple stmt)
if (should_scalarize_away_bitmap && !gimple_has_volatile_ops (stmt)
&& !is_gimple_reg_type (racc->type))
bitmap_set_bit (should_scalarize_away_bitmap, DECL_UID (racc->base));
- if (STRICT_ALIGNMENT && tree_non_aligned_mem_for_access_p (lhs, racc))
- racc->grp_unscalarizable_region = 1;
}
if (lacc && racc
@@ -3835,10 +3782,6 @@ access_precludes_ipa_sra_p (struct access *access)
|| gimple_code (access->stmt) == GIMPLE_ASM))
return true;
- if (STRICT_ALIGNMENT
- && tree_non_aligned_mem_p (access->expr, TYPE_ALIGN (access->type)))
- return true;
-
return false;
}