Page MenuHomePhabricator

Pierre (Pierre GONDOIS)
User

Projects

User does not belong to any projects.

User Details

User Since
Apr 15 2019, 3:20 AM (26 w, 3 d)

Recent Activity

Aug 8 2019

Pierre added a comment to D65456: [OpenCL] Add generic type handling for builtin functions.

Just one comment,
Thank you again for making everything clearer :)

Aug 8 2019, 3:20 AM · Restricted Project, Restricted Project

Jul 12 2019

Pierre added a comment to D64608: [OpenCL] Make TableGen'd builtin tables and helper functions static.

Hello Tom,
Thank you for adding me, the changes seem correct to me.
There is a new version of the tablegen builtin functions that makes these tables static/const. It still needs some work, so I thing it's relevant to make this change in the meantime :
https://reviews.llvm.org/D63434

Jul 12 2019, 1:19 AM · Restricted Project, Restricted Project

Jul 8 2019

Pierre created D64321: [OpenCL] Change diagnostic for function declaration.
Jul 8 2019, 3:51 AM · Restricted Project, Restricted Project
Pierre created D64320: [OpenCL] Print builtin function prototypes if ambiguous.
Jul 8 2019, 3:44 AM · Restricted Project, Restricted Project
Pierre created D64319: [OpenCL] Add function attributes handling for builtin functions.
Jul 8 2019, 3:37 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63557: [OpenCL] Group builtin functions by prototype.
Jul 8 2019, 3:14 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63555: [OpenCL] Add extension handling for builtin functions.
Jul 8 2019, 3:14 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63504: [OpenCL] Add version handling and add vector ld/st builtins.
Jul 8 2019, 3:14 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63480: [OpenCL] Add image type handling for builtin functions.
Jul 8 2019, 3:12 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63442: [OpenCL] Add const, volatile and pointer handling for builtin functions.
Jul 8 2019, 3:11 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63434: [OpenCL] Add generic type handling for builtin functions.
Jul 8 2019, 3:10 AM · Restricted Project, Restricted Project

Jul 3 2019

Pierre updated the diff for D63555: [OpenCL] Add extension handling for builtin functions.

Rebase on previous versions.

Jul 3 2019, 9:39 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63504: [OpenCL] Add version handling and add vector ld/st builtins.

Rebase on previous patches.

Jul 3 2019, 9:03 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63480: [OpenCL] Add image type handling for builtin functions.

Rebase on previous patches.

Jul 3 2019, 8:41 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63442: [OpenCL] Add const, volatile and pointer handling for builtin functions.

Reorder fields in the Type structure in the .td file

Jul 3 2019, 8:37 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63442: [OpenCL] Add const, volatile and pointer handling for builtin functions.

Rebase from the patch adding GenTypes.

Jul 3 2019, 8:10 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63434: [OpenCL] Add generic type handling for builtin functions.

Forgot one change.

Jul 3 2019, 8:05 AM · Restricted Project, Restricted Project
Pierre added inline comments to D63434: [OpenCL] Add generic type handling for builtin functions.
Jul 3 2019, 7:33 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63434: [OpenCL] Add generic type handling for builtin functions.

Corrections.

Jul 3 2019, 7:33 AM · Restricted Project, Restricted Project

Jul 2 2019

Pierre updated the diff for D63434: [OpenCL] Add generic type handling for builtin functions.

Add examples of generated code.

Jul 2 2019, 6:25 AM · Restricted Project, Restricted Project
Pierre added inline comments to D63480: [OpenCL] Add image type handling for builtin functions.
Jul 2 2019, 6:06 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63480: [OpenCL] Add image type handling for builtin functions.

Corrections.

Jul 2 2019, 6:05 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63555: [OpenCL] Add extension handling for builtin functions.

Rebase from previous patches.

Jul 2 2019, 3:45 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63555: [OpenCL] Add extension handling for builtin functions.

Update the commit message to specify which extensions are added, and add tests for the half and double type extensions

Jul 2 2019, 3:33 AM · Restricted Project, Restricted Project
Pierre added inline comments to D63555: [OpenCL] Add extension handling for builtin functions.
Jul 2 2019, 3:33 AM · Restricted Project, Restricted Project
Pierre added inline comments to D63442: [OpenCL] Add const, volatile and pointer handling for builtin functions.
Jul 2 2019, 2:59 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63442: [OpenCL] Add const, volatile and pointer handling for builtin functions.

Typo and correct the order of fields in the Type class (.td file)

Jul 2 2019, 2:59 AM · Restricted Project, Restricted Project

Jul 1 2019

Pierre added inline comments to D63504: [OpenCL] Add version handling and add vector ld/st builtins.
Jul 1 2019, 9:21 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63504: [OpenCL] Add version handling and add vector ld/st builtins.

Corrections on names, wrong OpenCL versions in comment, missing comma ...

Jul 1 2019, 9:21 AM · Restricted Project, Restricted Project

Jun 27 2019

Pierre added inline comments to D63434: [OpenCL] Add generic type handling for builtin functions.
Jun 27 2019, 1:46 AM · Restricted Project, Restricted Project

