[ORC] Add partitioning support to CompileOnDemandLayer2.

CompileOnDemandLayer2 now supports user-supplied partition functions (the
original CompileOnDemandLayer already supported these).

Partition functions are called with the list of requested global values
(i.e. global values that currently have queries waiting on them) and have an
opportunity to select extra global values to materialize at the same time.

Also adds testing infrastructure for the new feature to lli.

llvm-svn: 343396
This commit is contained in:
Lang Hames
2018-09-29 23:49:57 +00:00
parent f18e8314d4
commit 1d65c306a2
9 changed files with 273 additions and 178 deletions
+2 -2
View File
@@ -29,11 +29,11 @@ ThreadSafeModule cloneToNewContext(ThreadSafeModule &TSM,
SmallVector<char, 1> ClonedModuleBuffer;
{
std::vector<GlobalValue *> ClonedDefsInSrc;
std::set<GlobalValue *> ClonedDefsInSrc;
ValueToValueMapTy VMap;
auto Tmp = CloneModule(*TSM.getModule(), VMap, [&](const GlobalValue *GV) {
if (ShouldCloneDef(*GV)) {
ClonedDefsInSrc.push_back(const_cast<GlobalValue *>(GV));
ClonedDefsInSrc.insert(const_cast<GlobalValue *>(GV));
return true;
}
return false;