This is an archive of the discontinued LLVM Phabricator instance.

[OMP] Fix compiler assert "DeclRefExpr for Decl not entered in LocalDeclMap?"
ClosedPublic

Authored by jyu2 on May 30 2023, 11:58 AM.

Details

Summary

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).

Diff Detail

Event Timeline

jyu2 created this revision.May 30 2023, 11:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 30 2023, 11:58 AM
jyu2 requested review of this revision.May 30 2023, 11:58 AM
This revision is now accepted and ready to land.May 30 2023, 12:07 PM
This revision was landed with ongoing or failed builds.May 30 2023, 4:47 PM
This revision was automatically updated to reflect the committed changes.