Commit Graph

8 Commits

Author SHA1 Message Date
Simon Pilgrim da2ed951ec Fix MSVC "not all control paths return a value" warning. NFC 2022-07-26 10:44:00 +01:00
Xiang Li 57006b14fa [DirectX backend] [NFC]Add DXILOpBuilder to generate DXIL operation
A new helper class DXILOpBuilder is added to create DXIL op function calls.

TableGen backend for DXILOperation will create table for DXIL op function parameter types.
When create DXIL op function, these parameter types will used to create the function type.

Reviewed By: bogner

Differential Revision: https://reviews.llvm.org/D130291
2022-07-25 21:49:59 -07:00
Dmitri Gribenko aba43035bd Use llvm::sort instead of std::sort where possible
llvm::sort is beneficial even when we use the iterator-based overload,
since it can optionally shuffle the elements (to detect
non-determinism). However llvm::sort is not usable everywhere, for
example, in compiler-rt.

Reviewed By: nhaehnle

Differential Revision: https://reviews.llvm.org/D130406
2022-07-23 15:19:05 +02:00
Xiang Li 0d2dde20be [TableGen][DirectX] generate DXIL operation table with TableGen.
Add more feature to tableGen backend gen-dxil-operation.

It will generate getOpCodeProperty, getOpCodeClassName and getOpCodeName when build DirectX target.
Each of these functions has a table which generate based on DXIL operations.

These generated functions will replace the manually written functions which used for query DXIL operation information.

Reviewed By: bogner

Differential Revision: https://reviews.llvm.org/D125520
2022-06-16 23:25:57 -07:00
Mitch Phillips 911841f717 Revert "[TableGen][DirectX] generate DXIL operation table with TableGen."
This reverts commit 46fcdf2364.

Reason: Broke the buildbots:
https://lab.llvm.org/buildbot/#/builders/77/builds/18671
2022-06-16 14:07:54 -07:00
Xiang Li 46fcdf2364 [TableGen][DirectX] generate DXIL operation table with TableGen.
Add more feature to tableGen backend gen-dxil-operation.

It will generate getOpCodeProperty, getOpCodeClassName and getOpCodeName when build DirectX target.
Each of these functions has a table which generate based on DXIL operations.

These generated functions will replace the manually written functions which used for query DXIL operation information.

Reviewed By: bogner

Differential Revision: https://reviews.llvm.org/D125520
2022-06-16 13:39:10 -07:00
Xiang Li 264c09b732 [TableGen][DirectX] Add tableGen backend to generate map from llvm intrinsic to DXIL operation.
A new tableGen backend gen-dxil-intrinsic-map is added to generate map from llvm intrinsic to DXIL operation.

A new file "DXILIntrinsicMap.inc" will be generated when build DirectX target which include the map.

The generated map will replace the manually created map when find DXIL operation from llvm intrinsic.

Reviewed By: bogner

Differential Revision: https://reviews.llvm.org/D125519
2022-06-15 19:41:09 -07:00
python3kgae 435897b41d [TableGen][DirectX] Add tableGen backend to generate DXIL operation for DirectX backend.
A new tableGen backend gen-dxil-enum is added to generate enum for DXIL operation and operation class.

A new file "DXILConstants.inc" will be generated when build DirectX target which include the enums.

More tableGen backends will be added to replace manually written table in DirectX backend.
The unused fields in dxil_inst will be used in future PR.

Reviewed By: bogner

Differential Revision: https://reviews.llvm.org/D125435
2022-06-14 17:31:58 -07:00