Jun 26 2019

Pierre updated the diff for D63442: [OpenCL] Add const, volatile and pointer handling for builtin functions.

Add ConstType and VolatileType in a comment

Jun 26 2019, 9:46 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63442: [OpenCL] Add const, volatile and pointer handling for builtin functions.
Jun 26 2019, 9:36 AM · Restricted Project, Restricted Project
Pierre added inline comments to D63434: [OpenCL] Add generic type handling for builtin functions.
Jun 26 2019, 8:39 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63434: [OpenCL] Add generic type handling for builtin functions.
Jun 26 2019, 8:38 AM · Restricted Project, Restricted Project

Jun 19 2019

Pierre created D63557: [OpenCL] Group builtin functions by prototype.
Jun 19 2019, 8:05 AM · Restricted Project, Restricted Project
Pierre created D63555: [OpenCL] Add extension handling for builtin functions.
Jun 19 2019, 8:02 AM · Restricted Project, Restricted Project

Jun 18 2019

Pierre updated the diff for D63434: [OpenCL] Add generic type handling for builtin functions.

Add context lines.

Jun 18 2019, 10:43 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63442: [OpenCL] Add const, volatile and pointer handling for builtin functions.

Add context lines.

Jun 18 2019, 10:43 AM · Restricted Project, Restricted Project
Pierre added projects to D63442: [OpenCL] Add const, volatile and pointer handling for builtin functions: Restricted Project, Restricted Project.
Jun 18 2019, 10:42 AM · Restricted Project, Restricted Project
Pierre updated the diff for D63480: [OpenCL] Add image type handling for builtin functions.

Add context lines

Jun 18 2019, 10:41 AM · Restricted Project, Restricted Project
Pierre added projects to D63480: [OpenCL] Add image type handling for builtin functions: Restricted Project, Restricted Project.
Jun 18 2019, 10:41 AM · Restricted Project, Restricted Project
Pierre created D63504: [OpenCL] Add version handling and add vector ld/st builtins.
Jun 18 2019, 10:38 AM · Restricted Project, Restricted Project
Pierre closed D60764: Add clang cc1 option to generate OpenCL builtin functions.

The changes are part of https://reviews.llvm.org/D60763 which was merged.

Jun 18 2019, 9:34 AM · Restricted Project
Pierre created D63480: [OpenCL] Add image type handling for builtin functions.
Jun 18 2019, 2:47 AM · Restricted Project, Restricted Project

Jun 17 2019

Pierre created D63442: [OpenCL] Add const, volatile and pointer handling for builtin functions.
Jun 17 2019, 9:56 AM · Restricted Project, Restricted Project
Pierre created D63434: [OpenCL] Add generic type handling for builtin functions.
Jun 17 2019, 8:35 AM · Restricted Project, Restricted Project

Jun 11 2019

Pierre updated the diff for D62849: Moving OpenCLBuiltins.td and remove unused include.

Dependencies were not satisfied with the last version:
clangSema was built after ClangOpenCLBuiltinsImpl,
but it didn't imply that OpenCLBuiltins.inc had to be built before SemaLookup.cpp

Jun 11 2019, 7:19 AM · Restricted Project

Jun 10 2019

Pierre updated the diff for D62849: Moving OpenCLBuiltins.td and remove unused include.

It was not necessary to add the .inc file in the add_clang_library

Jun 10 2019, 3:58 AM · Restricted Project

Jun 5 2019

Pierre added a comment to D60763: Prototype OpenCL BIFs using Tablegen.

A bit late to the review, but I've noticed a couple of issues with some of the implemented builtins:

  • The fmin/fmax builtins are defined twice for scalar types, does this create problems in overload resolution when using them?
  • The convert_ builtins don't have support for half types (which is present in the opencl-c.h header. Is that intended?
Jun 5 2019, 2:59 AM · Restricted Project, Restricted Project
Pierre updated the diff for D62849: Moving OpenCLBuiltins.td and remove unused include.

At the right location this time

Jun 5 2019, 1:29 AM · Restricted Project

Jun 4 2019

Pierre added a reviewer for D62849: Moving OpenCLBuiltins.td and remove unused include: thakis.
Jun 4 2019, 3:42 AM · Restricted Project
Pierre created D62849: Moving OpenCLBuiltins.td and remove unused include.
Jun 4 2019, 3:35 AM · Restricted Project
Pierre added a comment to D60763: Prototype OpenCL BIFs using Tablegen.

From what I can tell, the only client of OpenCLBuiltins.td is currently lib/Sema. Do you expect that to change? If not, does it make more sense to move the .td file to there?

Do you expect OpenCLBuiltins.td to include other files in the future? At the moment, the -I ${CMAKE_CURRENT_SOURCE_DIR}/../../ bit in the cmake file isn't needed for anything.

Jun 4 2019, 2:23 AM · Restricted Project, Restricted Project

May 23 2019

Pierre updated the diff for D60763: Prototype OpenCL BIFs using Tablegen.
May 23 2019, 6:47 AM · Restricted Project, Restricted Project

