aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2025-01-02 12:11:59 -0800
committerGitHub <noreply@github.com>2025-01-02 12:11:59 -0800
commit3a423a10ff83684332195b5191b16f12c81985ba (patch)
treed9c3f0de0ac9c6c12193d815b14a70da23b11f2b /clang/lib/Frontend/CompilerInvocation.cpp
parent5f5792aedb1f8088836ccd1c0a924c5e0bbf35db (diff)
downloadllvm-3a423a10ff83684332195b5191b16f12c81985ba.zip
llvm-3a423a10ff83684332195b5191b16f12c81985ba.tar.gz
llvm-3a423a10ff83684332195b5191b16f12c81985ba.tar.bz2
[MemProf][PGO] Prevent dropping of profile metadata during optimization (#121359)
This patch fixes a couple of places where memprof-related metadata (!memprof and !callsite) were being dropped, and one place where PGO metadata (!prof) was being dropped. All were due to instances of combineMetadata() being invoked. That function drops all metadata not in the list provided by the client, and also drops any not in its switch statement. Memprof metadata needed a case in the combineMetadata switch statement. For now we simply keep the metadata of the instruction being kept, which doesn't retain all the profile information when two calls with memprof metadata are being combined, but at least retains some. For the memprof metadata being dropped during call CSE, add memprof and callsite metadata to the list of known ids in combineMetadataForCSE. Neither memprof nor regular prof metadata were in the list of known ids for the callsite in MemCpyOptimizer, which was added to combine AA metadata after optimization of byval arguments fed by memcpy instructions, and similar types of optimizations of memcpy uses. There is one other callsite of combineMetadata, but it is only invoked on load instructions, which do not carry these types of metadata.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions