Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Almost fixed the AFMV error messages #34

Open
wants to merge 1 commit into
base: 2024-S-FMV-automatic-function-cloning
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added gcc/hello
Binary file not shown.
7 changes: 7 additions & 0 deletions gcc/hello.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <stdio.h>

__attribute__((target_clones("default","sve2","sve")))
int main() {
printf("Hello, World!\n");
}

5 changes: 3 additions & 2 deletions gcc/multiple_target.cc
Original file line number Diff line number Diff line change
Expand Up @@ -387,16 +387,17 @@ expand_target_clones (struct cgraph_node *node, bool definition)
DECL_FUNCTION_VERSIONED (node->decl) = 1;

const int no_of_attr=2;//declaring the number of hardcoded target archietecture we want to pass
char attr_array[no_of_attr][5]={"sve-bf16","sve2"};// hard coded targets
char attr_array[no_of_attr][5]={"sve","sve2"};// hard coded targets

for (i = 0; i < attrnum; i++)
for (i = 0; i < no_of_attr; i++)
{
char *attr = attr_array[i];//changing the array name

/* Create new target clone. */
tree attributes = make_attribute (new_attr_name, attr,
DECL_ATTRIBUTES (node->decl));


char *suffix = XNEWVEC (char, strlen (attr) + 1);
create_new_asm_name (attr, suffix);
cgraph_node *new_node = create_target_clone (node, definition, suffix,
Expand Down
8 changes: 8 additions & 0 deletions hello.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <stdio.h>

__attribute__((target_clones("default","sve2")))
int main() {
// Print "Hello, World!" to the console
printf("Hello, World!\n");
}