================ @@ -72,6 +77,36 @@ struct EntryBlockArgs { /// \param [in] region - Empty region in which to create the entry block. mlir::Block *genEntryBlock( mlir::OpBuilder &builder, const EntryBlockArgs &args, mlir::Region ®ion); + +// Returns true if the variable has a dynamic size and therefore requires +// bounds operations to describe its extents. +static bool needsBoundsOps(mlir::Value var) { + assert(mlir::isa<mlir::omp::PointerLikeType>(var.getType()) && + "only pointer like types expected"); + mlir::Type t = fir::unwrapRefType(var.getType()); + if (mlir::Type inner = fir::dyn_cast_ptrOrBoxEleTy(t)) { + return fir::hasDynamicSize(inner); + } ---------------- skatrak wrote:
```suggestion if (mlir::Type inner = fir::dyn_cast_ptrOrBoxEleTy(t)) return fir::hasDynamicSize(inner); ``` https://github.com/llvm/llvm-project/pull/151989 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits