Skip to content

Commit 7ab075a

Browse files
committed
Handle review comments.
Remove the things from the test case which were not really essential for the test.
1 parent d5adacf commit 7ab075a

File tree

1 file changed

+18
-33
lines changed

1 file changed

+18
-33
lines changed

mlir/test/Target/LLVMIR/llvmir-phi-loc.mlir

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,31 @@
11
// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s
22

3+
llvm.func @test_phi_locations(%arg0: !llvm.ptr) {
4+
%0 = llvm.mlir.constant(1 : i64) : i64 loc(#loc1)
5+
%1 = llvm.mlir.constant(100 : i32) : i32 loc(#loc1)
6+
llvm.br ^bb1(%1, %0 : i32, i64) loc(#loc1)
7+
^bb1(%2: i32 loc(#loc2), %3: i64 loc(#loc3)):
8+
%4 = llvm.icmp "sgt" %3, %0 : i64 loc(#loc1)
9+
llvm.cond_br %4, ^bb2, ^bb1(%2, %3 : i32, i64) loc(#loc1)
10+
^bb2:
11+
llvm.return loc(#loc1)
12+
} loc(#loc4)
313

4-
module attributes {} {
5-
llvm.func @test(%arg0: !llvm.ptr) {
6-
%0 = llvm.mlir.constant(1 : i64) : i64 loc(#loc2)
7-
%1 = llvm.alloca %0 x i32 : (i64) -> !llvm.ptr loc(#loc2)
8-
%3 = llvm.mlir.constant(100 : index) : i64 loc(#loc2)
9-
%7 = llvm.trunc %0 : i64 to i32 loc(#loc2)
10-
llvm.br ^bb1(%7, %3 : i32, i64) loc(#loc2)
11-
^bb1(%8: i32 loc(#loc4), %9: i64 loc(#loc5)): // 2 preds: ^bb0, ^bb2
12-
%10 = llvm.icmp "sgt" %9, %0 : i64 loc(#loc3)
13-
llvm.cond_br %10, ^bb2, ^bb3 loc(#loc3)
14-
^bb2: // pred: ^bb1
15-
%13 = llvm.load %1 : !llvm.ptr -> i32 loc(#loc3)
16-
%14 = llvm.add %13, %7 : i32 loc(#loc3)
17-
%15 = llvm.sub %9, %0 : i64 loc(#loc3)
18-
llvm.br ^bb1(%14, %15 : i32, i64) loc(#loc3)
19-
^bb3: // pred: ^bb1
20-
llvm.return loc(#loc3)
21-
} loc(#loc6)
22-
}
23-
24-
#int_ty = #llvm.di_basic_type<tag = DW_TAG_base_type, name = "integer",
25-
sizeInBits = 32, encoding = DW_ATE_signed>
2614
#file = #llvm.di_file<"test.f90" in "">
2715
#cu = #llvm.di_compile_unit<id = distinct[0]<>,
2816
sourceLanguage = DW_LANG_Fortran95, file = #file, isOptimized = false,
2917
emissionKind = Full>
30-
#sp_ty = #llvm.di_subroutine_type<callingConvention = DW_CC_normal,
31-
types = #int_ty>
18+
#sp_ty = #llvm.di_subroutine_type<callingConvention = DW_CC_normal>
3219
#sp = #llvm.di_subprogram<id = distinct[1]<>, compileUnit = #cu, scope = #file,
33-
name = "test", file = #file, line = 1, scopeLine = 1,
34-
subprogramFlags = Definition, type = #sp_ty>
20+
name = "test_phi_locations", file = #file, subprogramFlags = Definition,
21+
type = #sp_ty>
3522

36-
#loc1 = loc("test.f90":1:1)
37-
#loc2 = loc("test.f90":15:22)
38-
#loc3 = loc("test.f90":26:3)
39-
#loc4 = loc("test.f90":8:2)
40-
#loc5 = loc("test.f90":9:5)
41-
#loc6 = loc(fused<#sp>[#loc1])
23+
#loc1 = loc("test.f90":15:22)
24+
#loc2 = loc("test.f90":8:2)
25+
#loc3 = loc("test.f90":9:5)
26+
#loc4 = loc(fused<#sp>[#loc1])
4227

43-
// CHECK-LABEl: define void @test
28+
// CHECK-LABEL: define void @test
4429
// CHECK: phi i32{{.*}}!dbg ![[LOC1:[0-9]+]]
4530
// CHECK: phi i64{{.*}}!dbg ![[LOC2:[0-9]+]]
4631
// CHECK: ![[LOC1]] = !DILocation(line: 8, column: 2{{.*}})

0 commit comments

Comments
 (0)