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

Jonas Hahnfeld via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 2 12:55:54 PDT 2018


Hahnfeld added a comment.

In https://reviews.llvm.org/D52733#1252966, @ABataev wrote:

> 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


Instead we avoid the runtime overhead of data sharing. Plus we'll be able to drop around 2 thirds of the static data allocation in `libomptarget-nvptx` which leaves more room for the user's application... We'll see, for now I agree that the added registers for SPMD are unacceptable.


Repository:
  rC Clang

https://reviews.llvm.org/D52733





More information about the cfe-commits mailing list