This is an archive of the discontinued LLVM Phabricator instance.

[DirectX backend] [NFC]Add DXILOpBuilder to generate DXIL operation
ClosedPublic

Authored by python3kgae on Jul 21 2022, 10:35 AM.

Details

Summary

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.

Diff Detail

Event Timeline

python3kgae created this revision.Jul 21 2022, 10:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2022, 10:35 AM
python3kgae requested review of this revision.Jul 21 2022, 10:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2022, 10:35 AM
bogner added inline comments.Jul 22 2022, 12:43 PM
llvm/lib/Target/DirectX/DXILOpBuilder.cpp
55

It's awkward to duplicate this enum and split the helpers relating to it between TableGen and Target. Are we likely to need to share more of this type of thing?

There is *some* precedent for sharing by moving some enums and such to Support (see include/llvm/Support/X86DisassemblerDecoderCommon.h), though that does seem like a bit of a hack

Add DXILOperationCommon.h to share ParameterKind.

python3kgae marked an inline comment as done.Jul 22 2022, 2:28 PM
bogner accepted this revision.Jul 25 2022, 2:34 PM

Add DXILOperationCommon.h to share ParameterKind.

I'd probably put parameterTypeNameToKind and getTypeFromParameterKind in DXILOperationCommon.h as well - it makes sense for them to be next to each other since they're symmetric. Otherwise LGTM

This revision is now accepted and ready to land.Jul 25 2022, 2:34 PM

Move parameterTypeNameToKind and getTypeFromParameterKind to DXILOperationCommon.h.

Move getTypeFromParameterKind back to avoid dependence.

Move getTypeFromParameterKind back to avoid dependence.

Makes sense to me

This revision was landed with ongoing or failed builds.Jul 25 2022, 9:50 PM
This revision was automatically updated to reflect the committed changes.