Page MenuHomePhabricator

[MLIR][SPIRV] Use getAsmResultName(...) hook for ConstantOp.
ClosedPublic

Authored by ergawy on May 26 2021, 3:51 AM.

Details

Summary

Implements better naming for results of spv.Constant ops by making it
inherit from OpAsmOpInterface and implementing the associated
getAsmResultName(...) hook.

Diff Detail

Event Timeline

ergawy created this revision.May 26 2021, 3:51 AM
ergawy requested review of this revision.May 26 2021, 3:51 AM
mehdi_amini added inline comments.May 26 2021, 9:16 AM
mlir/test/Dialect/SPIRV/IR/asm-op-interface.mlir
2

Please remove this option

2

This one as well, you're not using it.

2

What diagnostic are you checking here?

antiagainst requested changes to this revision.May 27 2021, 6:08 AM
antiagainst added inline comments.
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td
72

Nit: sort alphabetically?

mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
1682

Vector type in SPIR-V can only be 1-D. That should already be guaranteed by the verifier. So we can just get the first dim here.

mlir/test/Dialect/SPIRV/IR/asm-op-interface.mlir
10

Add a test for negative number?

This revision now requires changes to proceed.May 27 2021, 6:08 AM
ergawy updated this revision to Diff 348293.May 27 2021, 9:03 AM
ergawy marked 6 inline comments as done.

Handle review comments.

mlir/test/Dialect/SPIRV/IR/asm-op-interface.mlir
2

Sorry, all of them are copy paste errors.

This revision is now accepted and ready to land.May 27 2021, 11:21 AM