[mlir][llvm] Call the instruction builders from a static method (NFC).
authorTobias Gysi <tobias.gysi@nextsilicon.com>
Tue, 10 Jan 2023 13:16:38 +0000 (14:16 +0100)
committerTobias Gysi <tobias.gysi@nextsilicon.com>
Tue, 10 Jan 2023 13:17:56 +0000 (14:17 +0100)
commit6e39520630e2fdaf21e2f1a0af826d0dac7a248b
tree8afa1e0f727795005a59a6c15f7338779ac41dfa
parent2bac59bab41fc8f4950b5cb630781cfa5d3a71b8
[mlir][llvm] Call the instruction builders from a static method (NFC).

Extract a static method to call the MLIR builders that translate LLVM IR
instructions to MLIR LLVM dialect operations. This change ensures the
MLIR builders have to use the moduleImport argument rather than calling
the import methods directly. As a result, both the intrinsic and the
instruction MLIR builders have to use a moduleImport argument and none
of them has direct access to private moduleImport methods. The revision
thus enforces consistent MLIR builder implementations for instructions
and intrinsics.

The revision also moves parseDataLayoutAlignment closer to its use.

Reviewed By: Dinistro

Differential Revision: https://reviews.llvm.org/D141265
mlir/include/mlir/Target/LLVMIR/ModuleImport.h
mlir/lib/Target/LLVMIR/ModuleImport.cpp