[flang-commits] [flang] [mlir] [mlir][OpenMP][flang] make private variable allocation implicit in omp.private (PR #124019)

Leandro Lupori via flang-commits flang-commits at lists.llvm.org
Fri Jan 24 12:33:09 PST 2025


================
@@ -115,6 +115,25 @@ fir::ShapeShiftOp Fortran::lower::omp::getShapeShift(fir::FirOpBuilder &builder,
   return shapeShift;
 }
 
+static mlir::Value generateZeroShapeForRank(fir::FirOpBuilder &builder,
+                                            mlir::Location loc,
+                                            mlir::Value moldArg) {
+  mlir::Type moldVal = fir::unwrapRefType(moldArg.getType());
+  mlir::Type eleType = fir::dyn_cast_ptrOrBoxEleTy(moldVal);
+  fir::SequenceType seqTy =
+      mlir::dyn_cast_if_present<fir::SequenceType>(eleType);
+  if (!seqTy)
+    return nullptr;
----------------
luporl wrote:

nit: `mlir::Value{}` might be more readable.

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


More information about the flang-commits mailing list