[PATCH] D140627: [orc] Pass big JITTargetMachineBuilder parameters by reference to avoid unnecessary copies
Feng Zou via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 26 22:20:32 PST 2023
fzou1 added a comment.
In D140627#4075812 <https://reviews.llvm.org/D140627#4075812>, @lhames wrote:
> Hi @fzou1,
>
> JITTargetMachineBuilders are only moved around at startup at the moment, and they're only ~0.5kb. Have they been observed to have a performance impact? If so we should probably transfer them via `unique_ptr` to avoid the copies, but I'm not sure it's necessary yet.
Sorry. No performance impact observed. They're nice-to-have changes. If needed, I'll update the patch with `unique_ptr`.
================
Comment at: llvm/docs/tutorial/BuildingAJIT1.rst:195-197
+ auto EPC = SelfExecutorProcessControl::Create();
+ if (!EPC)
+ return EPC.takeError();
----------------
lhames wrote:
> The introduction of EPC here seems unrelated to the other changes?
Yes. But the example code is out of date and should be same as in KaleidoscopeJIT.h header file.
================
Comment at: llvm/docs/tutorial/BuildingAJIT2.rst:61
private:
- ExecutionSession ES;
- RTDyldObjectLinkingLayer ObjectLayer;
- IRCompileLayer CompileLayer;
- IRTransformLayer TransformLayer;
+ std::unique_ptr<ExecutionSession> ES;
----------------
lhames wrote:
> Is this change related to the rest of the patch?
Partly yes. This example code is out of date. I updated it together with the code of passing argument by reference.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140627/new/
https://reviews.llvm.org/D140627
More information about the llvm-commits
mailing list