[all-commits] [llvm/llvm-project] 6a214e: [MemProf] Fix an assertion when writing distribute...
Teresa Johnson via All-commits
all-commits at lists.llvm.org
Tue Jan 14 13:46:57 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6a214ec1eeef6b404bf111edeca13c6e0d958103
https://github.com/llvm/llvm-project/commit/6a214ec1eeef6b404bf111edeca13c6e0d958103
Author: Teresa Johnson <tejohnson at google.com>
Date: 2025-01-14 (Tue, 14 Jan 2025)
Changed paths:
M llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
M llvm/test/ThinLTO/X86/memprof_direct_recursion.ll
Log Message:
-----------
[MemProf] Fix an assertion when writing distributed index for aliasee (#122946)
The ThinLTO index bitcode writer uses a helper forEachSummary to manage
preparation and writing of summaries needed for each distributed index
file. For alias summaries, it invokes the provided callback for the
aliasee as well, as we at least need to produce a value id for the
alias's summary. However, all summary generation for the aliasee itself
should be skipped on calls when IsAliasee is true. We invoke the
callback again if that value's summary is to be written as well.
We were asserting in debug mode when invoking collectMemProfCallStacks,
because a given stack id index was not in the StackIdIndicesToIndex
map. It was not added because the forEachSummary invocation that records
these ids in the map (invoked from the IndexBitcodeWriter constructor)
was correctly skipping this handling when invoked for aliasees. We need
the same guard in the invocation that calls collectMemProfCallStacks.
Note that this doesn't cause any real problems in a non-asserts build
as the missing map lookup will return the default 0 value from the map,
which isn't used since we don't actually write the corresponding
summary.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list