[llvm] [DXIL] Define and generate `DXILAttribute` and `DXILProperty` (PR #117072)

Greg Roth via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 26 12:15:22 PST 2024


================
@@ -266,18 +266,30 @@ def miss : DXILShaderStage;
 def all_stages : DXILShaderStage;
 // Denote support for DXIL Op to have been removed
 def removed : DXILShaderStage;
+
 // DXIL Op attributes
 
+// A function attribute denotes that there is a corresponding LLVM function
+// attribute that will be set when building the DXIL op. The mapping for
+// non-trivial cases is defined by setDXILAttribute in DXILOpBuilder.cpp
 class DXILAttribute;
 
-def ReadOnly : DXILAttribute;
 def ReadNone : DXILAttribute;
-def IsDerivative : DXILAttribute;
-def IsGradient : DXILAttribute;
-def IsFeedback : DXILAttribute;
-def IsWave : DXILAttribute;
-def NeedsUniformInputs : DXILAttribute;
-def IsBarrier : DXILAttribute;
+def ReadOnly : DXILAttribute;
+def NoDuplicate : DXILAttribute;
+def NoReturn : DXILAttribute;
+
+// A property is simply used to mark a DXIL op belongs to a sub-group of
+// DXIL ops, and it is used to query if a particular holds this property.
+// This is used for static analysis of DXIL ops.
+class DXILProperty;
+
+def IsBarrier : DXILProperty;
+def IsDerivative : DXILProperty;
----------------
pow2clk wrote:

This was set, but never actually used in hctdb.py. What was actually used is the is_gradient value. This change demonstrates it can be removed from DXC with no consequences: https://github.com/microsoft/DirectXShaderCompiler/pull/7023

As such, I think we should remove this property

https://github.com/llvm/llvm-project/pull/117072


More information about the llvm-commits mailing list