[PATCH] D153883: [Clang][OpenMP] Delay emission of __kmpc_alloc_shared for escaped VLAs
Alexey Bataev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 5 13:58:20 PDT 2023
ABataev added inline comments.
================
Comment at: clang/lib/CodeGen/CGDecl.cpp:1606
+ CGOpenMPRuntimeGPU &RT =
+ *(static_cast<CGOpenMPRuntimeGPU *>(&CGM.getOpenMPRuntime()));
+ if (RT.isDelayedVariableLengthDecl(*this, &D)) {
----------------
ABataev wrote:
> 1. use `static_cast<CGOpenMPRuntimeGPU &>(CGM.getOpenMPRuntime())`
> 2. It will crash if your device is not GPU. Better to make `getKmpcAllocShared` and `getKmpcFreeShared` virtual (just like `isDelayedVariableLengthDecl`) in base CGOpenMPRuntime, since it may be required not only for GPU-based devices.
Check the second item, please, better to make all new member function virtual and handle it for non-GPU devices too
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153883/new/
https://reviews.llvm.org/D153883
More information about the cfe-commits
mailing list