gcc_unreachable ();
}
+/* Returns TRUE if the callee of E has a callback attribute. */
+bool
+callback_edge_callee_has_attr (cgraph_edge *e)
+{
+ return lookup_attribute (CALLBACK_ATTR_IDENT,
+ DECL_ATTRIBUTES (e->callee->decl))
+ || callback_is_special_cased (e->callee->decl, e->call_stmt);
+}
+
/* Given an instance of callback attribute, return the 0-based
index of the called function in question. */
int
/* Returns an attribute for a special cased function. */
tree callback_special_case_attr (tree decl);
+/* Returns TRUE if the callee of E has a callback attribute. */
+bool callback_edge_callee_has_attr (cgraph_edge *e);
+
/* Given an instance of callback attribute, return the 0-based
index of the called function in question. */
int callback_get_fn_index (tree cb_attr);
/* We do not need to bother analyzing calls to unknown functions
unless they may become known during lto/whopr. */
if (!callee->definition && !flag_lto
- && !gimple_call_fnspec (cs->call_stmt).known_p ())
+ && !gimple_call_fnspec (cs->call_stmt).known_p ()
+ && !callback_edge_callee_has_attr (cs))
continue;
}
ipa_compute_jump_functions_for_edge (fbi, cs);
/* Test that GOMP_task is special cased when cpyfn is NULL. */
/* { dg-do run } */
-/* { dg-options "-O3 -fopenmp -flto -std=gnu99 -fdump-ipa-cp-details" } */
+/* { dg-options "-O3 -fopenmp -std=gnu99 -fdump-ipa-cp-details" } */
/* { dg-require-effective-target fopenmp } */
-/* { dg-require-effective-target lto } */
void test(int c) {
for (int i = 0; i < c; i++)
return 0;
}
-/* { dg-final { scan-wpa-ipa-dump "Creating a specialized node of main._omp_fn" "cp" } } */
+/* { dg-final { scan-ipa-dump "Creating a specialized node of main._omp_fn" "cp" } } */
NULL. */
/* { dg-do run } */
-/* { dg-options "-O3 -fopenmp -flto -std=gnu99 -fdump-ipa-cp-details" } */
+/* { dg-options "-O3 -fopenmp -std=gnu99 -fdump-ipa-cp-details" } */
/* { dg-require-effective-target fopenmp } */
-/* { dg-require-effective-target lto } */
void test(int *a) {
for (int i = 0; i < 100; i++) {
This tests the underlying callback attribute and its related edges. */
/* { dg-do run } */
-/* { dg-options "-O3 -fopenmp -flto -std=gnu99 -fdump-ipa-cp-details" } */
+/* { dg-options "-O3 -fopenmp -std=gnu99 -fdump-ipa-cp-details" } */
/* { dg-require-effective-target fopenmp } */
-/* { dg-require-effective-target lto } */
int a[100];
void test(int c) {
return a[5] - 5;
}
-/* { dg-final { scan-wpa-ipa-dump "Creating a specialized node of test._omp_fn" "cp" } } */
-/* { dg-final { scan-wpa-ipa-dump "Aggregate replacements: 0\\\[0]=100\\(by_ref\\)" "cp" } } */
+/* { dg-final { scan-ipa-dump "Creating a specialized node of test._omp_fn" "cp" } } */
+/* { dg-final { scan-ipa-dump "Aggregate replacements: 0\\\[0]=100\\(by_ref\\)" "cp" } } */