[PATCH] D120753: [FuncSpec][NFC] Refactor internal structures.
Sjoerd Meijer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 2 07:26:34 PST 2022
SjoerdMeijer added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/FunctionSpecialization.cpp:465
}
- return Worklist;
+ return WorkList;
}
----------------
labrinea wrote:
> SjoerdMeijer wrote:
> > Was wondering if we could change `SpecializationList` to:
> >
> > SmallVector<std::unique_ptr<SpecializationInfo>>;
> >
> > so that we move and transfer ownership instead of copying things here.
> Good remark, but will there really be a copy? I thought that the Return Value Optimization (copy elision) prevents that. Alternatively I could make the function void and pass the SpecializationList by reference on the argument list.
My understanding is that this is an optimisation that may or may not be implemented. Looks like to be specified for c++17 though, but since we are using C++14 being explicit might be better.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120753/new/
https://reviews.llvm.org/D120753
More information about the llvm-commits
mailing list