This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Parallelize affine.for op to 1-D affine.parallel op
ClosedPublic

Authored by yash on Jul 6 2020, 1:33 AM.

Details

Summary

Introduce pass to convert parallel affine.for op into 1-D affine.parallel op. Run using --affine-parallelize. Removes test-detect-parallel: pass for checking parallel affine.for ops.

Signed-off-by: Yash Jain <yash.jain@polymagelabs.com>

Diff Detail

Event Timeline

yash created this revision.Jul 6 2020, 1:33 AM

This was reverted earlier due to a build failure. https://reviews.llvm.org/rGfbc06b228012

yash updated this revision to Diff 275606.Jul 6 2020, 1:53 AM

Build functional with -DBUILD_SHARED_LIBS=ON in use.

bondhugula requested changes to this revision.Jul 9 2020, 8:14 AM
bondhugula added inline comments.
mlir/include/mlir/Dialect/Affine/Utils.h
26

You can't have the declaration in Utils.h (part of AffineUtils) and have the definition in AffineParallelize.cpp (part of AffineTransforms). Those who need it and depend on AffineUtils are going to get a link error. If you expose it from Utils.h, the definition has to move to Affine/Utils.cpp.

This revision now requires changes to proceed.Jul 9 2020, 8:14 AM
yash updated this revision to Diff 276995.Jul 10 2020, 5:06 AM

Code shifted to Utils.cpp

yash updated this revision to Diff 276996.Jul 10 2020, 5:07 AM
yash marked an inline comment as done.

Minor Updates

The build failure says your patch couldn't be applied. Please rebase on current tip and update.

yash updated this revision to Diff 277233.Jul 11 2020, 4:51 AM

Build Successful with new build method of Affine.parallel

bondhugula accepted this revision.Jul 11 2020, 9:02 AM
This revision is now accepted and ready to land.Jul 11 2020, 9:02 AM
This revision was automatically updated to reflect the committed changes.
mlir/test/Dialect/Affine/parallelize.mlir