Mingming Liu 7d371725cd
[NFCI][BitcodeReader]Read real GUID from VI as opposed to storing it in map (#107735)
Currently, `ValueIdToValueInfoMap` [1] stores `std::tuple<ValueInfo,
GlobalValue::GUID /* original GUID */, GlobalValue::GUID /* real GUID*/
>`. This change updates the stored value type to `std::pair<ValueInfo,
GlobalValue::GUID /* original GUID */>`, and reads real GUID from
ValueInfo.

When an entry is inserted into `ValueIdToValueInfoMap`, ValueInfo is
created or inserted using real GUID [2]. ValueInfo keeps a pointer to
GlobalValueMap [3], using either `GUID` or `{GUID, Name}` [4] when
reading per-module summaries to create a combined summary.

[1] owned by per module-summary bitcode reader
caebb4562c/llvm/lib/Bitcode/Reader/BitcodeReader.cpp (L947-L950)
[2]
[first](caebb4562c/llvm/lib/Bitcode/Reader/BitcodeReader.cpp (L7130-L7133)),
[second](caebb4562c/llvm/lib/Bitcode/Reader/BitcodeReader.cpp (L7221-L7222)),
[third](caebb4562c/llvm/lib/Bitcode/Reader/BitcodeReader.cpp (L7622-L7623))
[3]
caebb4562c/llvm/include/llvm/IR/ModuleSummaryIndex.h (L1427-L1431)
[4]
caebb4562c/llvm/include/llvm/IR/ModuleSummaryIndex.h (L1631)
and
caebb4562c/llvm/include/llvm/IR/ModuleSummaryIndex.h (L1621)

---------

Co-authored-by: Kazu Hirata <kazu@google.com>
2024-09-09 09:43:47 -07:00
..