brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · 12cb2d0 Raw
78 lines · plain
1; RUN: opt %s -O2 -S -o - | FileCheck %s2; Verify that we emit the same intrinsic at most once.3; rdar://problem/130561094;5; CHECK: #dbg_value(ptr %p6; CHECK-NOT: #dbg_value(ptr %p7; CHECK-NEXT: call i32 @foo8; CHECK: ret9;10;11; typedef struct {12;   long i;13; } i14;14;15; int foo(ptr);16;17;   void init() {18;     ptr p = 0;19;     foo(&p);20;     p->i |= 4;21;     foo(&p);22;   }23;24; ModuleID = 'instcombine_intrinsics.c'25target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"26target triple = "x86_64-apple-macosx10.9.0"27 28%struct.i14 = type { i64 }29 30; Function Attrs: nounwind ssp uwtable31define void @init() #0 !dbg !4 {32  %p = alloca ptr, align 833  call void @llvm.dbg.declare(metadata ptr %p, metadata !11, metadata !DIExpression()), !dbg !1834  store ptr null, ptr %p, align 8, !dbg !1835  %1 = call i32 @foo(ptr %p), !dbg !1936  %2 = load ptr, ptr %p, align 8, !dbg !2037  %3 = load i64, ptr %2, align 8, !dbg !2038  %4 = or i64 %3, 4, !dbg !2039  store i64 %4, ptr %2, align 8, !dbg !2040  %5 = call i32 @foo(ptr %p), !dbg !2141  ret void, !dbg !2242}43 44; Function Attrs: nounwind readnone45declare void @llvm.dbg.declare(metadata, metadata, metadata) #146 47declare i32 @foo(ptr)48 49attributes #0 = { nounwind ssp uwtable }50attributes #1 = { nounwind readnone }51 52!llvm.dbg.cu = !{!0}53!llvm.module.flags = !{!8, !9}54!llvm.ident = !{!10}55 56!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)57!1 = !DIFile(filename: "instcombine_intrinsics.c", directory: "")58!2 = !{}59!4 = distinct !DISubprogram(name: "init", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, scopeLine: 7, file: !1, scope: !5, type: !6, retainedNodes: !2)60!5 = !DIFile(filename: "instcombine_intrinsics.c", directory: "")61!6 = !DISubroutineType(types: !7)62!7 = !{null}63!8 = !{i32 2, !"Dwarf Version", i32 2}64!9 = !{i32 1, !"Debug Info Version", i32 3}65!10 = !{!"clang version 3.5.0 "}66!11 = !DILocalVariable(name: "p", line: 8, scope: !4, file: !5, type: !12)67!12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !13)68!13 = !DIDerivedType(tag: DW_TAG_typedef, name: "i14", line: 3, file: !1, baseType: !14)69!14 = !DICompositeType(tag: DW_TAG_structure_type, line: 1, size: 64, align: 64, file: !1, elements: !15)70!15 = !{!16}71!16 = !DIDerivedType(tag: DW_TAG_member, name: "i", line: 2, size: 64, align: 64, file: !1, scope: !14, baseType: !17)72!17 = !DIBasicType(tag: DW_TAG_base_type, name: "long int", size: 64, align: 64, encoding: DW_ATE_signed)73!18 = !DILocation(line: 8, scope: !4)74!19 = !DILocation(line: 9, scope: !4)75!20 = !DILocation(line: 10, scope: !4)76!21 = !DILocation(line: 11, scope: !4)77!22 = !DILocation(line: 12, scope: !4)78