This is an archive of the discontinued LLVM Phabricator instance.

[mlir][spirv] Define spv.IsNan/spv.IsInf and add lowerings
ClosedPublic

Authored by antiagainst on Jan 22 2021, 7:18 AM.

Details

Summary

spv.Ordered/spv.Unordered are meant for OpenCL Kernel capability.
For Vulkan Shader capability, we should use spv.IsNan to check
whether a number is NaN.

Add a new pattern for converting std.cmpf ord|uno to spv.IsNan
and bumped the pattern converting to spv.Ordered/spv.Unordered
to a higher benefit. The SPIR-V target environment will properly
select between these two patterns.

Depends On D95236

Diff Detail

Event Timeline

antiagainst created this revision.Jan 22 2021, 7:18 AM
antiagainst requested review of this revision.Jan 22 2021, 7:18 AM
mravishankar accepted this revision.Jan 22 2021, 9:10 AM

Oh thanks for fixing this. I did see the Kernel capability requirement. Got confused about it not being valid for Shader

This revision is now accepted and ready to land.Jan 22 2021, 9:10 AM

Oh thanks for fixing this. I did see the Kernel capability requirement. Got confused about it not being valid for Shader

Yeah. I taught the script too much smart. It should really be more explicit. ;-)