OMP builtins in offloading

Thomas Schwinge thomas@codesourcery.com
Wed Aug 4 09:46:35 GMT 2021


Hi!

On 2015-01-08T16:41:50+0100, I wrote:
> Committed to trunk in r219346:

(Git commit 45f46750a3513790573791c0eec6b600b42f2042.)

>     Make sure that OMP builtins are available in offloading compilers.

> --- gcc/builtins.def
> +++ gcc/builtins.def
> @@ -148,11 +148,14 @@ along with GCC; see the file COPYING3.  If not see
>
>  /* Builtin used by the implementation of GNU OpenMP.  None of these are
>     actually implemented in the compiler; they're all in libgomp.  */
> +/* These builtins also need to be enabled in offloading compilers invoked from
> +   mkoffload; for that purpose, we're checking the -foffload-abi flag here.  */
>  #undef DEF_GOMP_BUILTIN
>  #define DEF_GOMP_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
>    DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE,    \
>                 false, true, true, ATTRS, false, \
> -            (flag_openmp || flag_tree_parallelize_loops))
> +            (flag_openmp || flag_tree_parallelize_loops \
> +             || flag_offload_abi != OFFLOAD_ABI_UNSET))

(Similar for 'DEF_GOACC_BUILTIN', later.)

Since Tom's PR64707 commit r220037 (Git commit
1506ae0e1e865fb7a42fc37a47f1799b71f21c53) "Make fopenmp an LTO option" as
well as PR64672 commit r220038 (Git commit
a0c88d0629a33161add8d5bc083f1e59f3f756f7) "Make fopenacc an LTO option",
we're now actually passing '-fopenacc'/'-fopenmp' to the 'mkoffload's,
which will pass these on to the offload compilers, so we may clean up
this change.

OK to push "Don't consider '-foffload-abi' in 'DEF_GOACC_BUILTIN',
'DEF_GOMP_BUILTIN'", see attached?


Grüße
 Thomas


-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Don-t-consider-foffload-abi-in-DEF_GOACC_BUILTIN-DEF.patch
Type: text/x-diff
Size: 3521 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210804/af71df53/attachment.bin>


More information about the Gcc-patches mailing list