Repository navigation
Generate and use the iree_hal_executable_library_t metadata. - #5195
Conversation
The flatbuffers are still present (and we may always need some kind of descriptor to help the runtime load) but all reflection is now performed through the interface.
4a7e799 to
106c3de
Compare
asaadaldien
left a comment
There was a problem hiding this comment.
LGTM! The LLVMIR dialect might be limiting but do you think we {can/need} to move it to LLVMIR after linking instead of modifying the llvm module ?
|
I think it's fine touching the IR as it's much easier to do the Since the IR we are inserting is just static structures there's no real optimization opportunities we miss like this (there's nothing but some constexpr folding that's likely to happen, and would happen anyway if we produced MLIR and translated that to LLVM IR). |
Yeah building mlir structs can be a pain! I was suggesting mainly so we can lit-test and validate things which we can do if we optionally embedded the textual LLVM module in the executable right before linking |
|
ah yeah - we could have (and may even still have) a flag for serializing as textual LLVM IR - that'd be nice! |
* da64c93 Integrate MLIR-EmitC at iml130/mlir-emitc@dde739f (#5228) * a8d6c2a Fix doc publication by escaping our IR snippets in markdown. (#5227) * bd5e535 Introduce RVV VLS code-gen (#5199) * d496bc9 Avoid allocating temporary buffer for tensors derived from read-only tensors (.. * 1a93557 Tidying up a few pages of documentation. (#5225) * 46e8331 Add a dedicated iree_c_module CMake module (#5214) * 603b208 Merge google -> main (#5219) * c9f3742 Add support for control flow lowering in the VM to emitc target (#5208) * c8a7b2f Sort descriptors as expected by the native module (#5207) * 47183fb Revise compiler tracing to enable statistics aggregation. (#5218) * 500ec7b Set author to match committer for llvm submodule update action. (#5217) * 881de81 Generate and use the iree_hal_executable_library_t metadata. (#5195) * cf8180e Increase K tile size for small matrices. (#5213) * f5804ec Fix problem bug in MobileBert with vectorization enable. (#5211) COPYBARA_INTEGRATE_REVIEW=#5229 from ScottTodd:main-to-google da64c93 PiperOrigin-RevId: 365076337
* da64c93 Integrate MLIR-EmitC at iml130/mlir-emitc@dde739f (#5228) * a8d6c2a Fix doc publication by escaping our IR snippets in markdown. (#5227) * bd5e535 Introduce RVV VLS code-gen (#5199) * d496bc9 Avoid allocating temporary buffer for tensors derived from read-only tensors (.. * 1a93557 Tidying up a few pages of documentation. (#5225) * 46e8331 Add a dedicated iree_c_module CMake module (#5214) * 603b208 Merge google -> main (#5219) * c9f3742 Add support for control flow lowering in the VM to emitc target (#5208) * c8a7b2f Sort descriptors as expected by the native module (#5207) * 47183fb Revise compiler tracing to enable statistics aggregation. (#5218) * 500ec7b Set author to match committer for llvm submodule update action. (#5217) * 881de81 Generate and use the iree_hal_executable_library_t metadata. (#5195) * cf8180e Increase K tile size for small matrices. (#5213) * f5804ec Fix problem bug in MobileBert with vectorization enable. (#5211) PiperOrigin-RevId: 365076337
| // https://lld.llvm.org/WebAssembly.html#exports | ||
| for (auto entryPointName : entryPointNames) { | ||
| auto *entryPointFn = llvmModule->getFunction(entryPointName); | ||
| entryPointFn->addFnAttr("wasm-export-name", entryPointName); | ||
| } |
There was a problem hiding this comment.
These wasm-export-name attributes were load bearing for the entry points to be accessible through the generated wasm modules. The other mechanisms at the link I included here should also work, but may need different plumbing.
After this change (I suspect - haven't bisected), I get empty .wat files:
(module
(table $T0 1 1 funcref)
(memory $memory 2)
(global $g0 (mut i32) (i32.const 66560))
(export "memory" (memory 0)))
The flatbuffers are still present (and we may always need some kind of
descriptor to help the runtime load) but all reflection is now performed
through the interface.
Fixes #3580.