Fix assert of "Unable to find base lambda address" from
authorJennifer Yu <jennifer.yu@intel.com>
Mon, 4 Oct 2021 23:54:47 +0000 (16:54 -0700)
committerJennifer Yu <jennifer.yu@intel.com>
Wed, 6 Oct 2021 21:14:28 +0000 (14:14 -0700)
commita4743eba3c13799e667777764554fd44ccc6a33a
tree1745c694bcc11605875a894da91eeea63aba91c7
parentc7e72784aef9ee5f32e438e4d2d09a9710d5538b
Fix assert of "Unable to find base lambda address" from
adjustMemberOfForLambdaCaptures.

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

The natural of the problem 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

Differential Revision:https://reviews.llvm.org/D111115
clang/lib/CodeGen/CGOpenMPRuntime.cpp
clang/test/OpenMP/nvptx_lambda_pointer_capturing.cpp