This is an archive of the discontinued LLVM Phabricator instance.

[mlir][spirv] Support sub-byte element vector extension/truncation
ClosedPublic

Authored by antiagainst on Aug 12 2023, 10:32 AM.

Details

Summary

This would mean allowing vector type conversion involving sub-byte
element types.

Diff Detail

Event Timeline

antiagainst created this revision.Aug 12 2023, 10:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2023, 10:32 AM
antiagainst requested review of this revision.Aug 12 2023, 10:32 AM
antiagainst retitled this revision from [mlir][spirv] Support sub-byte eleemnt vector extension/truncation to [mlir][spirv] Support sub-byte element vector extension/truncation.Aug 12 2023, 10:43 AM
kuhar added inline comments.Aug 12 2023, 12:37 PM
mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp
104–113

nit: consider replacing this with return llvm::is_contained({2, 3, 4, 8, 16}, type.getNumElements());

mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp
320–322

hasValidSize permits 8 and 16 elements, so I don't understand the debug message here

antiagainst marked 2 inline comments as done.

Address comments

kuhar accepted this revision.Aug 12 2023, 6:35 PM

LGTM

This revision is now accepted and ready to land.Aug 12 2023, 6:35 PM
This revision was landed with ongoing or failed builds.Aug 12 2023, 6:43 PM
This revision was automatically updated to reflect the committed changes.