[all-commits] [llvm/llvm-project] aaa33b: Fix assert "DeclRefExpr for Decl not entered in Lo...

jyu2-git via All-commits all-commits at lists.llvm.org
Tue May 30 16:47:53 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aaa33b6a98de2be7cdc827b13e60c103206d6461
      https://github.com/llvm/llvm-project/commit/aaa33b6a98de2be7cdc827b13e60c103206d6461
  Author: Jennifer Yu <jennifer.yu at intel.com>
  Date:   2023-05-30 (Tue, 30 May 2023)

  Changed paths:
    M clang/lib/CodeGen/CGOpenMPRuntime.cpp
    M clang/test/OpenMP/target_uses_allocators.c

  Log Message:
  -----------
  Fix assert "DeclRefExpr for Decl not entered in LocalDeclMap?"

Currently compiler assert when passing variable "memspace" in
omp_init_allocator.

omp_allocator_handle_t alloc=omp_init_allocator(memspace,1,traits)

The problem is memspace is not mapping to the target region.  During
the call to emitAllocatorInit, calls to EmitVarDecl for "alloc", then
emit initialization of "alloc" that cause to assert.

If I understant correct, it is not necessary to emit variable
initialization, since "allocator" is private to target region.

To fix this call CGF.EmitAutoVarAlloca(allocator) instead
CGF.EmitVarDecl(allocator).

Differential Revision: https://reviews.llvm.org/D151743




More information about the All-commits mailing list