[Openmp-commits] [openmp] [Flang][OpenMP][MLIR] Initial array section mapping MLIR -> LLVM-IR lowering utilising omp.bounds (PR #68689)

via Openmp-commits openmp-commits at lists.llvm.org
Mon Oct 23 05:14:15 PDT 2023

@@ -1638,13 +1631,154 @@ getRefPtrIfDeclareTarget(mlir::Value value,
   return nullptr;
+// A small helper structure to contain data gathered
+// for map lowering and coalese it into one area and
+// avoiding extra computations such as searches in the
+// llvm module for lowered mapped varibles or checking
+// if something is declare target (and retrieving the
+// value) more than neccessary.
+struct MapData : llvm::OpenMPIRBuilder::MapInfosTy {
+  llvm::SmallVector<bool, 4> IsDeclareTarget;
+  llvm::SmallVector<mlir::Operation *, 4> MapClause;
+  llvm::SmallVector<llvm::Value *, 4> OriginalValue;
agozillon wrote:

It doesn't in a few cases (https://github.com/llvm/llvm-project/pull/68689/files#diff-2cbb5651f4570d81d55ac4198deda0f6f7341b2503479752ef2295da3774c586R2265), OriginalValue should never change, the idea is that it's the original unaltered value pointed to by the captured MLIR map_info. The BasePointer/Pointers can be reassigned to new instructions such as GEP offsets, declare target globals, etc. and align with the BasePointer/Pointers that will be assigned to the kernel argument structure


More information about the Openmp-commits mailing list