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

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 18 11:49:58 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:

Is it correct to say that this preserves all? I'm not sure if any analyses cache information about function attributes, so maybe it's okay there, but we do modify the IR so I doubt it's safe to really say we preserve all analyses...

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


More information about the llvm-commits mailing list