File tree Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Original file line number Diff line number Diff line change 11// RUN: %clang_cc1 -fclangir %s -O0 -triple "spirv64-unknown-unknown" -emit-cir -o %t.cir
22// RUN: FileCheck %s --input-file=%t.cir --check-prefix=CIR
3- // RUN-DISABLE : %clang_cc1 -fclangir %s -O0 -triple "spirv64-unknown-unknown" -emit-llvm -fno-clangir-call-conv-lowering -o %t.ll
4- // RUN-DISABLE : FileCheck %s --input-file=%t.ll --check-prefix=LLVM
3+ // RUN: %clang_cc1 -fclangir %s -O0 -triple "spirv64-unknown-unknown" -emit-llvm -fno-clangir-call-conv-lowering -o %t.ll
4+ // RUN: FileCheck %s --input-file=%t.ll --check-prefix=LLVM
55
66// CIR: cir.func {{.*}}@get_dummy_id{{.*}} cc(spir_function)
77// LLVM-DAG: declare{{.*}} spir_func i32 @get_dummy_id(
88int get_dummy_id (int D );
99
10- // CIR: cir.func {{.*}}@bar{{.*}} cc(spir_kernel)
11- // LLVM-DAG: declare{{.*}} spir_kernel void @bar(
12- kernel void bar (global int * A );
13-
1410// CIR: cir.func {{.*}}@foo{{.*}} cc(spir_kernel)
1511// LLVM-DAG: define{{.*}} spir_kernel void @foo(
1612kernel void foo (global int * A ) {
1713 int id = get_dummy_id (0 );
1814 // CIR: %{{[0-9]+}} = cir.call @get_dummy_id(%2) : (!s32i) -> !s32i cc(spir_function)
1915 // LLVM: %{{[a-z0-9_]+}} = call spir_func i32 @get_dummy_id(
20- A [id ] = id ;
21- bar (A );
22- // CIR: cir.call @bar(%8) : (!cir.ptr<!s32i, addrspace(offload_global)>) -> () cc(spir_kernel)
23- // LLVM: call spir_kernel void @bar(ptr addrspace(1)
2416}
Original file line number Diff line number Diff line change @@ -8,14 +8,10 @@ module {
88 cir.func private @my_add(%a: !s32i, %b: !s32i) -> !s32i cc(spir_function)
99
1010 cir.func @ind(%fnptr: !fnptr, %a : !s32i) {
11- // https://github.com/llvm/clangir/issues/1814
12- // %1 = cir.call %fnptr(%a) : (!fnptr, !s32i) -> !s32i cc(spir_kernel)
13- // LLVM-DISABLE: %{{[0-9]+}} = call spir_kernel i32 %{{[0-9]+}}(i32 %{{[0-9]+}})
14-
15- %2 = cir.call %fnptr(%a) : (!fnptr, !s32i) -> !s32i cc(spir_function)
11+ %1 = cir.call %fnptr(%a) : (!fnptr, !s32i) -> !s32i cc(spir_function)
1612 // LLVM: %{{[0-9]+}} = call spir_func i32 %{{[0-9]+}}(i32 %{{[0-9]+}})
1713
18- %3 = cir.call @my_add(%2 , %2 ) : (!s32i, !s32i) -> !s32i cc(spir_function)
14+ %2 = cir.call @my_add(%1 , %1 ) : (!s32i, !s32i) -> !s32i cc(spir_function)
1915 // LLVM: %{{[0-9]+}} = call spir_func i32 @my_add(i32 %{{[0-9]+}}, i32 %{{[0-9]+}})
2016
2117 cir.return
You can’t perform that action at this time.
0 commit comments