From f4303855c49d14e17c84110e73d2106a7bbc9d41 Mon Sep 17 00:00:00 2001 From: Alexander Belyaev Date: Wed, 8 Jul 2020 17:42:56 +0000 Subject: [PATCH] Add mlir_cpu_runner tests infra for CHLO->LHLO->LLVM lowering. PiperOrigin-RevId: 320218897 --- lib/Dialect/mhlo/transforms/lhlo_legalize_to_llvm_pass.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Dialect/mhlo/transforms/lhlo_legalize_to_llvm_pass.cc b/lib/Dialect/mhlo/transforms/lhlo_legalize_to_llvm_pass.cc index 5313658..99f8391 100644 --- a/lib/Dialect/mhlo/transforms/lhlo_legalize_to_llvm_pass.cc +++ b/lib/Dialect/mhlo/transforms/lhlo_legalize_to_llvm_pass.cc @@ -13,6 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ +#include "third_party/llvm/llvm-project/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h" +#include "third_party/llvm/llvm-project/mlir/include/mlir/Conversion/SCFToStandard/SCFToStandard.h" #include "third_party/llvm/llvm-project/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h" #include "third_party/llvm/llvm-project/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h" #include "third_party/llvm/llvm-project/mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h" @@ -38,6 +40,9 @@ class TestLhloToLLVMPass populateStdToLLVMConversionPatterns(converter, patterns); PopulateLhloToLLVMConversionPatterns( LowerToLLVMOptions::getDefaultOptions(), &converter, &patterns); + mlir::populateLoopToStdConversionPatterns(patterns, &getContext()); + + mlir::populateAffineToStdConversionPatterns(patterns, m.getContext()); ConversionTarget target(getContext()); target.addLegalDialect();