[llvm] [DirectX] Propagate shader flags mask of callees to callers (PR #118306)

Chris B via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 08:49:01 PST 2024


================
@@ -47,10 +48,14 @@ static void updateFunctionFlags(ComputedShaderFlags &CSF,
 }
 
 void ModuleShaderFlags::initialize(const Module &M) {
+  SmallVector<const Function *> WorkList;
   // Collect shader flags for each of the functions
   for (const auto &F : M.getFunctionList()) {
     if (F.isDeclaration())
       continue;
+    if (!F.user_empty()) {
+      WorkList.push_back(&F);
+    }
----------------
llvm-beanz wrote:

nit:
```suggestion
    if (!F.user_empty())
      WorkList.push_back(&F);
```
see: https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements

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


More information about the llvm-commits mailing list