This is an archive of the discontinued LLVM Phabricator instance.

Make gpu.launch implicitly capture uses of values defined above.
ClosedPublic

Authored by herhut on Jan 31 2020, 1:33 AM.

Details

Summary

In the original design, gpu.launch required explicit capture of uses
and passing them as operands to the gpu.launch operation. This was
motivated by infrastructure reestrictions rather than design. This
change lifts the requirement and removes the concept of kernel
arguments from gpu.launch. Instead, the kernel outlining
transformation now does the explicit capturing.

This is a breaking change for users of gpu.launch.

Diff Detail

Event Timeline

herhut created this revision.Jan 31 2020, 1:33 AM

Unit tests: pass. 62330 tests passed, 0 failed and 838 were skipped.

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

ftynse accepted this revision.Jan 31 2020, 5:32 AM
ftynse added inline comments.
mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
148

ValueRange operands

(side nit: we re-export ArrayRef in the mlir namespace so drop llvm:: for it)

mlir/test/Dialect/GPU/invalid.mlir
4

6 operands

This revision is now accepted and ready to land.Jan 31 2020, 5:32 AM
mehdi_amini accepted this revision.Jan 31 2020, 7:51 PM

Nice!

(Nit: typo in the description "reestrictions").

nit commit message "reestrictions"

nicolasvasilache accepted this revision.Feb 2 2020, 7:17 AM

very cool, thanks Stephan!

herhut updated this revision to Diff 241983.Feb 3 2020, 1:07 AM
herhut marked an inline comment as done.

Review comments.

This revision was automatically updated to reflect the committed changes.

Unit tests: pass. 62330 tests passed, 0 failed and 838 were skipped.

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

mlir/test/Conversion/LoopsToGPU/step_one.mlir