Skip to content

Commit ac47098

Browse files
committed
Minimize testcase as per review comments.
1 parent 450e7ca commit ac47098

File tree

1 file changed

+10
-47
lines changed

1 file changed

+10
-47
lines changed

mlir/test/Target/LLVMIR/omptarget-debug.mlir

Lines changed: 10 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,68 +5,31 @@ module attributes {omp.is_target_device = true} {
55
%0 = llvm.mlir.constant(1 : i64) : i64
66
%1 = llvm.alloca %0 x i32 : (i64) -> !llvm.ptr<5>
77
%2 = llvm.addrspacecast %1 : !llvm.ptr<5> to !llvm.ptr
8-
%3 = llvm.mlir.constant(1 : i64) : i64
9-
%4 = llvm.alloca %3 x i32 : (i64) -> !llvm.ptr<5>
10-
%5 = llvm.addrspacecast %4 : !llvm.ptr<5> to !llvm.ptr
11-
%6 = llvm.mlir.constant(1 : i64) : i64
12-
%7 = llvm.alloca %6 x i32 : (i64) -> !llvm.ptr<5>
13-
%8 = llvm.addrspacecast %7 : !llvm.ptr<5> to !llvm.ptr
14-
%9 = omp.map_info var_ptr(%2 : !llvm.ptr, i32) map_clauses(tofrom) capture(ByRef) -> !llvm.ptr {name = ""}
15-
%10 = omp.map_info var_ptr(%5 : !llvm.ptr, i32) map_clauses(tofrom) capture(ByRef) -> !llvm.ptr {name = ""}
16-
omp.target map_entries(%9 -> %arg0, %10 -> %arg1 : !llvm.ptr, !llvm.ptr) {
8+
%9 = omp.map.info var_ptr(%2 : !llvm.ptr, i32) map_clauses(tofrom) capture(ByRef) -> !llvm.ptr {name = ""}
9+
omp.target map_entries(%9 -> %arg0 : !llvm.ptr) {
1710
^bb0(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
18-
%12 = llvm.mlir.constant(2 : i32) : i32
1911
%13 = llvm.mlir.constant(1 : i32) : i32
2012
%14 = llvm.load %arg0 : !llvm.ptr -> i32 loc(#loc2)
2113
%15 = llvm.add %14, %13 : i32 loc(#loc2)
2214
llvm.store %15, %arg0 : i32, !llvm.ptr loc(#loc2)
23-
%16 = llvm.load %arg0 : !llvm.ptr -> i32 loc(#loc3)
24-
%17 = llvm.add %16, %12 : i32 loc(#loc3)
25-
llvm.store %17, %arg1 : i32, !llvm.ptr loc(#loc3)
26-
omp.terminator
27-
}
28-
%11 = omp.map_info var_ptr(%8 : !llvm.ptr, i32) map_clauses(tofrom) capture(ByRef) -> !llvm.ptr {name = ""}
29-
omp.target map_entries(%11 -> %arg0 : !llvm.ptr) {
30-
^bb0(%arg0: !llvm.ptr):
31-
%12 = llvm.mlir.constant(1 : i32) : i32
32-
omp.parallel {
33-
%13 = llvm.load %arg0 : !llvm.ptr -> i32 loc(#loc4)
34-
%14 = llvm.add %13, %12 : i32 loc(#loc4)
35-
llvm.store %14, %arg0 : i32, !llvm.ptr loc(#loc4)
36-
omp.terminator
37-
}
3815
omp.terminator
3916
}
4017
llvm.return
4118
} loc(#loc5)
42-
} loc(#loc)
19+
}
4320
#di_basic_type = #llvm.di_basic_type<tag = DW_TAG_base_type, name = "void", encoding = DW_ATE_address>
4421
#di_file = #llvm.di_file<"target.f90" in "">
45-
#loc = loc("target.f90":0:0)
4622
#loc1 = loc("target.f90":1:1)
47-
#loc2 = loc("target.f90":9:3)
48-
#loc3 = loc("target.f90":10:3)
49-
#loc4 = loc("target.f90":14:3)
23+
#loc2 = loc("target.f90":46:3)
24+
5025
#di_compile_unit = #llvm.di_compile_unit<id = distinct[0]<>, sourceLanguage = DW_LANG_Fortran95, file = #di_file, producer = "Flang", isOptimized = false, emissionKind = LineTablesOnly>
5126
#di_subroutine_type = #llvm.di_subroutine_type<callingConvention = DW_CC_normal, types = #di_basic_type, #di_basic_type>
5227
#di_subprogram = #llvm.di_subprogram<id = distinct[1]<>, compileUnit = #di_compile_unit, scope = #di_file, name = "_QQmain", linkageName = "_QQmain", file = #di_file, line = 1, scopeLine = 1, subprogramFlags = "Definition|Optimized", type = #di_subroutine_type>
5328
#loc5 = loc(fused<#di_subprogram>[#loc1])
5429

55-
// 8: !$omp target map(tofrom: a, b)
56-
// 9: a = a + 1
57-
//10: b = a + 2
58-
//11: !$omp end target
59-
60-
//13: !$omp target parallel map(tofrom: a, b)
61-
//14: c = c + 1
62-
//15: !$omp end target parallel
63-
64-
// CHECK-DAG: [[FILE:.*]] = !DIFile(filename: "target.f90", directory: "")
65-
// CHECK-DAG: [[CU:.*]] = distinct !DICompileUnit(language: DW_LANG_Fortran95, file: [[FILE]], {{.*}})
66-
67-
// CHECK: [[SP1:.*]] = distinct !DISubprogram(name: "__omp_offloading_{{.*}}", {{.*}}, unit: [[CU]])
68-
// CHECK-DAG: !DILocation(line: 9, column: 3, scope: [[SP1]])
69-
// CHECK-DAG: !DILocation(line: 10, column: 3, scope: [[SP1]])
30+
// 45: !$omp target map(tofrom: a)
31+
// 46: a = a + 1
32+
// 47: !$omp end target
7033

71-
// CHECK: [[SP2:.*]] = distinct !DISubprogram(name: "__omp_offloading_{{.*}}omp_par", {{.*}}, unit: [[CU]])
72-
// CHECK: !DILocation(line: 14, column: 3, scope: [[SP2]])
34+
// CHECK: [[SP:.*]] = distinct !DISubprogram(name: "__omp_offloading_{{.*}}"{{.*}})
35+
// CHECK-DAG: !DILocation(line: 46, column: 3, scope: [[SP]])

0 commit comments

Comments
 (0)