Skip to content

Commit a324595

Browse files
committed
Actually enable -verify-roundtrip, remove AliasScopeAttr for now because it cannot roundtrip
1 parent 753f296 commit a324595

File tree

3 files changed

+2
-60
lines changed

3 files changed

+2
-60
lines changed

mlir/include/mlir/Dialect/LLVMIR/LLVMDialectBytecode.td

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,6 @@ class EnumClassFlag<string flag, string getter> :
6161
// needed.
6262
//===----------------------------------------------------------------------===//
6363

64-
//===----------------------------------------------------------------------===//
65-
// AliasScopeAttr
66-
//===----------------------------------------------------------------------===//
67-
68-
def AliasScopeAttr : DialectAttribute<(attr
69-
Attr<"Attribute">:$id,
70-
Attr<"AliasScopeDomainAttr">:$domain,
71-
OptionalAttribute<"StringAttr">:$description
72-
)>;
73-
7464
//===----------------------------------------------------------------------===//
7565
// DIBasicTypeAttr
7666
//===----------------------------------------------------------------------===//
@@ -330,7 +320,6 @@ def LoopAnnotationAttr : DialectAttribute<(attr
330320
// All the attributes with custom bytecode handling.
331321
def LLVMDialectAttributes : DialectAttributes<"LLVM"> {
332322
let elems = [
333-
AliasScopeAttr,
334323
DIBasicTypeAttr,
335324
DICompileUnitAttr,
336325
DICompositeTypeAttr,
Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: mlir-opt -emit-bytecode %s | mlir-opt --mlir-print-debuginfo | FileCheck %s
1+
// RUN: mlir-opt -verify-roundtrip %s
22

33
#access_group = #llvm.access_group<id = distinct[0]<>>
44
#access_group1 = #llvm.access_group<id = distinct[1]<>>
@@ -8,8 +8,6 @@
88
#loc6 = loc(fused<#di_subprogram>[#loc1])
99
#loc7 = loc(fused<#di_subprogram>[#loc2])
1010
#loop_annotation = #llvm.loop_annotation<disableNonforced = false, mustProgress = true, startLoc = #loc6, endLoc = #loc7, parallelAccesses = #access_group, #access_group1>
11-
#alias_scope_domain = #llvm.alias_scope_domain<id = distinct[0]<>, description = "The domain">
12-
#alias_scope = #llvm.alias_scope<id = distinct[0]<>, domain = #alias_scope_domain, description = "The domain">
1311
module {
1412
llvm.func @imp_fn() {
1513
llvm.return loc(#loc2)
@@ -19,10 +17,6 @@ module {
1917
^bb1: // pred: ^bb0
2018
llvm.return loc(#loc5)
2119
} loc(#loc3)
22-
llvm.func @experimental_noalias_scope_decl() {
23-
llvm.intr.experimental.noalias.scope.decl #alias_scope
24-
llvm.return
25-
}
2620
} loc(#loc)
2721
#di_file = #llvm.di_file<"test.f90" in "">
2822
#di_subroutine_type = #llvm.di_subroutine_type<callingConvention = DW_CC_program>
@@ -39,43 +33,3 @@ module {
3933
#di_imported_entity1 = #llvm.di_imported_entity<tag = DW_TAG_imported_module, scope = #di_subprogram, entity = #di_module1, file = #di_file, line = 1>
4034
#di_subprogram1 = #llvm.di_subprogram<recId = distinct[2]<>, id = distinct[6]<>, compileUnit = #di_compile_unit, scope = #di_file, name = "imp_fn", file = #di_file, subprogramFlags = Definition, type = #di_subroutine_type, retainedNodes = #di_imported_entity, #di_imported_entity1>
4135
#loc8 = loc(fused<#di_subprogram1>[#loc1])
42-
43-
// CHECK: #access_group = #llvm.access_group<id = distinct[0]<>>
44-
// CHECK: #access_group1 = #llvm.access_group<id = distinct[1]<>>
45-
// CHECK: #alias_scope_domain = #llvm.alias_scope_domain<id = distinct[2]<>, description = "The domain">
46-
// CHECK: #di_subprogram = #llvm.di_subprogram<recId = distinct[3]<>>
47-
// CHECK: {{.*}} = loc("test.f90":12:14)
48-
// CHECK: {{.*}} = loc("test":4:3)
49-
// CHECK: #alias_scope = #llvm.alias_scope<id = distinct[4]<>, domain = #alias_scope_domain, description = "The domain">
50-
// CHECK: {{.*}} = loc(fused<#di_subprogram>[{{.*}}])
51-
// CHECK: {{.*}} = loc(fused<#di_subprogram>[{{.*}}])
52-
// CHECK: #loop_annotation = #llvm.loop_annotation<disableNonforced = false, mustProgress = true, startLoc = {{.*}}, endLoc = {{.*}}, parallelAccesses = #access_group, #access_group1>
53-
// CHECK: module {
54-
// CHECK: llvm.func @imp_fn() {
55-
// CHECK: llvm.return loc({{.*}})
56-
// CHECK: } loc({{.*}})
57-
// CHECK: llvm.func @loop_annotation_with_locs() {
58-
// CHECK: llvm.br ^bb1 {loop_annotation = #loop_annotation} loc({{.*}})
59-
// CHECK: ^bb1: // pred: ^bb0
60-
// CHECK: llvm.return loc({{.*}})
61-
// CHECK: } loc({{.*}})
62-
// CHECK: llvm.func @experimental_noalias_scope_decl() {
63-
// CHECK: llvm.intr.experimental.noalias.scope.decl #alias_scope loc({{.*}})
64-
// CHECK: llvm.return loc({{.*}})
65-
// CHECK: } loc({{.*}})
66-
// CHECK: } loc({{.*}})
67-
// CHECK: #di_file = #llvm.di_file<"test.f90" in "">
68-
// CHECK: #di_subroutine_type = #llvm.di_subroutine_type<callingConvention = DW_CC_program>
69-
// CHECK: {{.*}} = loc("test":0:0)
70-
// CHECK: {{.*}} = loc("test-path":36:3)
71-
// CHECK: {{.*}} = loc("test-path":37:5)
72-
// CHECK: {{.*}} = loc("test-path":39:5)
73-
// CHECK: #di_compile_unit = #llvm.di_compile_unit<id = distinct[5]<>, sourceLanguage = DW_LANG_Fortran95, file = #di_file, isOptimized = false, emissionKind = Full>
74-
// CHECK: #di_compile_unit1 = #llvm.di_compile_unit<id = distinct[6]<>, sourceLanguage = DW_LANG_Fortran95, file = #di_file, isOptimized = false, emissionKind = Full>
75-
// CHECK: #di_compile_unit2 = #llvm.di_compile_unit<id = distinct[7]<>, sourceLanguage = DW_LANG_Fortran95, file = #di_file, isOptimized = false, emissionKind = Full>
76-
// CHECK: #di_module = #llvm.di_module<file = #di_file, scope = #di_compile_unit1, name = "mod1">
77-
// CHECK: #di_module1 = #llvm.di_module<file = #di_file, scope = #di_compile_unit2, name = "mod2">
78-
// CHECK: #di_imported_entity = #llvm.di_imported_entity<tag = DW_TAG_imported_module, scope = #di_subprogram, entity = #di_module, file = #di_file, line = 1>
79-
// CHECK: #di_imported_entity1 = #llvm.di_imported_entity<tag = DW_TAG_imported_module, scope = #di_subprogram, entity = #di_module1, file = #di_file, line = 1>
80-
// CHECK: #di_subprogram1 = #llvm.di_subprogram<recId = distinct[3]<>, id = distinct[8]<>, compileUnit = #di_compile_unit, scope = #di_file, name = "imp_fn", file = #di_file, subprogramFlags = Definition, type = #di_subroutine_type, retainedNodes = #di_imported_entity, #di_imported_entity1>
81-
// CHECK: {{.*}} = loc(fused<#di_subprogram1>[{{.*}}])

mlir/test/Dialect/LLVMIR/roundtrip.mlir

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// RUN: mlir-opt %s | mlir-opt | FileCheck %s
2-
// RUN: mlir-opt %s -emit-bytecode | mlir-opt | FileCheck %s
1+
// RUN: mlir-opt -verify-roundtrip %s
32

43

54
// CHECK-LABEL: func @baz

0 commit comments

Comments
 (0)