This is an archive of the discontinued LLVM Phabricator instance.

[TableGen][DirectX] generate DXIL operation table with TableGen.
ClosedPublic

Authored by python3kgae on May 12 2022, 10:36 PM.

Details

Summary

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.

Diff Detail

Event Timeline

python3kgae created this revision.May 12 2022, 10:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2022, 10:36 PM
python3kgae requested review of this revision.May 12 2022, 10:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2022, 10:36 PM
python3kgae edited the summary of this revision. (Show Details)Jun 16 2022, 7:58 AM
python3kgae edited the summary of this revision. (Show Details)

Move EmitDXILOperationTable gen-dxil-operation

python3kgae retitled this revision from [TableGen][DirectX] Add tableGen backend to generate DXIL operation table. to [TableGen][DirectX] generate DXIL operation table with TableGen..Jun 16 2022, 9:28 AM
python3kgae edited the summary of this revision. (Show Details)
bogner accepted this revision.Jun 16 2022, 11:25 AM
bogner added a subscriber: bogner.
bogner added inline comments.
llvm/utils/TableGen/DXILEmitter.cpp
321

Should we assert that we found the opcode here?

This revision is now accepted and ready to land.Jun 16 2022, 11:25 AM

Add assert to make sure found the opcode.

This revision was landed with ongoing or failed builds.Jun 16 2022, 1:39 PM
This revision was automatically updated to reflect the committed changes.
hctim added a subscriber: hctim.Jun 16 2022, 2:09 PM

Hey, looks like this breaks with -Werror. Did a quick revert, PTAL and reland :).

https://lab.llvm.org/buildbot/#/builders/77/builds/18671

FAILED: utils/TableGen/CMakeFiles/llvm-tblgen.dir/DXILEmitter.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/utils/TableGen -I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/llvm/utils/TableGen -I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/include -I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/llvm/include -gmlt -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG  -fno-exceptions -fno-rtti -UNDEBUG -std=c++14 -MD -MT utils/TableGen/CMakeFiles/llvm-tblgen.dir/DXILEmitter.cpp.o -MF utils/TableGen/CMakeFiles/llvm-tblgen.dir/DXILEmitter.cpp.o.d -o utils/TableGen/CMakeFiles/llvm-tblgen.dir/DXILEmitter.cpp.o -c /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/llvm/utils/TableGen/DXILEmitter.cpp
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/llvm/utils/TableGen/DXILEmitter.cpp:279:13: error: unused variable 'PrevCategory' [-Werror,-Wunused-variable]
  StringRef PrevCategory = "";
            ^
1 error generated.
[828/4628] Building CXX object lib/MC/MCParser/CMakeFiles/LLVMMCParser.dir/AsmParser.cpp.o
llvm/utils/TableGen/DXILEmitter.cpp
279

Unused variable here, broke the sanitizer build bots that build with -Werror.

python3kgae reopened this revision.Jun 16 2022, 2:39 PM
python3kgae marked an inline comment as done.
python3kgae added inline comments.
llvm/utils/TableGen/DXILEmitter.cpp
279

Sorry to miss it.
Rebuilding to make sure no other warnings.

This revision is now accepted and ready to land.Jun 16 2022, 2:39 PM
python3kgae marked an inline comment as done.

Fix warning.

Update to make arc happy to land.

This revision was landed with ongoing or failed builds.Jun 16 2022, 11:26 PM
This revision was automatically updated to reflect the committed changes.