[mlir][llvm] Ordered traversal in LLVM IR import.
authorTobias Gysi <tobias.gysi@nextsilicon.com>
Wed, 19 Oct 2022 09:48:45 +0000 (12:48 +0300)
committerTobias Gysi <tobias.gysi@nextsilicon.com>
Wed, 19 Oct 2022 09:57:09 +0000 (12:57 +0300)
commit3883615906771480cc47e724bb5908287ab74736
tree808caeaa872bcf3c19093a1474d64c964febcb81
parent579ca5e7e106291d193a840195cda725cbf63aae
[mlir][llvm] Ordered traversal in LLVM IR import.

The revision performs a topological sort of the blocks to
ensure the operations are processed in dominance order.
After the change, we do not need to introduce dummy
instructions if an operand has not yet been processed.
Additionally, the revision also moves and simplifies the
control-flow related tests to a separate test file.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D136230
mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
mlir/test/Target/LLVMIR/Import/basic.ll
mlir/test/Target/LLVMIR/Import/control-flow.ll [new file with mode: 0644]