3 ms·
I don't know why but for some reason everyone loves to shout "NIH" complaints on HN. I don't believe in the success of MLIR but there is no reason to not attemp
by imtringued 7y ago
I don't know why but for some reason everyone loves to shout "NIH" complaints on HN. I don't believe in the success of MLIR but there is no reason to not attempt a fresh start. LLVM is a gigantic project that would have to be significantly rewritten to make MLIR possible. Your development team would need a lot of LLVM expertise even though it doesn't care about LLVM. The end result would be something completely different from LLVM so what benefit is there to base it on LLVM? It's not like the rust compiler will automatically update to MLIR just because MLIR is a descendant of LLVM IR.
LLVM IR is also clearly not suitable for anything other than LLVM. It failed in the browser (Webassembly won), it failed for GPUs (SPIR-V is its own thing) and now it might fail again when it is replaced by MLIR. There is clearly demand for something that is better than LLVM IR.
- enos_feedler 7y agoLLVM IR wasn't competing with WebAssembly. WebAssembly is designed as an abstract machine _target_ instruction set whereas LLVM IR is an abstract _internal_ intermediate instruction set for compiler passes. I think they fit nice together but don't have deep expertise in either of these IRs, just general compilers.
- atq2119 7y agoA similar argument applies to SPIR-V. While I believe Apple are still trying to use LLVM bitcode for some purposes, the reality is that for a spec like Vulkan, you really want a shader program representation that is properly designed with a view to compatibility and independent extensibility (in the sense of hardware or platform vendor extensions), which LLVM IR isn't, pretty much on purpose.
- enos_feedler 7y agoIt makes sense to me that SPIR-V be a complete instruction set for an abstract GPU shader core. You can then have a GPU compiler translate to raw shader instructions. Much like a WASM compiler can translate from wasm to raw CPU instructions. I think an important design consideration in either case is "no surprises" meaning the translation should be fairly tight and predictable and serve just to smooth out some small surface area differences. If they do any funky magic/startling behavior the combined stack will start to exhibit weird performance properties