[PATCH] D51497: [WIP][ORC][ThinLTO] Early ThinLTO-JIT prototype and basic tests for next-gen ORC APIs

Stefan Gränitz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 30 11:10:15 PDT 2018


sgraenitz added a comment.

Not sure what's the best way to get rid of the binary object files. IIUC the ThinLTO tests are lit-based, so they build their summary-enhanced objects with clang and test via llvm-lto2 tool. Maybe I can turn all the unit tests into lit-test and add a hook to llvm-lto2? Don't know if there is a way to emit object files with summaries using yaml2obj or so? Any ideas?



================
Comment at: lib/ExecutionEngine/Orc/LLThinLTOJIT.cpp:154
+    if (AddedModule && RelatedModuleInfo.Dylib != DefiningModuleInfo.Dylib) {
+      DefiningModuleInfo.Dylib->addToSearchOrder(*RelatedModuleInfo.Dylib);
+    }
----------------
It's not currently possible to obtain the SearchOrder to check for existing entries. That's on purpose?


================
Comment at: unittests/ExecutionEngine/Orc/LLThinLTOJITTest.cpp:230
+  EXPECT_FALSE(FooSym);
+  logAllUnhandledErrors(FooSym.takeError(), dbgs(), "Failed again: ");
+}
----------------
I think I could do much better here with an actual layer. It currently dumps:
```
[ RUN      ] LLThinLTOJITTest.Incomplete
JIT session error: Symbols not found: { "_bar" }
Failed as expected: Failed to materialize symbols: { "_foo" }
Failed again: Symbols not found: { "_foo" }
[       OK ] LLThinLTOJITTest.Incomplete (11 ms)
```

With control over the MaterializationUnit, I could invoke the code I currently call `prepare` for not-yet-discovered callees internally and successfully materialize already with the first `lookup("foo")` above.


Repository:
  rL LLVM

https://reviews.llvm.org/D51497





More information about the llvm-commits mailing list