Page MenuHomePhabricator

OpenCL: Extend argument promotion rules to vector types
ClosedPublic

Authored by arsenm on Wed, Nov 28, 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.Wed, Nov 28, 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.Thu, Nov 29, 8:06 AM

Add codegen test

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

LGTM! Apart from the test can be changed.

test/CodeGenOpenCL/printf.cl
2

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.Thu, Nov 29, 8:46 AM
arsenm closed this revision.Sat, Dec 1, 1:59 PM
arsenm marked an inline comment as done.

r348083