Page MenuHomePhabricator

[OpenCL] Group builtin functions by prototype
Needs ReviewPublic

Authored by Pierre on Jun 19 2019, 8:03 AM.

Details

Reviewers
svenvh
Anastasia
Summary

The file generated from the tablegen file, and containing the
function definitions can be re-organised to save some memory.
Functions having the same prototypes will point to a common
list of prototypes.
Functions having only one prototype will point to a prototype
definition of another function.

This depends on:
-1, splitting opencl-c.h file: https://reviews.llvm.org/D63256/new/
-2, Adding generic types: https://reviews.llvm.org/D63434
-3, Adding const, volatile and pointer types: https://reviews.llvm.org/D63442
-4, Adding image types: https://reviews.llvm.org/D63480
-5, Adding version handling: https://reviews.llvm.org/D63504
-6, Adding extension handling: https://reviews.llvm.org/D63555

Diff Detail

Event Timeline

Pierre created this revision.Jun 19 2019, 8:03 AM

Functions having only one prototype will point to a prototype
definition of another function.

Do you mean functions having only one prototype will point to a prototype
definition of another function with the same prototype?

clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
94

This optimization generally seems reasobale. Do you have any idea how it affects the build time to generate the Tablegen file and how much space do we actually save?

202

It is not clear whether signatures for functions that don't share the prototype with any others should still be in this table?

222

This data stricture is really difficult to understand, do you think you could split it into multiple type aliases?

521

I think you need to either simplify or document what (SignatureListMap.find(Candidate)->second.first)[Index].first expression returns.

545

where is this being deallocated?

558

same problem as before... expression is too complex!

567

The same here... where do we release the memory?

Pierre updated this revision to Diff 208349.Jul 8 2019, 3:14 AM