[Openmp-commits] [PATCH] D59319: [OpenMP][Offloading][1/3] A generic and simple target region interface

Alexey Bataev via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Mar 15 11:58:03 PDT 2019


ABataev added inline comments.


================
Comment at: openmp/libomptarget/deviceRTLs/common/target_region.h:104
+///
+EXTERN int8_t __kmpc_target_region_kernel_init(ident_t *Ident, bool UseSPMDMode,
+                                               bool RequiresOMPRuntime,
----------------
jdoerfert wrote:
> ABataev wrote:
> > If you're using `ident_t` `UseSPMDMode` and `RequiresOMPRuntime` parameters are not needed anymore. They are passed in `ident_t` structure.
> > If you're using ident_t UseSPMDMode and RequiresOMPRuntime parameters are not needed anymore. They are passed in ident_t structure.
> 
> They are not in the TRegion interface, at least not by the TRegion code generation. If required, we can add that or require the `__kmpc_target_region_kernel_init` implementation to store the values in the `ident_t`. Regardless, we do not want to hide the variables in the `ident_t` because that would result in worse analysis results and cause optimizations to be harder. The main point of all these changes is, after all, to make optimizations easy. Given that we expect these functions to be inlined, there is also no harm done wrt. runtime costs.
> 
> 
> 
> 
This is why we used them. Those `ident_t`s  are constant and it allows us to perform an additional optimization in the functions, that do not have `isSPMDMpde` and `RequiresFullRuntime`. Because of this parameter, we gained a significant performance boost. LLVM knows how to deal with the structures, don't worry about the optimization.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D59319





More information about the Openmp-commits mailing list