[llvm] [DXIL] Consume Metadata Analysis information in passes (PR #108034)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 20 11:25:22 PDT 2024


================
@@ -247,9 +247,10 @@ class DXILPrepareModule : public ModulePass {
 
   DXILPrepareModule() : ModulePass(ID) {}
   void getAnalysisUsage(AnalysisUsage &AU) const override {
+    AU.setPreservesAll();
     AU.addPreserved<ShaderFlagsAnalysisWrapper>();
     AU.addPreserved<DXILResourceMDWrapper>();
-    AU.addPreserved<DXILMetadataAnalysisWrapperPass>();
+    AU.addRequired<DXILMetadataAnalysisWrapperPass>();
----------------
bogner wrote:

I still don't understand why we would change this to `setPreservesAll`. If you just need to preserve `DXILMetadataAnalysis` then the existing `AU.addPreserved<DXILMetadataAnalysisWrapperPass>()` call should do that, no?

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


More information about the llvm-commits mailing list