summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authoriverbin <iverbin@138bc75d-0d04-0410-961f-82ee72b054a4>2016-07-22 15:00:42 +0000
committeriverbin <iverbin@138bc75d-0d04-0410-961f-82ee72b054a4>2016-07-22 15:00:42 +0000
commit5a43070dcb85787cfa4ea3d99f1d0ef9d0aed002 (patch)
treee3096eb4b928ba0354581d72f075114677f6c73a /gcc
parent59c1507a8f0e7b132f2056c9fc4130ee5b166ee3 (diff)
downloadgcc-5a43070dcb85787cfa4ea3d99f1d0ef9d0aed002.tar.gz
2016-07-22 Evgeny Stupachenko <evstupac@gmail.com>
gcc/ * ipa-cp.c (determine_versionability): Do not create constprop clones, when target_clones attribute is set. gcc/testsuite/ * gcc.target/i386/mvc8.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@238645 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/ipa-cp.c7
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/i386/mvc8.c14
4 files changed, 30 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4f67430ec6f..8eb011ccbf3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2016-07-22 Evgeny Stupachenko <evstupac@gmail.com>
+
+ * ipa-cp.c (determine_versionability): Do not create constprop clones,
+ when target_clones attribute is set.
+
2016-07-22 Bin Cheng <bin.cheng@arm.com>
* common.opt (funsafe-loop-optimizations): Mark ignore.
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 4b7f6bbf31c..5b6cb9a143f 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -533,6 +533,13 @@ determine_versionability (struct cgraph_node *node,
coexist, but that may not be worth the effort. */
reason = "function has SIMD clones";
}
+ else if (lookup_attribute ("target_clones", DECL_ATTRIBUTES (node->decl)))
+ {
+ /* Ideally we should clone the target clones themselves and create
+ copies of them, so IPA-cp and target clones can happily
+ coexist, but that may not be worth the effort. */
+ reason = "function target_clones attribute";
+ }
/* Don't clone decls local to a comdat group; it breaks and for C++
decloned constructors, inlining is always better anyway. */
else if (node->comdat_local_p ())
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7cef33787ad..0a48a17c714 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2016-07-22 Evgeny Stupachenko <evstupac@gmail.com>
+
+ * gcc.target/i386/mvc8.c: New test.
+
2016-07-22 Bin Cheng <bin.cheng@arm.com>
* gcc.dg/tree-ssa/pr19210-1.c: Refine test strings.
diff --git a/gcc/testsuite/gcc.target/i386/mvc8.c b/gcc/testsuite/gcc.target/i386/mvc8.c
new file mode 100644
index 00000000000..97d7941a5ab
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mvc8.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "-O3 -fno-inline" } */
+/* { dg-final { scan-assembler-not "constprop" } } */
+__attribute__((target_clones("arch=core-avx2","arch=slm","default")))
+void foo (float *a, int b) {
+ *a = (float)b;
+}
+float a;
+int main() {
+ int i;
+ for (i = 0; i < 1024; i++)
+ foo (&a, 5);
+}