Skip to content

Commit

Permalink
[CIR][CodeGen] Add missing conversion patterns for ControlFlowDialect
Browse files Browse the repository at this point in the history
Fixes llvm#4.
  • Loading branch information
cmarcelo authored and lanza committed Jan 27, 2024
1 parent c290dd4 commit aefcc44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions clang/lib/CIR/CodeGen/LowerToLLVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
#include "mlir/Conversion/ArithToLLVM/ArithToLLVM.h"
#include "mlir/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.h"
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h"
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h"
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
Expand Down Expand Up @@ -492,6 +493,8 @@ void ConvertCIRToLLVMPass::runOnOperation() {
populateAffineToStdConversionPatterns(patterns);
mlir::arith::populateArithToLLVMConversionPatterns(typeConverter, patterns);
populateSCFToControlFlowConversionPatterns(patterns);
mlir::cf::populateControlFlowToLLVMConversionPatterns(typeConverter,
patterns);
populateFinalizeMemRefToLLVMConversionPatterns(typeConverter, patterns);
populateFuncToLLVMConversionPatterns(typeConverter, patterns);

Expand Down
3 changes: 0 additions & 3 deletions clang/test/CIR/CIRToLLVM/goto.cir
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// RUN: cir-tool %s -canonicalize -cir-to-func -cir-to-memref -o - | FileCheck %s -check-prefix=MLIR
// RUN: cir-tool %s -canonicalize -cir-to-func -cir-to-memref -cir-to-llvm -o - | mlir-translate -mlir-to-llvmir | FileCheck %s -check-prefix=LLVM

// FIXME: after rebasing against July's 2022 mlir, we get "failed to legalize
// operation 'cf.br'" from -cir-to-llvm
// XFAIL: *

module {
Expand Down

0 comments on commit aefcc44

Please sign in to comment.