The revision uses tablegen generated builders to convert the most common
LLVM IR instructions to MLIR LLVM dialect operations. All instructions
with special handlers, except for alloca and fence, still use manual
handlers. The revision also introduces an additional "instructions.ll"
test file to test the import of instructions that have tablegen builders
(except for the resume instruction whose test remains untouched). A part
of the test cases are new, for example the integer instruction test,
while others are migrated from the "basic.ll" test file.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td | ||
---|---|---|
1786–1800 | I'd prefer to minimize the amount of C++ embedded into Tablegen. A couple of lines is okay, especially if they use substitution. A dozen -- less so. It becomes difficult to navigate and update over time, and doesn't benefit from any code tooling. One possibility is to factor out the C++ code that doesn't need $-substitutions into a function and just call it here. | |
mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp | ||
188–195 | If the function is not stored anywhere, prefer function_ref to avoid dynamic allocations. |
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td | ||
---|---|---|
1786–1800 | Makes sense. I factored out a method and also added an llvm_unreachable to fail if the sync scope id is invalid. |
I'd prefer to minimize the amount of C++ embedded into Tablegen. A couple of lines is okay, especially if they use substitution. A dozen -- less so. It becomes difficult to navigate and update over time, and doesn't benefit from any code tooling. One possibility is to factor out the C++ code that doesn't need $-substitutions into a function and just call it here.