[PATCH] D52733: [OpenMP][NVPTX] Avoid data sharing if in parallel region

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 2 12:49:38 PDT 2018


ABataev added a comment.

In https://reviews.llvm.org/D52733#1252963, @Hahnfeld wrote:

> In https://reviews.llvm.org/D52733#1251421, @ABataev wrote:
>
> > It might lead to increased register pressure, isn't it? Currently, I'm trying to emit the code that can be optimized out and, thus, may decrease the register pressure. That's why I tried to reduce the number of the runtime checks.
>
>
> You are right, it's increasing register usage but I think it shouldn't: The generated code is always checking `__kmpc_is_spmd_exec_mode` first. So if LLVM would be able to optimize this out in SPMD mode, `__kmpc_parallel_level` should never be called.
>
> I guess this doesn't work because it's illegal to hoist the load of `execution_param` across a barrier?


Even if we will be able to reduce register usage for SPMD, it still going to be high for non-SPMD constructs. The optimizer is not able to understand that it is in parallel region or not during the compilation phase


Repository:
  rC Clang

https://reviews.llvm.org/D52733





More information about the cfe-commits mailing list