================
@@ -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
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to