May 21 2019

Pierre updated the diff for D60763: Prototype OpenCL BIFs using Tablegen.
May 21 2019, 7:01 AM · Restricted Project, Restricted Project
Pierre added a comment to D60763: Prototype OpenCL BIFs using Tablegen.

The wrong patch was uploaded. Sorry for this.

May 21 2019, 7:01 AM · Restricted Project, Restricted Project
Pierre added inline comments to D60763: Prototype OpenCL BIFs using Tablegen.
May 21 2019, 3:34 AM · Restricted Project, Restricted Project

May 17 2019

Pierre added inline comments to D60763: Prototype OpenCL BIFs using Tablegen.
May 17 2019, 2:19 AM · Restricted Project, Restricted Project
Pierre updated the diff for D60763: Prototype OpenCL BIFs using Tablegen.

Corrections from the comments on the previous version.

May 17 2019, 2:18 AM · Restricted Project, Restricted Project

May 3 2019

Pierre updated the diff for D60763: Prototype OpenCL BIFs using Tablegen.

Requested changes have been made in this diff. Some comments/ TODO have not been done yet. They will be done in a next patch. This first patch is meant to start introducing the feature in Clang.
This patch integrates the new command line option introduced in https://reviews.llvm.org/D60764

May 3 2019, 2:31 AM · Restricted Project, Restricted Project
Pierre added inline comments to D60763: Prototype OpenCL BIFs using Tablegen.
May 3 2019, 2:31 AM · Restricted Project, Restricted Project

Apr 25 2019

Pierre added a comment to D60763: Prototype OpenCL BIFs using Tablegen.

I also think we could reduce the size of the tables.
To sum up how this is working right now:

  1. The isOpenCLBuiltin(char* functionName) funcion is called to determine if a function is part of OpenCL builtin functions. If so, it returns its associated pair (index, number of signatures) in the OpenCLBuiltinDecl, otherwise it returns 0.
  2. The OpenCLBuiltinDecl table is storing, for each OpenCL builtin function, the list of the possible signature associated for this function (e.g. cos can be "float cos(float)", "double cos(double)", ...). The available signatures are stored in the OpenCLSignature table. In the OpenCLBuiltinDecl are stored the indexes corresponding to the possible signature for each function.
  3. The OpenCLSignature is storing the possible signatures.
Apr 25 2019, 7:52 AM · Restricted Project, Restricted Project
Pierre added a comment to D60763: Prototype OpenCL BIFs using Tablegen.

Other comments:
1-
When a header file is included, its function declarations are decorated with the "nounwind" attribute, meaning that the function is not supposed to throw an exception. This decorator is currently not added with the new mechanism.
The "readnone" decorator is also present for these builtin functions and added somewhere y clang, but not added with the new mechanism.
This can be tested with the following command line, on an .cl file containing a function calling a builtin function (e.g.: acos):

clang -cc1 -cl-std=CL2.0 -emit-llvm -O0 -I<path_to>/llvm-project/clang/lib/Headers <your_file.cl>  [-fadd-opencl-builtins|-finclude-default-header]

2-
When the function definition is inserted, it seems to be actually just resolving the identifier for the current lookup. Calling the same builtin function multiple times currently result in multiple lookup. Maybe there is a way to add the function declaration for the scope/file, so the lookup is only performed one time for each function. This part is done around the code taken from Sema::LazilyCreateBuiltin function, and I will spend more time on it.
3-
I haven't looked at the test file yet.
4-
If you have any suggestion/comment, feel free to share.

Apr 25 2019, 2:52 AM · Restricted Project, Restricted Project
Pierre updated the diff for D60763: Prototype OpenCL BIFs using Tablegen.

In this new patch:

  • Documentation has been added
  • The multiclasses in OpenCLBuiltins.td filehave been slighly changed to have a more generic way to generate function prototypes
  • In ClangOpenCLBuiltinEmitter.cpp, the code of the Emit() function has been shifted to functions
  • In SemaLookUp.cpp, the OCL2Qual function, used to retrieve the QualType instance of a type, is now generated by Tablegen backend
Apr 25 2019, 2:52 AM · Restricted Project, Restricted Project
Pierre updated the diff for D60764: Add clang cc1 option to generate OpenCL builtin functions.

Forgot to update one argument

Apr 25 2019, 2:39 AM · Restricted Project

Apr 24 2019

Pierre updated the diff for D60764: Add clang cc1 option to generate OpenCL builtin functions.

The name of the command line option has been updated.

Apr 24 2019, 9:54 AM · Restricted Project

Apr 16 2019

Pierre created D60764: Add clang cc1 option to generate OpenCL builtin functions.
Apr 16 2019, 1:52 AM · Restricted Project
Pierre updated the diff for D60763: Prototype OpenCL BIFs using Tablegen.

Deleted blank line

Apr 16 2019, 1:47 AM · Restricted Project, Restricted Project
Pierre created D60763: Prototype OpenCL BIFs using Tablegen.
Apr 16 2019, 1:45 AM · Restricted Project, Restricted Project