3 Could not internalize function. Some optimizations may not be possible. [OMP140]
4 ====================================================================================================================
6 This analysis remark indicates that function internalization failed for the
7 given function. Internalization occurs when a call to a function that ordinarily
8 has external visibility is replaced with a call to a copy of that function with
9 only internal visibility. This allows the compiler to make strong static
10 assertions about the context a function is called in. Without internalization
11 this analysis would always be invalidated by the possibility of someone calling
12 the function in a different context outside of the current translation unit.
13 This is necessary for optimizations like :ref:`OMP111 <omp111>` and :ref:`OMP120
14 <omp120>`. If a function failed to be internalized it most likely has linkage
15 that cannot be copied. Internalization is currently only enabled by default for
16 OpenMP target offloading.
21 This will occur for any function declaration that has incompatible linkage.
25 __attribute__((weak)) void setup();
38 .. code-block:: console
40 $ clang++ -fopenmp -fopenmp-targets=nvptx64 -O1 -Rpass-analysis=openmp-opt omp140.cpp
41 omp140.cpp:1:1: remark: Could not internalize function. Some optimizations may not
43 __attribute__((weak)) void setup() {
49 OpenMP analysis remark.