From 8e1fe3f779185cc678493ceda42c2e620a5c1387 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 12 Oct 2021 09:37:25 +0200 Subject: openmp: Avoid calling clear_type_padding_in_mask in the common case where there can't be any padding We can use the clear_padding_type_may_have_padding_p function, which is conservative for e.g. RECORD_TYPE/UNION_TYPE, but for the floating and complex floating types is accurate. clear_type_padding_in_mask is more expensive because we need to allocate memory, fill it, call the function which itself is more expensive and then analyze the memory, so for the common case of float/double atomics or even long double on most targets we can avoid that. 2021-10-12 Jakub Jelinek gcc/ * gimple-fold.h (clear_padding_type_may_have_padding_p): Declare. * gimple-fold.c (clear_padding_type_may_have_padding_p): No longer static. gcc/c-family/ * c-omp.c (c_finish_omp_atomic): Use clear_padding_type_may_have_padding_p. --- gcc/gimple-fold.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/gimple-fold.c') diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index 474d0f4..7fcfef4 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -4632,7 +4632,7 @@ clear_padding_real_needs_padding_p (tree type) /* Return true if TYPE might contain any padding bits. */ -static bool +bool clear_padding_type_may_have_padding_p (tree type) { switch (TREE_CODE (type)) -- cgit v1.1