[llvm] [AMDGPU] Always Inline preserved analyses (PR #91198)

via llvm-commits llvm-commits at lists.llvm.org
Thu May 9 03:13:49 PDT 2024


================
@@ -166,6 +168,6 @@ ModulePass *llvm::createAMDGPUAlwaysInlinePass(bool GlobalOpt) {
 
 PreservedAnalyses AMDGPUAlwaysInlinePass::run(Module &M,
                                               ModuleAnalysisManager &AM) {
-  alwaysInlineImpl(M, GlobalOpt);
-  return PreservedAnalyses::all();
+  const bool Changed = alwaysInlineImpl(M, GlobalOpt);
+  return Changed ? PreservedAnalyses::none() : PreservedAnalyses::all();
----------------
jofrn wrote:

Good to note this. We can be conservative for now even though I think this may preserve all or most analyses. Perhaps to define a `most` set would be helpful.

Always Inline pass only replaces aliases with functions, and then adds attributes to the function, so the pass could use that set if it stays around. Regardless, there are other passes that could benefit from it as well.

Will submit as it is now. Thank you.

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


More information about the llvm-commits mailing list