--
You received this message because you are subscribed to the Google Groups "MLIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mlir+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/mlir/CAG_ZRKxMxSQbXJ-3jQR2eNAK8UwZkHGSP7N_rDqhR%2BgWFUh5rg%40mail.gmail.com.
Hi Mehdi/Alex:You mentioned below 'We have an LLVM Dialect, but it is incomplete'.I did a scan of mlir/Dialect/LLVMIR/LLVMOps.td against LLVM operations (https://llvm.org/docs/LangRef.html)but found that they already exist. Maybe i missed somethings, or did you mean underlying support is missing in some of them.
On Tue, Oct 29, 2019 at 7:56 AM Javed Absar <javed...@gmail.com> wrote:Hi Mehdi/Alex:You mentioned below 'We have an LLVM Dialect, but it is incomplete'.I did a scan of mlir/Dialect/LLVMIR/LLVMOps.td against LLVM operations (https://llvm.org/docs/LangRef.html)but found that they already exist. Maybe i missed somethings, or did you mean underlying support is missing in some of them.Actually we indeed got support for more than I expected. I sampled quickly and still found a few missing, like "switch", "fence", "addrspacecast".
Even when we have all the instructions, there are other things to do, for instance all the linkage on the globals. And a big piece which is the ability to import an LLVM module into MLIR.Finally, revisiting the types to make them first class in MLIR is another thing that we could consider: at the moment we just wrap the LLVM ones and the dialect owns a LLVMContext, which has some annoying side-effects (like breaking the natural parallelism in MLIR for instance).
--MehdiThanks a lotJavedOn Fri, 25 Oct 2019 at 10:00, Mehdi AMINI <joke...@gmail.com> wrote:Hi Javed,On Thu, Oct 24, 2019 at 2:38 PM Javed Absar <javed...@gmail.com> wrote:Hi Mehdi:We spoke at the LLVM dev conference and you mentioned its best to ask again on this thread in case others are interested as well.You mentioned areas for potential contribution in llvm<->mlir conversion. Could you please elaborate a bit more and point me in the right direction?There are multiple areas for contributing to the LLVM integration that can be suitable for a "starter project":- We have an LLVM Dialect, but it is incomplete. We should add all the LLVM operations/types (named struct will be a bit tricky, but I discussed a few ideas with River about this).- mlir-translate has the ability to export an LLVM module from the MLIR LLVM dialect (examples), this is likely not perfectly robust and should be completed/improved.- mlir-translate does not have the ability to import an LLVM module into MLIR LLVM dialect. This is something that can be helpful for some areas / experiments at least.- Other more uncertain points:- we're wrapping LLVM types into MLIR types, this allowed us to just reuse the LLVM parser as-is, however this is also not nice for other reasons, like the need to keep around an LLVMContext. I'd be interested to see how much effort it'd be to just redefine the LLVM types natively in MLIR.- because the LLVMContext is owned by the LLVM dialect (IIRC), we have some issues when creating an LLVM module (there is a TODO in the code here)- Alex floated the possibility to write a machine-readable definition of LLVM IR and generate the actual LLVM C++ verifier (and possibly classes) from it, so that we could also generate the dialect (this is likely a lot of effort to just study the feasibility).--Mehdi
--
You received this message because you are subscribed to the Google Groups "MLIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mlir+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/mlir/CANF-O%3DZZ%3D6ebW1aFLa_1wSPWn6VKcVmZQGx7mgPCdr%3DSMUFCVg%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mlir+unsubscribe@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/mlir/CANF-O%3DZZ%3D6ebW1aFLa_1wSPWn6VKcVmZQGx7mgPCdr%3DSMUFCVg%40mail.gmail.com.
---- Alex
James
To unsubscribe from this group and stop receiving emails from it, send an email to mlir+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/mlir/CANF-O%3DZZ%3D6ebW1aFLa_1wSPWn6VKcVmZQGx7mgPCdr%3DSMUFCVg%40mail.gmail.com.
---- Alex
James
To unsubscribe from this group and stop receiving emails from it, send an email to mlir+unsubscribe@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/mlir/CANF-O%3DZZ%3D6ebW1aFLa_1wSPWn6VKcVmZQGx7mgPCdr%3DSMUFCVg%40mail.gmail.com.
---- Alex
Hi Javed,
I've just pushed:https://github.com/tensorflow/mlir/commit/b645d87729295ad7e8141dd1bdf718bc3e00c4c6 - [llvm] Add initial import of LLVM modules to mlir-translateand https://github.com/tensorflow/mlir/commit/d4ad7350c83225a492748fef7a8cf5d0abebede1 - [llvm] Allow GlobalOp to take a region for complex initializersIn terms of improvements needed for full fidelity, here is a non-exhaustive list:* The ability to represent recursive / identified types. I am working on this actively and hope to get a patch out soon.
James
To unsubscribe from this group and stop receiving emails from it, send an email to mlir+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/mlir/CANF-O%3DZZ%3D6ebW1aFLa_1wSPWn6VKcVmZQGx7mgPCdr%3DSMUFCVg%40mail.gmail.com.
---- Alex
James
To unsubscribe from this group and stop receiving emails from it, send an email to mlir+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/mlir/CANF-O%3DZZ%3D6ebW1aFLa_1wSPWn6VKcVmZQGx7mgPCdr%3DSMUFCVg%40mail.gmail.com.
---- Alex
James
To unsubscribe from this group and stop receiving emails from it, send an email to ml...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/mlir/CANF-O%3DZZ%3D6ebW1aFLa_1wSPWn6VKcVmZQGx7mgPCdr%3DSMUFCVg%40mail.gmail.com.
---- Alex