brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.8 KiB · 48d50f7 Raw
111 lines · plain
1; XFAIL: *2; RUN: opt < %s -passes=newgvn -o /dev/null  -pass-remarks-output=%t -S -pass-remarks=gvn \3; RUN:     2>&1 | FileCheck %s4; RUN: cat %t | FileCheck -check-prefix=YAML %s5 6 7; CHECK:      remark: <unknown>:0:0: load of type i32 eliminated{{$}}8; CHECK-NEXT: remark: <unknown>:0:0: load of type i32 eliminated{{$}}9; CHECK-NEXT: remark: <unknown>:0:0: load of type i32 eliminated{{$}}10; CHECK-NOT:  remark:11 12; YAML:      --- !Passed13; YAML-NEXT: Pass:            gvn14; YAML-NEXT: Name:            LoadElim15; YAML-NEXT: Function:        arg16; YAML-NEXT: Args:17; YAML-NEXT:   - String:          'load of type '18; YAML-NEXT:   - Type:            i3219; YAML-NEXT:   - String:          ' eliminated'20; YAML-NEXT:   - String:          ' in favor of '21; YAML-NEXT:   - InfavorOfValue:  i22; YAML-NEXT: ...23; YAML-NEXT: --- !Passed24; YAML-NEXT: Pass:            gvn25; YAML-NEXT: Name:            LoadElim26; YAML-NEXT: Function:        const27; YAML-NEXT: Args:28; YAML-NEXT:   - String:          'load of type '29; YAML-NEXT:   - Type:            i3230; YAML-NEXT:   - String:          ' eliminated'31; YAML-NEXT:   - String:          ' in favor of '32; YAML-NEXT:   - InfavorOfValue:  '4'33; YAML-NEXT: ...34; YAML-NEXT: --- !Passed35; YAML-NEXT: Pass:            gvn36; YAML-NEXT: Name:            LoadElim37; YAML-NEXT: Function:        inst38; YAML-NEXT: Args:39; YAML-NEXT:   - String:          'load of type '40; YAML-NEXT:   - Type:            i3241; YAML-NEXT:   - String:          ' eliminated'42; YAML-NEXT:   - String:          ' in favor of '43; YAML-NEXT:   - InfavorOfValue:  load44; YAML-NEXT: ...45; YAML-NEXT: --- !Missed46; YAML-NEXT: Pass:            gvn47; YAML-NEXT: Name:            LoadClobbered48; YAML-NEXT: DebugLoc:        { File: /tmp/s.c, Line: 3, Column: 3 }49; YAML-NEXT: Function:        may_alias50; YAML-NEXT: Args:51; YAML-NEXT:   - String:          'load of type '52; YAML-NEXT:   - Type:            i3253; YAML-NEXT:   - String:          ' not eliminated'54; YAML-NEXT:   - String:          ' in favor of '55; YAML-NEXT:   - OtherAccess:     load56; YAML-NEXT:     DebugLoc:        { File: /tmp/s.c, Line: 1, Column: 13 }57; YAML-NEXT:   - String:          ' because it is clobbered by '58; YAML-NEXT:   - ClobberedBy:     store59; YAML-NEXT:     DebugLoc:        { File: /tmp/s.c, Line: 2, Column: 10 }60; YAML-NEXT: ...61 62define i32 @arg(ptr %p, i32 %i) {63entry:64  store i32 %i, ptr %p65  %load = load i32, ptr %p66  ret i32 %load67}68 69define i32 @const(ptr %p) {70entry:71  store i32 4, ptr %p72  %load = load i32, ptr %p73  ret i32 %load74}75 76define i32 @inst(ptr %p) {77entry:78  %load1 = load i32, ptr %p79  %load = load i32, ptr %p80  %add = add i32 %load1, %load81  ret i32 %add82}83 84define i32 @may_alias(ptr %p, ptr %r) !dbg !7 {85entry:86  %load1 = load i32, ptr %p, !tbaa !13, !dbg !987  store i32 4, ptr %r, !tbaa !13, !dbg !1088  %load = load i32, ptr %p, !tbaa !13, !dbg !1189  %add = add i32 %load1, %load90  ret i32 %add91}92!llvm.dbg.cu = !{!0}93!llvm.module.flags = !{!3, !4, !5}94!llvm.ident = !{!6}95 96!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (trunk 282540) (llvm/trunk 282542)", isOptimized: true, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !2)97!1 = !DIFile(filename: "/tmp/s.c", directory: "/tmp")98!2 = !{}99!3 = !{i32 2, !"Dwarf Version", i32 4}100!4 = !{i32 2, !"Debug Info Version", i32 3}101!5 = !{i32 1, !"PIC Level", i32 2}102!6 = !{!"clang version 4.0.0 (trunk 282540) (llvm/trunk 282542)"}103!7 = distinct !DISubprogram(name: "may_alias", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: true, unit: !0, retainedNodes: !2)104!8 = !DISubroutineType(types: !2)105!9 = !DILocation(line: 1, column: 13, scope: !7)106!10 = !DILocation(line: 2, column: 10, scope: !7)107!11 = !DILocation(line: 3, column: 3, scope: !7)108 109!12 = !{ !"tbaa root" }110!13 = !{ !"int", !12 }111