Skip to content
Snippets Groups Projects
Commit 8e1fe3f7 authored by Jakub Jelinek's avatar Jakub Jelinek
Browse files

openmp: Avoid calling clear_type_padding_in_mask in the common case where...

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  <jakub@redhat.com>

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.
parent 4096bf82
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment