Repository navigation
Landing support for the LLVM AOT backend on Windows - #3757
Conversation
3746dfc to
d63854a
Compare
|
|
SGTM - will try to rebase today |
ddee03b to
86aeba2
Compare
ScottTodd
left a comment
There was a problem hiding this comment.
Code LGTM, and mostly ready on the branch merging side of things. Let's figure out the failing tests though.
I have wsl2 working now so I can try building tensorflow and junk - really not pleased that's the only way to see the errors though :( |
Yeah, I asked on Discord if anyone could help decipher the errors but got no responses >_> I suspect that
will collectively help, since errors at this level should be caught by the |
This adds the WindowsLinkerTool that uses lld-link or link to generate the DLLs/PDBs. The existing behavior is modeled in UnixLinkerTool that is meant for use with ld/ld.lld. TODOs are in place for mac mach-o and wasm linking, and the UnixLinkerTool could use a lot of work (left for someone who knows more about ld).
* Fix handling when IREE_LLVMAOT_LINKER_PATH is not set. * Intentionally leak dylib libraries on exit when tracing.
86aeba2 to
e86fe35
Compare
The LLVM JIT driver is deprecated and going away. These tests should be using LLVM AOT instead (#2673), but this test infra is scary. Ideally, this infra would barely be doing any of this per-backend; there should be few - if any - things exclusively tested by this path that aren't also covered in core tests that don't build/run from python. Or at least, the infra should not be doing all of this via build files (bazel is not a configuration language). Unblocks #3757 and #3843.
e86fe35 to
4ca7353
Compare
The LLVM JIT driver is deprecated and going away. These tests should be using LLVM AOT instead (#2673), but this test infra is scary. Ideally, this infra would barely be doing any of this per-backend; there should be few - if any - things exclusively tested by this path that aren't also covered in core tests that don't build/run from python. Or at least, the infra should not be doing all of this via build files (bazel is not a configuration language). Unblocks #3757 and #3843.
4ca7353 to
4e47a49
Compare
The LLVM JIT driver is deprecated and going away. These tests should be using LLVM AOT instead (iree-org#2673), but this test infra is scary. Ideally, this infra would barely be doing any of this per-backend; there should be few - if any - things exclusively tested by this path that aren't also covered in core tests that don't build/run from python. Or at least, the infra should not be doing all of this via build files (bazel is not a configuration language). Unblocks iree-org#3757 and iree-org#3843.
| return mlir::emitRemark(targetOp.getLoc()) | ||
| << "Linker artifacts for " << targetOp.getName() << " preserved:\n" | ||
| << " " << linkArtifacts.libraryFile.path; | ||
| linkArtifacts.keepAllFiles(); |
There was a problem hiding this comment.
This will never be executed
LLVM AOT is now stable enough to run by default on all build/test configurations (mainly thanks to: #3757, #4034, #3928). We don't see a path to deployment on our primary platforms using LLVM JIT and the backend adds excess maintenance cost in the main repository (e.g. runtime code that depends on LLVM -> slow builds and can't build on Android), so this removes the `llvm-ir` compiler target and corresponding `llvm` HAL backend in favor of the `dylib-llvm-aot` compiler target and `dylib` HAL backend (we have many names for the same components :P).
LLVM AOT is now stable enough to run by default on all build/test configurations (mainly thanks to: #3757, #4034, #3928). We don't see a path to deployment on our primary platforms using LLVM JIT and the backend adds excess maintenance cost in the main repository (e.g. runtime code that depends on LLVM -> slow builds and can't build on Android), so this removes the `llvm-ir` compiler target and corresponding `llvm` HAL backend in favor of the `dylib-llvm-aot` compiler target and `dylib` HAL backend (we have many names for the same components :P).
The primary change here is around how linkers are defined in the compiler and how we use them. There is now a LinkerTool type that allows for target-specific manipulation of the module prior to codegen required for making valid Windows DLLs and can be useful for things like wasm where we may need to expose additional control symbols.
The existing linking behavior is moved into UnixLinkerTool (using ld/ld.lld) while the new Windows support is in (creatively) WindowsLinkerTool. TODOs are in place for mac mach-o and wasm linking, and the UnixLinkerTool could use a lot of work (left for someone who knows more about ld).
I included instructions for the Windows builds and tried to make it as default as possible ("vcvarsall to setup your env then build with the right triple"). Still likely some tuning that could be done to reduce configuration issues but I feel like the UnixLinkerTool needs much more love first :)
Fixes #2645 by providing defaults and useful error messages when not set right.