[llvm] [DirectX] Infrastructure to collect shader flags for each function (PR #112967)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 17:18:27 PDT 2024


================
@@ -60,21 +61,35 @@ struct ComputedShaderFlags {
     return FeatureFlags;
   }
 
-  static ComputedShaderFlags computeFlags(Module &M);
   void print(raw_ostream &OS = dbgs()) const;
   LLVM_DUMP_METHOD void dump() const { print(); }
 };
 
+using FuncShaderFlagsMask = std::pair<Function const *, ComputedShaderFlags>;
+using FunctionShaderFlagsVec = SmallVector<FuncShaderFlagsMask>;
+struct DXILModuleShaderFlagsInfo {
+  // Shader Flag mask representing module-level properties
+  ComputedShaderFlags ModuleFlags;
+  // Vector of Function-Shader Flag mask pairs representing properties of each
+  // of the functions in the module
+  FunctionShaderFlagsVec FuncShaderFlagsVec;
----------------
bogner wrote:

Why not call this simply "FunctionFlags"? Encoding the type into the variable name is bad practice.

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


More information about the llvm-commits mailing list