mirrored from git://gcc.gnu.org/git/gcc.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redirect call within specific target attribute among MV clones (PR ip…
…a/82625). 2018-10-04 Martin Liska <mliska@suse.cz> PR ipa/82625 * multiple_target.c (redirect_to_specific_clone): New function. (ipa_target_clone): Use it. * tree-inline.c: Fix comment. 2018-10-04 Martin Liska <mliska@suse.cz> PR ipa/82625 * g++.dg/ext/pr82625.C: New test. From-SVN: r264845
- Loading branch information
Showing
5 changed files
with
100 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-require-ifunc "" } */ | ||
/* { dg-options "-O2 -fdump-tree-optimized" } */ | ||
|
||
__attribute__ ((target ("default"))) | ||
static unsigned foo(const char *buf, unsigned size) { | ||
return 1; | ||
} | ||
|
||
__attribute__ ((target ("avx"))) | ||
static unsigned foo(const char *buf, unsigned size) { | ||
return 2; | ||
} | ||
|
||
__attribute__ ((target ("default"))) | ||
unsigned bar() { | ||
char buf[4096]; | ||
unsigned acc = 0; | ||
for (int i = 0; i < sizeof(buf); i++) { | ||
acc += foo(&buf[i], 1); | ||
} | ||
return acc; | ||
} | ||
|
||
__attribute__ ((target ("avx"))) | ||
unsigned bar() { | ||
char buf[4096]; | ||
unsigned acc = 0; | ||
for (int i = 0; i < sizeof(buf); i++) { | ||
acc += foo(&buf[i], 1); | ||
} | ||
return acc; | ||
} | ||
|
||
/* { dg-final { scan-tree-dump-times "return 4096;" 1 "optimized" } } */ | ||
/* { dg-final { scan-tree-dump-times "return 8192;" 1 "optimized" } } */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters