Skip to content

Commit 3e80f64

Browse files
htyulanza
authored andcommitted
[CIR] Introduce cir-translate to replace mlir-translate (llvm#177)
This change introduces `cir-translate` as a replacement of `mlir-translate` to convert CIR directly to LLVM IR. The main benefit of this is to utilize the CIR attribute interface to handle CIR-specific attributes such as `cir.extra`. Other advantages at this time, besides the cir attribute support, could be that we can go directly from CIR to LLVMIR without exposing the intermediate MLIR LLVM dialect form. Previously `cir-tool` emit the LLVM dialect form and `milr-translate` took it from there. Now `cir-translate` can directly take CIR and yield LLVMIR. I'm also renaming `cir-tool` to `cir-opt` which eventually would be just a CIR-to-CIR transformer, but for now I'm keeping the functionality of CIR to LLVM dialect. So, `cir-opt` will do all CIR-to-CIR transforms, just like LLVM `opt` or `mlir-opt`, and `cir-translate` will handle CIR to LLVMIR translation, and LLVMIR-to-LLVMIR transforms, like the LLVM `llc` or the `mlir-translate`
1 parent 8031bc5 commit 3e80f64

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+196
-104
lines changed

clang/include/clang/CIR/LowerToLLVM.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ namespace cir {
3131
namespace direct {
3232
std::unique_ptr<llvm::Module>
3333
lowerDirectlyFromCIRToLLVMIR(mlir::ModuleOp theModule,
34-
std::unique_ptr<mlir::MLIRContext> mlirCtx,
3534
llvm::LLVMContext &llvmCtx);
3635
}
3736

clang/lib/CIR/FrontendAction/CIRGenAction.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ static std::unique_ptr<llvm::Module> lowerFromCIRToLLVMIR(
7676
const clang::FrontendOptions &feOptions, mlir::ModuleOp mlirMod,
7777
std::unique_ptr<mlir::MLIRContext> mlirCtx, llvm::LLVMContext &llvmCtx) {
7878
if (feOptions.ClangIRDirectLowering)
79-
return direct::lowerDirectlyFromCIRToLLVMIR(mlirMod, std::move(mlirCtx),
80-
llvmCtx);
79+
return direct::lowerDirectlyFromCIRToLLVMIR(mlirMod, llvmCtx);
8180
else
8281
return lowerFromCIRToMLIRToLLVMIR(mlirMod, std::move(mlirCtx), llvmCtx);
8382
}

clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,9 +1416,9 @@ extern void registerCIRDialectTranslation(mlir::MLIRContext &context);
14161416

14171417
std::unique_ptr<llvm::Module>
14181418
lowerDirectlyFromCIRToLLVMIR(mlir::ModuleOp theModule,
1419-
std::unique_ptr<mlir::MLIRContext> mlirCtx,
14201419
LLVMContext &llvmCtx) {
1421-
mlir::PassManager pm(mlirCtx.get());
1420+
mlir::MLIRContext *mlirCtx = theModule.getContext();
1421+
mlir::PassManager pm(mlirCtx);
14221422

14231423
pm.addPass(createConvertCIRToLLVMPass());
14241424

clang/test/CIR/IR/array.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-tool %s | cir-tool | FileCheck %s
1+
// RUN: cir-opt %s | cir-opt | FileCheck %s
22

33
!u32i = !cir.int<u, 32>
44

clang/test/CIR/IR/branch.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-tool %s | FileCheck %s
1+
// RUN: cir-opt %s | FileCheck %s
22

33
#false = #cir.bool<false> : !cir.bool
44
#true = #cir.bool<true> : !cir.bool

clang/test/CIR/IR/call.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-tool %s | FileCheck %s
1+
// RUN: cir-opt %s | FileCheck %s
22

33
!s32i = !cir.int<s, 32>
44
!fnptr = !cir.ptr<!cir.func<!s32i (!cir.ptr<!s32i>)>>
@@ -10,4 +10,4 @@ module {
1010
}
1111
}
1212

13-
// CHECK: %0 = cir.call %arg0(%arg1) : (!cir.ptr<!cir.func<!s32i (!cir.ptr<!s32i>)>>, !s32i) -> !s32i
13+
// CHECK: %0 = cir.call %arg0(%arg1) : (!cir.ptr<!cir.func<!s32i (!cir.ptr<!s32i>)>>, !s32i) -> !s32i

clang/test/CIR/IR/cast.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-tool %s | cir-tool | FileCheck %s
1+
// RUN: cir-opt %s | cir-opt | FileCheck %s
22
!s32i = !cir.int<s, 32>
33

44
module {

clang/test/CIR/IR/cir-ops.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Test the CIR operations can parse and print correctly (roundtrip)
22

3-
// RUN: cir-tool %s | cir-tool | FileCheck %s
3+
// RUN: cir-opt %s | cir-opt | FileCheck %s
44
!s32i = !cir.int<s, 32>
55
!s8i = !cir.int<s, 8>
66
!u64i = !cir.int<u, 64>

clang/test/CIR/IR/func.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-tool %s | FileCheck %s
1+
// RUN: cir-opt %s | FileCheck %s
22
!s32i = !cir.int<s, 32>
33
!u8i = !cir.int<u, 8>
44
module {
@@ -42,4 +42,4 @@ module {
4242
cir.func no_proto private @no_proto(...) -> !s32i
4343
}
4444

45-
// CHECK: cir.func @l0()
45+
// CHECK: cir.func @l0()

clang/test/CIR/IR/global.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-tool %s | FileCheck %s
1+
// RUN: cir-opt %s | FileCheck %s
22
!s8i = !cir.int<s, 8>
33
!s32i = !cir.int<s, 32>
44
!s64i = !cir.int<s, 64>

clang/test/CIR/IR/inlineAttr.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s | FileCheck %s -check-prefix=CIR
2-
// RUN: cir-tool %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
1+
// RUN: cir-opt %s | FileCheck %s -check-prefix=CIR
2+
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
33

44
module {
55
cir.func @l0() extra( {cir.inline = #cir.inline<no>} ) {

clang/test/CIR/IR/int.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// cir.global external @a = #cir.int<255> : !cir.int<u, 8>
33
// }
44

5-
// RUN: cir-tool %s | FileCheck %s
5+
// RUN: cir-opt %s | FileCheck %s
66
!s8i = !cir.int<s, 8>
77
!s16i = !cir.int<s, 16>
88
!s32i = !cir.int<s, 32>

clang/test/CIR/IR/invalid.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Test attempts to build bogus CIR
2-
// RUN: cir-tool %s -verify-diagnostics -split-input-file
2+
// RUN: cir-opt %s -verify-diagnostics -split-input-file
33

44
!u32i = !cir.int<u, 32>
55

clang/test/CIR/IR/loop.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-tool %s | FileCheck %s
1+
// RUN: cir-opt %s | FileCheck %s
22
#false = #cir.bool<false> : !cir.bool
33
#true = #cir.bool<true> : !cir.bool
44
!u32i = !cir.int<u, 32>
@@ -212,4 +212,4 @@ cir.func @l2() {
212212
// CHECK-NEXT: }
213213
// CHECK-NEXT: }
214214
// CHECK-NEXT: cir.return
215-
// CHECK-NEXT: }
215+
// CHECK-NEXT: }

clang/test/CIR/IR/module.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-tool %s -split-input-file -o %t.cir
1+
// RUN: cir-opt %s -split-input-file -o %t.cir
22
// RUN: FileCheck --input-file=%t.cir %s
33

44
// Should parse and print C source language attribute.

clang/test/CIR/IR/ptr_stride.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-tool %s | cir-tool | FileCheck %s
1+
// RUN: cir-opt %s | cir-opt | FileCheck %s
22
!s32i = !cir.int<s, 32>
33

44
module {

clang/test/CIR/IR/struct.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-tool %s | cir-tool | FileCheck %s
1+
// RUN: cir-opt %s | cir-opt | FileCheck %s
22

33
!u8i = !cir.int<u, 8>
44
!u16i = !cir.int<u, 16>

clang/test/CIR/IR/switch.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-tool %s | FileCheck %s
1+
// RUN: cir-opt %s | FileCheck %s
22
!s32i = !cir.int<s, 32>
33

44
cir.func @s0() {

clang/test/CIR/IR/ternary.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-tool %s | cir-tool | FileCheck %s
1+
// RUN: cir-opt %s | cir-opt | FileCheck %s
22
!u32i = !cir.int<u, 32>
33

44
module {

clang/test/CIR/IR/types.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-tool %s | cir-tool | FileCheck %s
1+
// RUN: cir-opt %s | cir-opt | FileCheck %s
22

33
!u32i = !cir.int<u, 32>
44

clang/test/CIR/Lowering/ThroughMLIR/array.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -cir-to-mlir -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -cir-to-mlir -cir-to-mlir -cir-mlir-to-llvm -o - | mlir-translate -mlir-to-llvmir | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -cir-to-mlir -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-opt %s -cir-to-mlir -cir-to-mlir -cir-mlir-to-llvm -o - | mlir-translate -mlir-to-llvmir | FileCheck %s -check-prefix=LLVM
33

44
module {
55
cir.func @foo() {

clang/test/CIR/Lowering/ThroughMLIR/binop-fp.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -cir-to-mlir -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -cir-to-mlir -cir-mlir-to-llvm -o - | mlir-translate -mlir-to-llvmir | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -cir-to-mlir -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-opt %s -cir-to-mlir -cir-mlir-to-llvm -o - | mlir-translate -mlir-to-llvmir | FileCheck %s -check-prefix=LLVM
33

44
module {
55
cir.func @foo() {

clang/test/CIR/Lowering/ThroughMLIR/binop-unsigned-int.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -cir-to-mlir -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -cir-to-mlir -cir-mlir-to-llvm -o - | mlir-translate -mlir-to-llvmir | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -cir-to-mlir -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-opt %s -cir-to-mlir -cir-mlir-to-llvm -o - | mlir-translate -mlir-to-llvmir | FileCheck %s -check-prefix=LLVM
33

44
module {
55
cir.func @foo() {

clang/test/CIR/Lowering/ThroughMLIR/bool.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -cir-to-mlir -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -cir-to-mlir -cir-mlir-to-llvm -o - | mlir-translate -mlir-to-llvmir | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -cir-to-mlir -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-opt %s -cir-to-mlir -cir-mlir-to-llvm -o - | mlir-translate -mlir-to-llvmir | FileCheck %s -check-prefix=LLVM
33

44
#false = #cir.bool<false> : !cir.bool
55
#true = #cir.bool<true> : !cir.bool

clang/test/CIR/Lowering/ThroughMLIR/cmp.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -cir-to-mlir -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -cir-to-mlir -cir-mlir-to-llvm -o - | mlir-translate -mlir-to-llvmir | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -cir-to-mlir -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-opt %s -cir-to-mlir -cir-mlir-to-llvm -o - | mlir-translate -mlir-to-llvmir | FileCheck %s -check-prefix=LLVM
33

44
module {
55
cir.func @foo() {

clang/test/CIR/Lowering/ThroughMLIR/dot.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-tool %s -cir-to-mlir -o %t.mlir
1+
// RUN: cir-opt %s -cir-to-mlir -o %t.mlir
22
// RUN: FileCheck --input-file=%t.mlir %s
33
// XFAIL: *
44

clang/test/CIR/Lowering/ThroughMLIR/goto.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -canonicalize -cir-to-mlir -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -canonicalize -cir-to-mlir -cir-mlir-to-llvm -o - | mlir-translate -mlir-to-llvmir | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -canonicalize -cir-to-mlir -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-opt %s -canonicalize -cir-to-mlir -cir-mlir-to-llvm -o - | mlir-translate -mlir-to-llvmir | FileCheck %s -check-prefix=LLVM
33

44
module {
55
cir.func @foo() {

clang/test/CIR/Lowering/ThroughMLIR/memref.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -cir-to-mlir -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -cir-to-mlir -cir-mlir-to-llvm -o - | mlir-translate -mlir-to-llvmir | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -cir-to-mlir -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-opt %s -cir-to-mlir -cir-mlir-to-llvm -o - | mlir-translate -mlir-to-llvmir | FileCheck %s -check-prefix=LLVM
33

44
module {
55
cir.func @foo() -> i32 {

clang/test/CIR/Lowering/ThroughMLIR/unary-inc-dec.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -cir-to-mlir -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -cir-to-mlir -cir-mlir-to-llvm -o - | mlir-translate -mlir-to-llvmir | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -cir-to-mlir -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-opt %s -cir-to-mlir -cir-mlir-to-llvm -o - | mlir-translate -mlir-to-llvmir | FileCheck %s -check-prefix=LLVM
33

44
module {
55
cir.func @foo() {

clang/test/CIR/Lowering/ThroughMLIR/unary-plus-minus.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -cir-to-mlir -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -cir-to-mlir -cir-mlir-to-llvm -o - | mlir-translate -mlir-to-llvmir | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -cir-to-mlir -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-opt %s -cir-to-mlir -cir-mlir-to-llvm -o - | mlir-translate -mlir-to-llvmir | FileCheck %s -check-prefix=LLVM
33

44
module {
55
cir.func @foo() {

clang/test/CIR/Lowering/array.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -cir-to-llvm -o - | mlir-translate -mlir-to-llvmir -allow-unregistered-dialect | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-translate %s -cir-to-llvmir -o - | FileCheck %s -check-prefix=LLVM
33

44
module {
55
cir.func @foo() {

clang/test/CIR/Lowering/binop-fp.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -cir-to-llvm -o - | mlir-translate -mlir-to-llvmir -allow-unregistered-dialect | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-translate %s -cir-to-llvmir | FileCheck %s -check-prefix=LLVM
33

44
module {
55
cir.func @foo() {

clang/test/CIR/Lowering/binop-signed-int.cir

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-tool %s -cir-to-llvm -o %t.mlir
1+
// RUN: cir-opt %s -cir-to-llvm -o %t.mlir
22
// RUN: FileCheck --input-file=%t.mlir %s
33

44
!s32i = !cir.int<s, 32>
@@ -62,4 +62,3 @@ module {
6262
cir.return
6363
}
6464
}
65-

clang/test/CIR/Lowering/binop-unsigned-int.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -cir-to-llvm -o - | mlir-translate -mlir-to-llvmir -allow-unregistered-dialect | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-translate %s -cir-to-llvmir | FileCheck %s -check-prefix=LLVM
33
!u32i = !cir.int<u, 32>
44

55
module {

clang/test/CIR/Lowering/bool.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -cir-to-llvm -o - | mlir-translate -mlir-to-llvmir -allow-unregistered-dialect | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-translate %s -cir-to-llvmir | FileCheck %s -check-prefix=LLVM
33

44
#false = #cir.bool<false> : !cir.bool
55
#true = #cir.bool<true> : !cir.bool

clang/test/CIR/Lowering/branch.cir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -cir-to-llvm -o - | mlir-translate -mlir-to-llvmir -allow-unregistered-dialect | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-translate %s -cir-to-llvmir | FileCheck %s -check-prefix=LLVM
33

44
!s32i = !cir.int<s, 32>
55
cir.func @foo(%arg0: !cir.bool) -> !s32i {
@@ -25,7 +25,7 @@ cir.func @foo(%arg0: !cir.bool) -> !s32i {
2525
// MLIR-NEXT: }
2626
// MLIR-NEXT: }
2727

28-
// LLVM: define i32 @foo(i8 %0) {
28+
// LLVM: define i32 @foo(i8 %0)
2929
// LLVM-NEXT: %2 = trunc i8 %0 to i1
3030
// LLVM-NEXT: br i1 %2, label %3, label %4
3131
// LLVM-EMPTY:

clang/test/CIR/Lowering/call.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -cir-to-llvm -o - | mlir-translate -mlir-to-llvmir -allow-unregistered-dialect | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-translate %s -cir-to-llvmir | FileCheck %s -check-prefix=LLVM
33

44
module {
55
cir.func @a() {

clang/test/CIR/Lowering/cast.cir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -cir-to-llvm -o - | mlir-translate -mlir-to-llvmir -allow-unregistered-dialect | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-translate %s -cir-to-llvmir | FileCheck %s -check-prefix=LLVM
33
!s16i = !cir.int<s, 16>
44
!s32i = !cir.int<s, 32>
55
!s64i = !cir.int<s, 64>
@@ -22,7 +22,7 @@ module {
2222
// MLIR-NEXT: }
2323

2424

25-
// LLVM: define i32 @foo(i32 %0) {
25+
// LLVM: define i32 @foo(i32 %0)
2626
// LLVM-NEXT: %2 = icmp ne i32 %0, 0
2727
// LLVM-NEXT: %3 = zext i1 %2 to i8
2828
// LLVM-NEXT: ret i32 %0

clang/test/CIR/Lowering/cmp.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -cir-to-llvm -o - | mlir-translate -mlir-to-llvmir -allow-unregistered-dialect | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-translate %s -cir-to-llvmir | FileCheck %s -check-prefix=LLVM
33
!s32i = !cir.int<s, 32>
44
module {
55
cir.func @foo() {

clang/test/CIR/Lowering/dot.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-tool %s -cir-to-llvm -o %t.mlir
1+
// RUN: cir-opt %s -cir-to-llvm -o %t.mlir
22
// RUN: FileCheck --input-file=%t.mlir %s -check-prefix=MLIR
33

44
!s32i = !cir.int<s, 32>

clang/test/CIR/Lowering/func.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-tool %s -cir-to-llvm -o %t.mlir
1+
// RUN: cir-opt %s -cir-to-llvm -o %t.mlir
22
// RUN: FileCheck %s -check-prefix=MLIR --input-file=%t.mlir
33
// XFAIL: *
44

clang/test/CIR/Lowering/globals.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -cir-to-llvm -o - | mlir-translate -mlir-to-llvmir -allow-unregistered-dialect | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-translate %s -cir-to-llvmir | FileCheck %s -check-prefix=LLVM
33

44
!s16i = !cir.int<s, 16>
55
!s32i = !cir.int<s, 32>

clang/test/CIR/Lowering/goto.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -canonicalize -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -canonicalize -cir-to-llvm -o - | mlir-translate -mlir-to-llvmir -allow-unregistered-dialect | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -canonicalize -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-opt %s -canonicalize -o - | cir-translate -cir-to-llvmir | FileCheck %s -check-prefix=LLVM
33

44
!u32i = !cir.int<u, 32>
55

clang/test/CIR/Lowering/hello.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-tool %s -cir-to-llvm -o %t.mlir
1+
// RUN: cir-opt %s -cir-to-llvm -o %t.mlir
22
// RUN: FileCheck --input-file=%t.mlir %s
33

44
!s32i = !cir.int<s, 32>

clang/test/CIR/Lowering/if.cir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -cir-to-llvm -o - | mlir-translate -mlir-to-llvmir -allow-unregistered-dialect | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-translate %s -cir-to-llvmir | FileCheck %s -check-prefix=LLVM
33
!s32i = !cir.int<s, 32>
44

55
module {
@@ -31,7 +31,7 @@ module {
3131
// MLIR-NEXT: llvm.return %arg0 : i32
3232
// MLIR-NEXT: }
3333

34-
// LLVM: define i32 @foo(i32 %0) {
34+
// LLVM: define i32 @foo(i32 %0)
3535
// LLVM-NEXT: %2 = icmp ne i32 %0, 0
3636
// LLVM-NEXT: %3 = zext i1 %2 to i8
3737
// LLVM-NEXT: %4 = trunc i8 %3 to i1

clang/test/CIR/Lowering/loadstorealloca.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: cir-tool %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-tool %s -cir-to-llvm -o - | mlir-translate -mlir-to-llvmir -allow-unregistered-dialect | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2+
// RUN: cir-translate %s -cir-to-llvmir | FileCheck %s -check-prefix=LLVM
33
!u32i = !cir.int<u, 32>
44

55
module {

clang/test/CIR/Lowering/loop.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-tool %s -cir-to-llvm -o %t.mlir
1+
// RUN: cir-opt %s -cir-to-llvm -o %t.mlir
22
// RUN: FileCheck --input-file=%t.mlir %s -check-prefix=MLIR
33

44
!s32i = !cir.int<s, 32>

0 commit comments

Comments
 (0)