This is an archive of the discontinued LLVM Phabricator instance.

[mlir][spirv] Create a pass for testing SCFToSPIRV patterns
ClosedPublic

Authored by antiagainst on Dec 17 2020, 12:59 PM.

Details

Summary

Previously all SCF to SPIR-V conversion patterns were tested as
the -convert-gpu-to-spirv pass. That obscured the structure we
want. This commit fixed it.

Depends On D93468

Diff Detail

Event Timeline

antiagainst created this revision.Dec 17 2020, 12:59 PM
antiagainst requested review of this revision.Dec 17 2020, 12:59 PM

Fix CMake dependency

hanchung accepted this revision.Dec 21 2020, 6:46 AM
hanchung added inline comments.
mlir/test/Conversion/SCFToSPIRV/for.mlir
45–46

remove one blank line

This revision is now accepted and ready to land.Dec 21 2020, 6:46 AM
ThomasRaoux accepted this revision.Dec 21 2020, 9:09 AM
ThomasRaoux added inline comments.
mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRVPass.cpp
2–52

Looks like we already follow this convention but if this kind of pass is only for testing I wonder if it should belong to mlir/test/lib/? I'm not saying it has to be changed in this review though.

antiagainst marked an inline comment as done.Dec 23 2020, 11:17 AM
antiagainst added inline comments.
mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRVPass.cpp
2–52

There isn't a strict rule/convention w.r.t. the placement of passes. I typically place passes only meant for testing under test/lib. For passes likely useful outside of tests, placing under lib/conversion seems good to me. Converting to SPIR-V is a bit special here given the closed type system it mandates a one-step conversion. But I'd like to make it a multiple step procedure later by implementing the materializing source/dest conversion hooks on the type converter. So then this pass will be useful as one step in the procedure.

mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRVPass.cpp