[PATCH] D105584: [MLIR][OpenMP] Distribute Construct Operation

Abid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 24 09:04:54 PDT 2022


abidmalikwaterloo marked an inline comment as done.
abidmalikwaterloo added inline comments.
Herald added a subscriber: bzcheeseman.


================
Comment at: clang/lib/Testing/CMakeLists.txt:29
   llvm_gtest
+  clangBasic
+  clangFrontend
----------------
shraiysh wrote:
> abidmalikwaterloo wrote:
> > shraiysh wrote:
> > > unrelated change?
> > When I rebase, these changes were highlighted in the main branch which was missing in the patch as it was too old.
> Hmm, these are in llvm-project/main right now but this means that the patch has not been rebased properly. These changes should not be a part of this patch :/ Can you try rebasing again? Otherwise this will cause issues while/after landing this patch.
git rebase origin arcpatch-D105584 gives " The current branch is up to date". It means the patch is up to date. Should I remove them manually?


================
Comment at: mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td:514
+    oilist(`schedule` `(`
+              custom<DistributeScheduleClause>(
+               $dist_schedule_var,
----------------
shraiysh wrote:
> abidmalikwaterloo wrote:
> > shraiysh wrote:
> > > dist_schedule is a dummy clause, where kind is only allowed to be `static` according to the standard. I don't think that requires a custom function, we can instead have something like the following -
> > > ```
> > > arguments = UnitAttr:$static_dist_schedule, Optional<IntLikeType>:$schedule_chunk
> > > 
> > > assemblyFormat = `dist_schedule` `(` (`static` $static_dist_schedule^)? (`:` $schedule_chunk^)? `)`
> > > ```
> > > Would that work? Let me know if there are any suggestions.
> > My only concern is; will this be a dummy clause with the static scheduler forever? I am pretty sure dist_schedule will have a dynamic or a  user defined scheduling strategy as well to improve the performance of a given application 
> If and when it changes in the standard, at that time we can change the parsing/printing accordingly. Till then such a function seems unnecessary and a possible source of errors because it accepts invalid OpenMP code.
Should it be then?  `dist_schedule` `(` (`static` ) (`:` $schedule_chunk^)? `)`
$static_dist_schedule  seems redundant??? 


================
Comment at: mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td:528
+
+  let regions = (region AnyRegion:$region);
+}
----------------
shraiysh wrote:
> abidmalikwaterloo wrote:
> > shraiysh wrote:
> > > I think we need a verifier for this too. There are a couple semantic checks which we can do in verifier.
> > Can you say more about the semantic checks you have in mind?
> The following restriction from the standard can be added to the verifier/Operation definition - 
> > The region corresponding to the distribute construct must be strictly nested inside a teams region.
> 
> The other restrictions - I am okay with not adding them because I don't know how they would be added. Needless to say if we figure out how to add them, then we should do it.
At this stage, we can add:

LogicalResult DistributeOp::verify(){
           return success();
}

We can add the check later!


================
Comment at: mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp:226
+    	return parser.emitError(parser.getNameLoc()) <<
+    				" expected scheudle kind";
+    
----------------
shraiysh wrote:
> nit: schedule spelling.
I do not think we need this if we treat the schedule as a variable?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105584/new/

https://reviews.llvm.org/D105584



More information about the cfe-commits mailing list