[llvm] Fix crash from [CGData] Global Merge Functions (#112671) (PR #116241)

Vincent Lee via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 15 02:40:17 PST 2024


================
@@ -666,7 +666,6 @@ bool GlobalMergeFuncPassWrapper::runOnModule(Module &M) {
 
 PreservedAnalyses GlobalMergeFuncPass::run(Module &M,
                                            AnalysisManager<Module> &AM) {
-  ModuleSummaryIndex *Index = &(AM.getResult<ModuleSummaryIndexAnalysis>(M));
-  bool Changed = GlobalMergeFunc(Index).run(M);
+  bool Changed = GlobalMergeFunc(ImportSummary).run(M);
----------------
thevinster wrote:

If GlobalMergeFunc doesn't need ModuleSummaryIndex, why not just initialize without the parameter? Is there some weird side effect from some other thing that requires passing it in even though it's not used? 

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


More information about the llvm-commits mailing list