[mlir][llvm] Introduce a mapValue function in LLVMIR import (nfc).
authorTobias Gysi <tobias.gysi@nextsilicon.com>
Tue, 11 Oct 2022 12:58:32 +0000 (15:58 +0300)
committerTobias Gysi <tobias.gysi@nextsilicon.com>
Tue, 11 Oct 2022 13:22:13 +0000 (16:22 +0300)
commita2122a09cf66c29f82f911e35770786db09565a3
treed65218fdd642c7388754e02dd2f2eed5a61d2885
parenta93d03310e2c02fa5e24544df4706650f85788f7
[mlir][llvm] Introduce a mapValue function in LLVMIR import (nfc).

The revision adds a mapValue function to the Importer, which can be used
in the MLIR builders to provide controlled accesses to the result
mapping of the imported instructions. Additionally, the change allows us
to avoid accessing a private member variable of the Importer class,
which simplifies future refactorings that aim at factoring out a
conversion interface (similar to the MLIR to LLVM translation). The
revision also renames the variables used when emitting the MLIR builders
to prepare the generalization to non-intrinsic instructions. In
particular, it renames callInst to inst and it passes in the instruction
arguments using an llvmOperands array rather than accessing the call
arguments directly.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D135645
mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp