Add mlir_cpu_runner tests infra for CHLO->LHLO->LLVM lowering.

PiperOrigin-RevId: 320218897
This commit is contained in:
Alexander Belyaev 2020-07-08 17:42:56 +00:00 committed by Mehdi Amini
parent a575636862
commit f4303855c4
1 changed files with 5 additions and 0 deletions

View File

@ -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<LLVM::LLVMDialect>();