Page MenuHomePhabricator

[OpenCL] Add image type handling for builtin functions
Needs ReviewPublic

Authored by Pierre on Jun 18 2019, 2:47 AM.

Details

Summary

Image types were previously available, but not working. This patch
adds image handling for OpenCL builtin functions.
Image types must have an access specifier (read_only, etc) when used.

This depends on:
-First, splitting opencl-c.h file: https://reviews.llvm.org/D63256/new/
-Second, Adding generic types: https://reviews.llvm.org/D63434
-Third, Adding const, volatile and pointer types: https://reviews.llvm.org/D63442

Diff Detail

Event Timeline

Pierre created this revision.Jun 18 2019, 2:47 AM
Pierre updated this revision to Diff 205396.Jun 18 2019, 10:40 AM
Pierre added projects: Restricted Project, Restricted Project.

Add context lines

This patch adds handling for OpenCL builtin functions.

I think this is a copy-paste from other reviews. :)

clang/lib/Sema/OpenCLBuiltins.td
44

Btw _IsAbstract can be bit type?

136

Btw do we always need to set all the inherited fields in each subclass in the same way?

For example VecWidth should be set to 0 in image types?

clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
247

0:default -> 0:none

449

Can you explain this better please.

463

Also can you explain perhaps with an example what you are trying to emit...

Pierre updated this revision to Diff 207530.Jul 2 2019, 6:05 AM
Pierre marked 4 inline comments as done.
Pierre edited the summary of this revision. (Show Details)

Corrections.

clang/lib/Sema/OpenCLBuiltins.td
136

This was meant to take the values from _Ty when default values from the Type class could have been wrong.
This might not be necessary for every field of every subclass of the Type class, but this is safer.

For example VecWidth should be set to 0 in image types?

Indeed, the two incompatible fields that I see are the VecWidth of the ImageType class, and the AccessQualifier of the VectorType.

Pierre updated this revision to Diff 207806.Jul 3 2019, 8:40 AM

Rebase on previous patches.

Pierre updated this revision to Diff 208345.Jul 8 2019, 3:12 AM