[llvm-branch-commits] [OpenMP][MLIR] Descriptor explicit member map lowering changes (PR #111191)

Akash Banerjee via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Oct 8 06:10:10 PDT 2024


================
@@ -2468,51 +2468,45 @@ static int getMapDataMemberIdx(MapInfoData &mapData, omp::MapInfoOp memberOp) {
   return std::distance(mapData.MapClause.begin(), res);
 }
 
-static omp::MapInfoOp getFirstOrLastMappedMemberPtr(omp::MapInfoOp mapInfo,
-                                                    bool first) {
-  DenseIntElementsAttr indexAttr = mapInfo.getMembersIndexAttr();
-
+static mlir::omp::MapInfoOp
+getFirstOrLastMappedMemberPtr(mlir::omp::MapInfoOp mapInfo, bool first) {
+  mlir::ArrayAttr indexAttr = mapInfo.getMembersIndexAttr();
   // Only 1 member has been mapped, we can return it.
   if (indexAttr.size() == 1)
-    if (auto mapOp =
-            dyn_cast<omp::MapInfoOp>(mapInfo.getMembers()[0].getDefiningOp()))
+    if (auto mapOp = mlir::dyn_cast<mlir::omp::MapInfoOp>(
----------------
TIFitis wrote:

Is there a scenario where the definingOp can be anything other than a MapInfoOp? If not, you can take get rid of the if statement and replace the `dyn_cast` with a `cast`.

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


More information about the llvm-branch-commits mailing list