[PATCH] D140949: [MemProf] Context disambiguation cloning pass [patch 2/3]
Teresa Johnson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 21 15:44:40 PDT 2023
tejohnson added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp:1998
+ std::stable_sort(Node->CallerEdges.begin(), Node->CallerEdges.end(),
+ [&](const std::shared_ptr<ContextEdge> &A,
+ const std::shared_ptr<ContextEdge> &B) {
----------------
snehasish wrote:
> tejohnson wrote:
> > snehasish wrote:
> > > We only need to capture AllocTypeCloningPriority here. Do you know if a more permissive capture has any overhead?
> > I don't believe it adds overhead, just expresses intent to the frontend. In any case, turns out constexpr don't need to be captured, so I could remove the "&" completely.
> TIL that constexpr doesn't need to be captured, makes sense in retrospect.
Well...it turns out it is not so simple. I got bot failures with other compilers that gave errors like:
'AllocTypeCloningPriority' cannot be implicitly captured because no default capture mode has been specified
I was able to reproduce an error building with gcc. Unfortunately, clang complains if I try to explicitly capture this constexpr variable. Therefore I am back to the earlier version that just had a default "&" capture.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140949/new/
https://reviews.llvm.org/D140949
More information about the llvm-commits
mailing list