Open llvmbot opened 5 years ago
This might be the problem:
llvm-as, via llvm::parseAssemblyWithIndex, builds a ModuleSummaryIndex with HaveGVs always set to true.
The input .ll file I was trying to run 'llvm-as -d' on, has no IR. GlobalValueSummaryInfo.U.GV seem to be set only when GVs in the IR are parsed.
In the absence of IR, and having HaveGVs always set to true, we end up in a situation where a null GlobalValueSummaryInfo.U.GV gets dereferenced.
For this test case, HaveGVs should have been false.
Should there be a way for llvm-as to be able to construct a ModuleSummaryIndex where HaveGVs is set conditionally via an option?
Extended Description
Repro:
Run llvm-as -d on /llvm/test/Assembler/thinlto-summary.ll
Reproduced on master at commit ee6700f69766b57849f483f471387229e495e311
kmanivannan@kmanivannan-mbp:~/local/llvm-project-master/build$ bin/llvm-as -d ../llvm/test/Assembler/thinlto-summary.ll
Here's the assembly: ; ModuleID = '../llvm/test/Assembler/thinlto-summary.ll' source_filename = "../llvm/test/Assembler/thinlto-summary.ll"
^0 = module: (path: "thinlto-summary1.o", hash: (1369602428, 2747878711, 259090915, 2507395659, 1141468049)) ^1 = module: (path: "thinlto-summary2.o", hash: (2998369023, 4283347029, 1195487472, 2757298015, 1852134156)) ^2 = gv: (Stack dump: