[mlir] Avoid creating local OpBuilders in Standard-to-LLVM conversion
authorAlex Zinenko <zinenko@google.com>
Fri, 26 Jun 2020 12:47:38 +0000 (14:47 +0200)
committerAlex Zinenko <zinenko@google.com>
Fri, 26 Jun 2020 13:38:00 +0000 (15:38 +0200)
commit8304ab5799b4172462877ca7495115c659ec0be0
tree59a76ab21a876f9432d4c8579873f072269b9da7
parent6323065fd6026de926b15bb609f4601e366a300c
[mlir] Avoid creating local OpBuilders in Standard-to-LLVM conversion

Conversions of allocation-related operations in Standard-to-LLVM need
declarations of "malloc" and "free" (or equivalents). They use locally created
OpBuilders pointed at the module level to declare these functions if necessary.
This is poorly compatible with the pattern infrastructure that is unaware of
new operations being created. Update the insertion point of the main rewriter
instead.

Differential Revision: https://reviews.llvm.org/D82649
mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp