[PATCH] D70172: [CUDA][HIP][OpenMP] Emit deferred diagnostics by a post-parsing AST travese

Wei Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 26 10:01:55 PDT 2021


weiwang added a comment.

In D70172#2964118 <https://reviews.llvm.org/D70172#2964118>, @sugak wrote:

> Hi @yaxunl! I'm working on upgrading a large codebase from LLVM-9 to LLVM-12. I noticed on average 10% compilation speed regression that seems to be caused this change. We use Clang modules and historically provide `-fopenmp` compiler flag by default. The problem seems to be that compiling and importing modules is now slower, with the generated modules size increased by 2X. llvm-bcanalyzer tool shows that it's dominated by `DECLS_TO_CHECK_FOR_DEFERRED_DIAGS`.  If I understand it right, your change is only relevant when target offloading is used. I inspected all of `#pragma omp` directives and can confirm that we don't use it.
>
> I see that most of this code is gated by OpenMP flag. I wonder if there is a finer grain way to enable openmp parallel code generation without target offloading? Would it make sense to extend this code to check if `-fopenom-targets` is set before recording `DECLS_TO_CHECK_FOR_DEFERRED_DIAGS`?
>
> Note, this was measured with @weiwang's https://reviews.llvm.org/D101793.

We did an internal measurement by not adding decls into deferred diags, and that resolves the build regression. Wonder if we can have a special case for emitting diag as they are encountered when everything is on host side.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70172/new/

https://reviews.llvm.org/D70172



More information about the cfe-commits mailing list