This is an archive of the discontinued LLVM Phabricator instance.

[mlir][spirv] Add control for non-32-bit scalar type emulation
ClosedPublic

Authored by antiagainst on Apr 7 2021, 11:41 AM.

Details

Summary

Non-32-bit scalar types require special hardware support that may not
exist on all GPUs. This is reflected in SPIR-V as that non-32-bit scalar
types require special capabilities or extensions.

Previously when there is a non-32-bit type and no native support, we
unconditionally emulate it with 32-bit ones. This isn't good given that
it can have implications over ABI and data layout consistency.

This commit introduces an option to control whether to use 32-bit
types to emulate.

Depends On D100058

Diff Detail

Event Timeline

antiagainst created this revision.Apr 7 2021, 11:41 AM
antiagainst requested review of this revision.Apr 7 2021, 11:41 AM

Add missing &

hanchung accepted this revision.Apr 7 2021, 11:24 PM

Haven't prototyped based on the patch, but overall it looks good to me.

mlir/include/mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h
52

s/becuase/because

This revision is now accepted and ready to land.Apr 7 2021, 11:24 PM