[llvm-branch-commits] [flang] [llvm] [MLIR][OpenMP] Add a new AutomapToTargetData conversion pass in FIR (PR #151989)
Sergio Afonso via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Aug 8 05:27:40 PDT 2025
================
@@ -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
More information about the llvm-branch-commits
mailing list