diff options
| author | Lang Hames <lhames@gmail.com> | 2015-05-04 22:03:10 +0000 |
|---|---|---|
| committer | Lang Hames <lhames@gmail.com> | 2015-05-04 22:03:10 +0000 |
| commit | a68970dfd58dab5443707efc13ed682d6fbd076c (patch) | |
| tree | 4a664eb98590f969cb1c9c0acfea1a8f6451ebd9 /llvm/tools | |
| parent | 19ffc26c5e375ae6682a3877a959d195dbcf7524 (diff) | |
| download | bcm5719-llvm-a68970dfd58dab5443707efc13ed682d6fbd076c.tar.gz bcm5719-llvm-a68970dfd58dab5443707efc13ed682d6fbd076c.zip | |
[Orc] Refactor the compile-on-demand layer to make module partitioning lazy,
and avoid cloning unused decls into every partition.
Module partitioning showed up as a source of significant overhead when I
profiled some trivial test cases. Avoiding the overhead of partitionging
for uncalled functions helps to mitigate this.
This change also means that it is no longer necessary to have a
LazyEmittingLayer underneath the CompileOnDemand layer, since the
CompileOnDemandLayer will not extract or emit function bodies until they are
called.
llvm-svn: 236465
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/lli/OrcLazyJIT.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/llvm/tools/lli/OrcLazyJIT.h b/llvm/tools/lli/OrcLazyJIT.h index 2b2db6e668c..bff2eca26a5 100644 --- a/llvm/tools/lli/OrcLazyJIT.h +++ b/llvm/tools/lli/OrcLazyJIT.h @@ -21,7 +21,6 @@ #include "llvm/ExecutionEngine/Orc/ExecutionUtils.h" #include "llvm/ExecutionEngine/Orc/IRCompileLayer.h" #include "llvm/ExecutionEngine/Orc/IRTransformLayer.h" -#include "llvm/ExecutionEngine/Orc/LazyEmittingLayer.h" #include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h" #include "llvm/ExecutionEngine/RTDyldMemoryManager.h" #include "llvm/IR/LLVMContext.h" @@ -37,9 +36,7 @@ public: typedef std::function<std::unique_ptr<Module>(std::unique_ptr<Module>)> TransformFtor; typedef orc::IRTransformLayer<CompileLayerT, TransformFtor> IRDumpLayerT; - typedef orc::LazyEmittingLayer<IRDumpLayerT> LazyEmitLayerT; - typedef orc::CompileOnDemandLayer<LazyEmitLayerT, - CompileCallbackMgr> CODLayerT; + typedef orc::CompileOnDemandLayer<IRDumpLayerT, CompileCallbackMgr> CODLayerT; typedef CODLayerT::ModuleSetHandleT ModuleHandleT; typedef std::function< @@ -57,9 +54,8 @@ public: ObjectLayer(), CompileLayer(ObjectLayer, orc::SimpleCompiler(*this->TM)), IRDumpLayer(CompileLayer, createDebugDumper()), - LazyEmitLayer(IRDumpLayer), CCMgr(BuildCallbackMgr(IRDumpLayer, CCMgrMemMgr, Context)), - CODLayer(LazyEmitLayer, *CCMgr), + CODLayer(IRDumpLayer, *CCMgr), CXXRuntimeOverrides([this](const std::string &S) { return mangle(S); }) {} ~OrcLazyJIT() { @@ -154,7 +150,6 @@ private: ObjLayerT ObjectLayer; CompileLayerT CompileLayer; IRDumpLayerT IRDumpLayer; - LazyEmitLayerT LazyEmitLayer; std::unique_ptr<CompileCallbackMgr> CCMgr; CODLayerT CODLayer; |

