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

S. Bharadwaj Yadavalli via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 16:52:11 PST 2024


================
@@ -81,18 +101,37 @@ void ComputedShaderFlags::print(raw_ostream &OS) const {
   OS << ";\n";
 }
 
+static bool compareShaderFlagsInfo(
+    const std::pair<const Function *, ComputedShaderFlags> FSM,
+    const Function *FindFunc) {
+  return (FSM.first < FindFunc);
+}
+
 /// Return the shader flags mask of the specified function Func.
 const ComputedShaderFlags &
 ModuleShaderFlags::getFunctionFlags(const Function *Func) const {
-  const auto Iter = llvm::lower_bound(
-      FunctionFlags, Func,
-      [](const std::pair<const Function *, ComputedShaderFlags> FSM,
-         const Function *FindFunc) { return (FSM.first < FindFunc); });
+  const std::pair<const Function *, ComputedShaderFlags> *Iter =
+      llvm::lower_bound(FunctionFlags, Func, compareShaderFlagsInfo);
----------------
bharadwajy wrote:

Changes made to use `DenseMap` instead of `Smallvector` as suggested.

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


More information about the llvm-commits mailing list