All LLVM IR intrinsics are constructed in a similar way. The ODS definition of
the LLVM dialect in MLIR also lists multiple intrinsics, many of which
reproduce the same (or similar enough) code stanza to translate the MLIR
operation into the LLVM IR intrinsic. Provide a single base class containing
parameterizable code to build LLVM IR intrinsics given their name and the lists
of overloadable operands and results. Use this class to remove (almost)
duplicate translations for intrinsics defined in LLVMOps.td.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I like where this is going a lot. Some suggestions on the doc though
mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td | ||
---|---|---|
59 | If this is deprecated, add a TODO on the plan on the path forward (e.g. remove when ....) | |
106 | typo: operation | |
121 | in *the* LLVM sense | |
148 | since this (and L157) is the class doc most people will read (and not the doc of the implementation oriented base class), some more doc on sample use would be useful. E.g. LLVM_OneResultIntrOp<"name", [0], [1], []>, Arguments<(ins LLVM_Type, LLVM_Type)>; means |
Address review
mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td | ||
---|---|---|
59 | After all, I'll update this and all users in the next commit. |
Hi, I was trying to implement some llvm intrinsics and wanted to understand the purpose of overloaded operands. The LLVM reference manual does not say that prefetch is overloaded.
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td | ||
---|---|---|
728 | Can you please clarify why [0] is added to prefetch? |
If this is deprecated, add a TODO on the plan on the path forward (e.g. remove when ....)