This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Implement LoopLikeInterface for loop.parallel
ClosedPublic

Authored by tpopp on Mar 31 2020, 2:47 AM.

Details

Summary

This is to allow optimizations like loop invariant code motion to work
on the ParallelOp.

Diff Detail

Event Timeline

tpopp created this revision.Mar 31 2020, 2:47 AM
bondhugula added inline comments.
mlir/lib/Dialect/LoopOps/LoopOps.cpp
470

You don't need ->getOperation()

mlir/test/Transforms/loop-invariant-code-motion.mlir
266

Please always include CHECK-LABEL's when you aren't using -split-input-file. There is otherwise the chance of CHECK's matching with previous function's output while developing / changing / adding tests and this could be quite painful. Looks like the other tests here aren't following the right convention as well and should be fixed.

bondhugula requested changes to this revision.Mar 31 2020, 3:05 AM
bondhugula added inline comments.
mlir/lib/Dialect/LoopOps/LoopOps.cpp
478–479

Nit: containingOp

mlir/test/Transforms/loop-invariant-code-motion.mlir
282

You don't need %0 =

284

You don't need %1 =

This revision now requires changes to proceed.Mar 31 2020, 3:05 AM
tpopp updated this revision to Diff 253834.Mar 31 2020, 4:14 AM
tpopp marked 4 inline comments as done.

Replace ->getOperation() with dereference and run split-input-file on test file.

tpopp marked 2 inline comments as done.Mar 31 2020, 4:15 AM
tpopp added inline comments.
mlir/test/Transforms/loop-invariant-code-motion.mlir
266

I also split most test cases here. One test fails then, so I will have to follow up on that.

tpopp marked an inline comment as done.Mar 31 2020, 4:29 AM
tpopp updated this revision to Diff 253846.Mar 31 2020, 5:07 AM

Update map# on test case to allow splitting of test cases.

herhut accepted this revision.Mar 31 2020, 7:31 AM

Thanks!

This revision was not accepted when it landed; it landed in state Needs Review.Apr 1 2020, 7:53 AM
This revision was automatically updated to reflect the committed changes.
tpopp added a comment.Apr 1 2020, 7:58 AM

Uday, I landed this thinking you were doing more of a drive-by review, but I'll do a follow up commit if you have any more concerns.