[flang-commits] [flang] [Flang][OpenMP] Make implicitly captured scalars fully firstprivatized (PR #147442)

Pranav Bhandarkar via flang-commits flang-commits at lists.llvm.org
Mon Jul 28 09:08:21 PDT 2025


================
@@ -55,6 +55,20 @@ class MapsForPrivatizedSymbolsPass
 
   omp::MapInfoOp createMapInfo(Location loc, Value var,
                                fir::FirOpBuilder &builder) {
+    // Check if a value of type `type` can be passed to the kernel by value.
+    // All kernel parameters are of pointer type, so if the value can be
+    // represented inside of a pointer, then it can be passed by value.
+    auto isLiteralType = [&](mlir::Type type) {
----------------
bhandarkar-pranav wrote:

Consider renaming the lambda to reflect that we really are checking if the range of a variable and not necessary literals only. For example, `canPassByValue`

https://github.com/llvm/llvm-project/pull/147442


More information about the flang-commits mailing list