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 | ||
---|---|---|
78 | If this is deprecated, add a TODO on the plan on the path forward (e.g. remove when ....) | |
125 | typo: operation | |
140 | in *the* LLVM sense | |
167 | 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 | ||
---|---|---|
78 | 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 | ||
---|---|---|
719 | 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 ....)