summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/tree-ssa-pre.c
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2012-06-12 15:04:18 +0000
committerpfg <pfg@FreeBSD.org>2012-06-12 15:04:18 +0000
commita6eb26cf6f3dbbb726fd6e5e9f02f222df40cdf8 (patch)
treeb2fbef554d2610927edad3f5917fcc94f901f6c1 /contrib/gcc/tree-ssa-pre.c
parent33675cab555bc824f32778ba0fed56733a19ef6e (diff)
downloadFreeBSD-src-a6eb26cf6f3dbbb726fd6e5e9f02f222df40cdf8.zip
FreeBSD-src-a6eb26cf6f3dbbb726fd6e5e9f02f222df40cdf8.tar.gz
Add experimental support for amdfam10/barcelona from the GCC 4.3 branch.
Initial support for the AMD barcelona chipsets has been available in the gcc43 branch under GPLv2 but was not included when the Core 2 support was brought to the system gcc. AMD and some linux distributions (OpenSUSE) did a backport of the amdfam10 support and made them available. Unfortunately this is still experimental and while it can improve performance, enabling the CPUTYPE may break some C++ ports (like clang). Special care was taken to make sure that the patches predate the GPLv3 switch upstream. Tested by: Vladimir Kushnir Reviewed by: mm Approved by: jhb (mentor) MFC after: 2 weeks
Diffstat (limited to 'contrib/gcc/tree-ssa-pre.c')
-rw-r--r--contrib/gcc/tree-ssa-pre.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/contrib/gcc/tree-ssa-pre.c b/contrib/gcc/tree-ssa-pre.c
index 9c7b89f..ba32b3c 100644
--- a/contrib/gcc/tree-ssa-pre.c
+++ b/contrib/gcc/tree-ssa-pre.c
@@ -1076,6 +1076,7 @@ phi_translate (tree expr, value_set_t set, basic_block pred,
tree newexpr;
tree vh = get_value_handle (expr);
bool listchanged = false;
+ bool invariantarg = false;
VEC (tree, gc) *vuses = VALUE_HANDLE_VUSES (vh);
VEC (tree, gc) *tvuses;
@@ -1134,10 +1135,26 @@ phi_translate (tree expr, value_set_t set, basic_block pred,
if (newval != oldval)
{
listchanged = true;
+ invariantarg |= is_gimple_min_invariant (newval);
TREE_VALUE (newwalker) = get_value_handle (newval);
}
}
}
+
+ /* In case of new invariant args we might try to fold the call
+ again. */
+ if (invariantarg)
+ {
+ tree tmp = fold_ternary (CALL_EXPR, TREE_TYPE (expr),
+ newop0, newarglist, newop2);
+ if (tmp)
+ {
+ STRIP_TYPE_NOPS (tmp);
+ if (is_gimple_min_invariant (tmp))
+ return tmp;
+ }
+ }
+
if (listchanged)
vn_lookup_or_add (newarglist, NULL);
OpenPOWER on IntegriCloud