[llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

Damyan Pepper via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 11 13:05:26 PST 2025


================
@@ -154,18 +154,14 @@ void DXContainerGlobals::addRootSignature(Module &M,
                                           SmallVector<GlobalValue *> &Globals) {
 
   auto &RSA = getAnalysis<RootSignatureAnalysisWrapper>();
-  std::optional<ModuleRootSignature> MaybeRootSignature = RSA.getResult();
-
-  if (!MaybeRootSignature.has_value())
+  if (!RSA.getResult())
     return;
 
-  ModuleRootSignature MRS = MaybeRootSignature.value();
-
   SmallString<256> Data;
   raw_svector_ostream OS(Data);
 
   RootSignatureHeader RSH;
-  RSH.Flags = MRS.Flags;
+  RSH.Flags = RSA.getResult()->Flags;
----------------
damyanp wrote:

See my feedback - `getResult()` returns a `const&` and we should avoid making an unnecessary copy of it.

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


More information about the llvm-commits mailing list