[llvm] [CGData] Global Merge Functions (PR #112671)

Mikael Holmén via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 00:59:31 PST 2024


mikaelholmen wrote:

Hi,

I've no idea if this is expected but I noticed that if I run
```opt -passes=global-merge-func gmf.ll -o /dev/null```
on gmf.ll being
```
@0 = global { { ptr, i32, i32 } } { { ptr, i32, i32 } { ptr null, i32 19, i32 5 } }
@1 = global { { ptr, i32, i32 } } { { ptr, i32, i32 } { ptr null, i32 22, i32 5 } }
```
it crashes like
```
opt: ../lib/Analysis/ModuleSummaryAnalysis.cpp:1072: ModuleSummaryIndex llvm::buildModuleSummaryIndex(const Module &, std::function<BlockFrequencyInfo *(const Function &)>, ProfileSummaryInfo *, std::function<const StackSafetyInfo *(const Function &)>): Assertion `GlobalList.second.SummaryList.size() == 1 && "Expected module's index to have one summary per GUID"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: build-all/bin/opt -passes=global-merge-func gmf.ll -o /dev/null
1.	Running pass "global-merge-func" on module "gmf.ll"
 #0 0x000055e51084dd78 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (build-all/bin/opt+0x4427d78)
 #1 0x000055e51084b83e llvm::sys::RunSignalHandlers() (build-all/bin/opt+0x442583e)
 #2 0x000055e51084e5ad SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f1cdb046cf0 __restore_rt (/lib64/libpthread.so.0+0x12cf0)
 #4 0x00007f1cd8bffacf raise (/lib64/libc.so.6+0x4eacf)
 #5 0x00007f1cd8bd2ea5 abort (/lib64/libc.so.6+0x21ea5)
 #6 0x00007f1cd8bd2d79 _nl_load_domain.cold.0 (/lib64/libc.so.6+0x21d79)
 #7 0x00007f1cd8bf8426 (/lib64/libc.so.6+0x47426)
 #8 0x000055e511442fe1 llvm::buildModuleSummaryIndex(llvm::Module const&, std::function<llvm::BlockFrequencyInfo* (llvm::Function const&)>, llvm::ProfileSummaryInfo*, std::function<llvm::StackSafetyInfo const* (llvm::Function const&)>) (build-all/bin/opt+0x501cfe1)
 #9 0x000055e511447e72 llvm::ModuleSummaryIndexAnalysis::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (build-all/bin/opt+0x5021e72)
#10 0x000055e5123dce42 llvm::detail::AnalysisPassModel<llvm::Module, llvm::ModuleSummaryIndexAnalysis, llvm::AnalysisManager<llvm::Module>::Invalidator>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) PassBuilder.cpp:0:0
#11 0x000055e510a5849a llvm::AnalysisManager<llvm::Module>::getResultImpl(llvm::AnalysisKey*, llvm::Module&) (build-all/bin/opt+0x463249a)
#12 0x000055e511b31fbf llvm::GlobalMergeFuncPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (build-all/bin/opt+0x570bfbf)
#13 0x000055e5123ef72d llvm::detail::PassModel<llvm::Module, llvm::GlobalMergeFuncPass, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) PassBuilder.cpp:0:0
#14 0x000055e510a55477 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (build-all/bin/opt+0x462f477)
#15 0x000055e511b9f6f3 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::ArrayRef<std::function<void (llvm::PassBuilder&)>>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool) (build-all/bin/opt+0x57796f3)
#16 0x000055e51081514b optMain (build-all/bin/opt+0x43ef14b)
#17 0x00007f1cd8bebd85 __libc_start_main (/lib64/libc.so.6+0x3ad85)
#18 0x000055e51080ef6e _start (build-all/bin/opt+0x43e8f6e)
Abort (core dumped)
```


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


More information about the llvm-commits mailing list