This is an archive of the discontinued LLVM Phabricator instance.

OpenCL: Extend argument promotion rules to vector types
ClosedPublic

Authored by arsenm on Nov 28 2018, 1:25 PM.

Details

Reviewers
Anastasia
Summary

The spec is ambiguous on whether vector types are allowed to be
implicitly converted. The only legal context I think this can
be used for OpenCL is printf, where it seems necessary.

Diff Detail

Event Timeline

arsenm created this revision.Nov 28 2018, 1:25 PM

The spec is ambiguous on whether vector types are allowed to be
implicitly converted. The only legal context I think this can
be used for OpenCL is printf, where it seems necessary.

s6.2.1, seems to say "Implicit conversions between built-in vector data types are disallowed." though. But considering that we disallow functions without a prototype. It should be fine.

However, is there any way to construct a test for this? Could it be tested similarly to https://reviews.llvm.org/D55023?

arsenm updated this revision to Diff 175873.Nov 29 2018, 8:06 AM

Add codegen test

Anastasia accepted this revision.Nov 29 2018, 8:46 AM

LGTM! Apart from the test can be changed.

test/CodeGenOpenCL/printf.cl
2 ↗(On Diff #175873)

I would prefer to test this with spir target since it's not AMD specific. We can use pragma extension enable/disable. :)

This revision is now accepted and ready to land.Nov 29 2018, 8:46 AM
arsenm closed this revision.Dec 1 2018, 1:59 PM
arsenm marked an inline comment as done.

r348083