[PATCH] D111115: [OPENMP] Fix assert of "Unable to find base lambda address" from adjustMemberOfForLambdaCaptures.

Jennifer Yu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 4 21:55:22 PDT 2021


jyu2 created this revision.
jyu2 added reviewers: ABataev, mikerice, jdoerfert.
jyu2 added projects: clang, OpenMP.
Herald added subscribers: guansong, yaxunl.
jyu2 requested review of this revision.
Herald added a subscriber: sstefan1.

The problem is happening when user passes lambda function with reference
type in the map clause.

The natural of the problem is when processing generateInfoForCapture, the
BasePointer is generated with new load for a lambda variable with reference 
type.  It is not expected in adjustMemberOfForLambdaCaptures.

One way to fix this is to skipping call to generateInfoForCapture for
map(to:lambda).  The map info will be generated later in the call to
generateDefaultMapInfo, samiler as firsprivate clase.

This to fix https://bugs.llvm.org/show_bug.cgi?id=52071


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111115

Files:
  clang/lib/CodeGen/CGOpenMPRuntime.cpp
  clang/test/OpenMP/nvptx_lambda_pointer_capturing.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111115.377072.patch
Type: text/x-patch
Size: 5927 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211005/562fe85b/attachment.bin>


More information about the cfe-commits mailing list