[llvm] [DXIL] Model DXIL Class specification of DXIL Ops in DXIL.td (PR #87803)
Justin Bogner via llvm-commits
llvm-commits at lists.llvm.org
Fri May 31 13:09:00 PDT 2024
================
@@ -13,334 +13,167 @@
include "llvm/IR/Intrinsics.td"
-class DXILOpClass;
+// Abstraction of DXIL Operation class.
+// It encapsulates an associated function signature viz.,
+// returnTy(param1Ty, param2Ty, ...) represented as a list of LLVMTypes.
+// DXIL Ops that belong to a DXILOpClass record the signature of that
+// DXILOpClass
-// Following is a set of DXIL Operation classes whose names appear to be
-// arbitrary, yet need to be a substring of the function name used during
-// lowering to DXIL Operation calls. These class name strings are specified
-// as the third argument of add_dixil_op in utils/hct/hctdb.py and case converted
-// in utils/hct/hctdb_instrhelp.py of DirectXShaderCompiler repo. The function
-// name has the format "dx.op.<class-name>.<return-type>".
+class DXILOpClass<list<LLVMType> OpSig> {
+ list<LLVMType> OpSignature = OpSig;
+}
+
+// Concrete definitions of DXIL Op Classes
+// Refer to the design document
+// (https://github.com/llvm/llvm-project/blob/main/llvm/docs/DirectX/DXILOpTableGenDesign.rst)
+// for details about the use of DXIL Op Class name.
----------------
bogner wrote:
This comment isn't very helpful, as it just points at a whole design document without any real information about what you would want to read in it. If I search for "DXIL Op Class name" in that document I find nothing, and from a brief perusal of the doc the only thing I can find that sounds like details about the use of the name is this sentence:
> This string is an integral part of the DXIL Op function name and is constructed in the format `dx.op.<class-name>.<overload-type>`
If that's all we want to say maybe it's better to repeat it here? Otherwise, if there's something more complicated going on that needs more in depth explanation than is reasonable in a comment, then pointing to a more specific part of the document would be more appropriate.
https://github.com/llvm/llvm-project/pull/87803
More information about the llvm-commits
mailing list